order - JS SDK Store Reference
This documentation provides a reference to the sdk.store.order
set of methods used to send requests to Medusa's Store API routes.
list#
This method retrieves a paginated list of orders matching the specified filters. It sends a request to the List Orders API route.
Example#
To retrieve the list of orders:
To configure the pagination, pass the limit
and offset
query parameters.
For example, to retrieve only 10 items and skip 10 items:
Using the fields
query parameter, you can specify the fields and relations to retrieve
in each order:
Learn more about the fields
property in the API reference.
Parameters#
Configure the fields to retrieve in the orders.
Headers to pass in the request.
Returns#
Promise
Promise<StoreOrderListResponse>The paginated list of orders.
Promise
Promise<StoreOrderListResponse>retrieve#
This method retrieves an order by its ID. It sends a request to the Get Order API route.
Example#
To retrieve an order by its ID:
To specify the fields and relations to retrieve:
Learn more about the fields
property in the API reference.
Parameters#
id
stringConfigure the fields to retrieve in the order.
Headers to pass in the request.
Returns#
Promise
Promise<object>The order's details.
Promise
Promise<object>requestTransfer#
This method requests a order transfer from a guest account to the current, logged in customer account.
Customer requesting the transfer must be logged in.
Example#
Parameters#
id
stringThe transfer's details.
Configure the fields to retrieve in the order.
Headers to pass in the request.
Returns#
Promise
Promise<StoreOrderResponse>The order details.
Promise
Promise<StoreOrderResponse>cancelTransfer#
This method cancels an order transfer request.
Customer requesting the transfer must be logged in.
Example#
Parameters#
id
stringConfigure the fields to retrieve in the order.
Headers to pass in the request.
Returns#
Promise
Promise<StoreOrderResponse>The order details.
Promise
Promise<StoreOrderResponse>acceptTransfer#
The method called for the original owner to accept the order transfer to a new owner.
Example#
Parameters#
id
stringThe payload containing the transfer token.
Configure the fields to retrieve in the order.
Headers to pass in the request.
Returns#
Promise
Promise<StoreOrderResponse>The order details.
Promise
Promise<StoreOrderResponse>declineTransfer#
The method called for the original owner to decline the order transfer to a new owner.
Example#
Parameters#
id
stringThe payload containing the transfer token.
Configure the fields to retrieve in the order.
Headers to pass in the request.
Returns#
Promise
Promise<StoreOrderResponse>The order details.
Promise
Promise<StoreOrderResponse>