AdminReturnsResource
This class is used to send requests to Admin Return API Routes. All its method
are available in the JS Client under the medusa.admin.returns
property.
All methods in this class require user authentication.
A return can be created by a customer or an admin to return items in an order. Admins can manage these returns and change their state.
Related Guide: How to manage returns.
Methods
cancel
Register a return as canceled. The return can be associated with an order, claim, or swap.
Example
Parameters
id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: {}
Returns
ResponsePromise
ResponsePromise<AdminReturnsCancelRes>RequiredResolves to the details of the order associated with the return. If the return is associated with a claim or a swap, then it'll be the order
that the claim or swap belongs to.
ResponsePromise
ResponsePromise<AdminReturnsCancelRes>Requiredreceive
Mark a return as received. This also updates the status of associated order, claim, or swap accordingly.
Example
Parameters
id
stringRequiredThe received return.
customHeaders
Record<string, any>RequiredDefault: {}
Returns
ResponsePromise
ResponsePromise<AdminReturnsRes>RequiredResolves to the return's details.
ResponsePromise
ResponsePromise<AdminReturnsRes>Requiredlist
Retrieve a list of Returns. The returns can be paginated.
Example
To list returns:
By default, only the first 50
records are retrieved. You can control pagination by specifying the limit
and offset
properties:
Parameters
customHeaders
Record<string, any>RequiredDefault: {}
Paignation configurations to be applied on the retrieved returns.
Returns
ResponsePromise
ResponsePromise<AdminReturnsListRes>RequiredResolves to the list of returns with pagination fields.
ResponsePromise
ResponsePromise<AdminReturnsListRes>Required