updateOrders - Order Module Reference

This documentation provides a reference to the updateOrders 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.

updateOrders(data, sharedContext?): Promise<OrderDTO[]>#

This method updates existing orders. The order IDs are specified in each order object.

Example#

Code
1const orders = await orderModuleService.updateOrders([{2  id: "123",3  email: "example@gmail.com"4}])

Parameters#

The attributes to update in the order.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<OrderDTO[]>
The updated orders.

updateOrders(orderId, data, sharedContext?): Promise<OrderDTO>#

This method updates existing orders.

Example#

Code
1const order = await orderModuleService.updateOrders(2  "123",3  {4    email: "example@gmail.com"5  }6)

Parameters#

orderIdstring
The ID of the order to update.
The attributes to update in the order.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<OrderDTO>
The updated orders.

updateOrders(selector, data, sharedContext?): Promise<OrderDTO[]>#

This method updates existing orders matching the specified filters.

Example#

Code
1const orders = await orderModuleService.updateOrders({2  id: ["123", "321"]3}, {4  email: "example@gmail.com"5})

Parameters#

selectorPartial<FilterableOrderProps>
The filters specifying which orders to update.
The attributes to update in the orders.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<OrderDTO[]>
The updated orders.
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