addOrderAction - Order Module Reference

This documentation provides a reference to the addOrderAction method. This belongs to the Order Module.

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

addOrderAction(data, sharedContext?): Promise<OrderChangeActionDTO>#

This method creates and adds an action to an order and its change.

Example#

Code
1const orderChangeAction = await orderModuleService.addOrderAction({2  order_id: "123",3  order_change_id: "321",4  action: "ITEM_ADD"5})

Parameters#

The action to be added to an order.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<OrderChangeActionDTO>
The order change action added.

addOrderAction(data, sharedContext?): Promise<OrderChangeActionDTO[]>#

This method creates and adds actions to orders and their changes.

Example#

Code
1const orderChangeActions = await orderModuleService.addOrderAction([{2  order_id: "123",3  order_change_id: "321",4  action: "ITEM_ADD"5}])

Parameters#

The order change actions to be created.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<OrderChangeActionDTO[]>
The created order change actions.
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