updateOrderExchanges - Order Module Reference

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

updateOrderExchanges(data, sharedContext?): Promise<OrderExchangeDTO[]>#

This method updates existing order exchanges.

Example#

Code
1const exchanges = await orderModuleService.updateOrderExchanges([2  {3    selector: {4      id: "123"5    },6    data: {7      return_id: "123"8    }9  }10])

Parameters#

The filters specifying which exchanges to update, and the data to update in them.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<OrderExchangeDTO[]>
The updated order exchanges.

updateOrderExchanges(selector, data, sharedContext?): Promise<OrderExchangeDTO[]>#

This method updates existing order exchanges matching the specified filters.

Example#

Code
1const exchanges = await orderModuleService.updateOrderExchanges({2  id: "123"3}, {4  return_id: "123"5})

Parameters#

The filters specifying which order exchanges to update.
The data to update in the order exchanges.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<OrderExchangeDTO[]>
The updated order exchanges.

updateOrderExchanges(id, data, sharedContext?): Promise<OrderExchangeDTO>#

This method updates an existing order exchange.

Example#

Code
1const exchange = await orderModuleService.updateOrderExchanges(2  "123",3  {4    return_id: "123"5  }6)

Parameters#

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

Returns#

PromisePromise<OrderExchangeDTO>
The updated order exchange.
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