AdminSwapsResource
This class is used to send requests to Admin Swap API Routes. All its method
are available in the JS Client under the medusa.admin.swaps property.
All methods in this class require user authentication.
A swap is created by a customer or an admin to exchange an item with a new one. Creating a swap implicitely includes creating a return for the item being exchanged.
Related Guide: How to manage swaps
Methods
list
Retrieve a list of swaps. The swaps can be paginated.
Example
To list swaps:
By default, only the first 50 records are retrieved. You can control pagination by specifying the limit and offset properties:
Parameters
queryAdminGetSwapsParamsPagination configurations to apply on the retrieved swaps.
queryAdminGetSwapsParamscustomHeadersRecord<string, any>RequiredCustom headers to attach to the request.
Default: {}
Returns
Resolves to the list of swaps with pagination fields.
retrieve
Retrieve a swap's details.
Example
Parameters
idstringRequiredThe swap's ID.
customHeadersRecord<string, any>RequiredCustom headers to attach to the request.
Default: {}
Returns
Resolves to the swap's details.
Was this section helpful?