createOrderChangeActionsWorkflow - Medusa Core Workflows Reference

This documentation provides a reference to the createOrderChangeActionsWorkflow. It belongs to the @medusajs/medusa/core-flows package.

This workflow creates order change actions. It's used by other order-related workflows, such as requestItemReturnWorkflow to create an order change action based on changes made to the order.

You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around creating an order change action.

Source Code

Examples#

Input#

CreateOrderChangeActionDTO[]CreateOrderChangeActionDTO[]
The type of action.
order_change_idstringOptional
The associated order change's ID.
order_idstringOptional
The associated order's ID.
return_idstringOptional
The associated return's ID.
claim_idstringOptional
The associated claim's ID.
exchange_idstringOptional
The associated exchange's ID.
versionnumberOptional
The version of the order change action. Once the order change action is confirmed, this becomes the order's version.
referencestringOptional
The name of the data model that this action references. For example, return.
reference_idstringOptional
The ID of the record references of the data model specified in reference. For example, if reference is return, the reference_id is the ID of the return.
internal_notenull | stringOptional
The internal note of the order change action.
amountBigNumberInputOptional
The amount of the order change action.
detailsRecord<string, unknown>Optional
The details of the order change action. This could include the returned items or their changed quantity, based on the type of this action.
appliedbooleanOptional
Whether the action has been applied.

Output#

OrderChangeActionDTO[]OrderChangeActionDTO[]
idstring
The ID of the order change action
order_change_idnull | string
The ID of the associated order change
order_changenull | OrderChangeDTO
The associated order change
order_idnull | string
The ID of the associated order
return_idnull | string
The ID of the associated return.
claim_idnull | string
The ID of the associated claim.
exchange_idnull | string
The ID of the associated exchange.
ordernull | OrderDTO
The associated order
referencestring
The reference of the order change action
reference_idstring
The ID of the reference
The action of the order change action
detailsnull | Record<string, unknown>
The details of the order change action
internal_notenull | string
The internal note of the order change action
created_atstring | Date
When the order change action was created
updated_atstring | Date
When the order change action was updated
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break