updateReturns - Order Module Reference

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

updateReturns(data, sharedContext?): Promise<ReturnDTO[]>#

This method updates existing returns.

Example#

Code
1const returns = await orderModuleService.updateReturns([{2  selector: {3    id: "123"4  },5  data: {6    refund_amount: 107  }8}])

Parameters#

The filters specifying which returns 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<ReturnDTO[]>
The updated returns.

updateReturns(selector, data, sharedContext?): Promise<ReturnDTO[]>#

This method updates existing returns matching the specified filters.

Example#

Code
1const returns = await orderModuleService.updateReturns({2  id: "123"3}, {4  refund_amount: 105})

Parameters#

selectorPartial<FilterableReturnProps>
The filters specifying which returns to update.
dataPartial<UpdateReturnDTO>
The data to update in the returns.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<ReturnDTO[]>
The updated returns.

updateReturns(id, data, sharedContext?): Promise<ReturnDTO>#

This method updates an existing return.

Example#

Code
1const orderReturn = await orderModuleService.updateReturns(2  "123",3  {4    refund_amount: 105  }6)

Parameters#

idstring
The ID of the return.
dataPartial<UpdateReturnDTO>
The data to update.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<ReturnDTO>
The updated return.
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