Order Change
In this document, you'll learn what an order change is and the related concepts.
OrderChange Data Model#
The OrderChange data model represents any kind of change to an order, such as a return, exchange, or edit. Each of these is essentially an order change that is confirmed to apply changes to the original order.
The OrderChange
model's change_type
property indicates the purpose of the order change:
edit
: The order change is making edits to the order, as explained in the Order Edit guide.exchange
: The order change is associated with an exchange, which you can learn about in the Order Exchange guide.claim
: The order change is associated with a claim, which you can learn about in the Order Claim guide.return_request
orreturn_receive
: The order change is associated with a return, which you can learn about in the Order Return guide.
Once the order change is confirmed, its changes are applied to the order.
Order Change Actions#
The actions performed on the original order by an order change, such as adding an item, are represented by the OrderChangeAction data model.
The OrderChangeAction
has an action
property that indicates the type of action to perform on the order, and a details
property that holds additional information related to the action.
The following table lists the possible action
values that Medusa uses and the corresponding details
they carry.
Action | Description | Details |
---|---|---|
| Add an item to the order. The item is only added after the change is confirmed. |
|
| Update an item in an order change. It's only applied to the order after the change is confirmed. |
|
| Remove an item from an order change. This can happen when a claim or an exchange is canceled. |
|
| Set an item to be returned. |
|
| Mark a return item as received. |
|
| Mark a return item that's damaged as received. |
|
| Cancel the return of an item. This can happen when a return is canceled. |
|
| Add a shipping method to an order change. It's only added to the order after the change is confirmed. | No details added. The ID to the shipping method is added in the |
| Remove a shipping method from an order change. This can happen when a claim or an exchange is canceled. | No details added. The ID to the shipping method is added in the |
| Mark an item's quantity as shipped. |
|
| Fulfill an item's quantity as part of a change. |
|
| Mark an item's quantity as delivered. |
|
| Remove an item's quantity from an order change, without adding the quantity back to the item variant's inventory. The quantity isn't removed from the order until the change is confirmed. |
|
| Reinstate an item's quantity in an order change that was previously written off. The quantity is added back to the item variant's inventory when the change is confirmed. |
|
| Transfer an order to another customer. The order is not removed from the original customer until the change is confirmed. | No details added. The ID to the new customer is added in the |
| Update the properties of an order, such as customer information or shipping address. The properties are not updated on the original order until the change is confirmed. |
|
| Add a credit line to an order. The credit line is not added to the original order until the change is confirmed. | No details added. The ID to the associated payment is added in the |