Exchanges API Routes
An exchange is the replacement of an item that the customer ordered with another.
These API routes allow admin users to create and manage exchanges.
GET /admin/exchanges#
List Exchanges
Retrieve a list of exchanges. The exchanges can be filtered by fields such as id. The exchanges can also be sorted or paginated.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.offsetnumberOptionallimitnumberOptionalorderstringOptional-.deleted_atobjectOptionalidstring | string[]Optionalorder_idstring | string[]Optionalstatusstring | string[]Optionalcreated_atobjectOptionalupdated_atobjectOptionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberexchangesobject[]The exchange's exchanges.
exchangesobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges#
Create Exchange
Create an exchange request. Its changes aren't applied on the order until the exchange is confirmed.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
order_idstringdescriptionstringOptionalinternal_notestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
orderobjectThe order change's order.
orderobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/exchanges/{id}#
Get an Exchange
Retrieve an exchange by its ID. You can expand the exchange's relations or select the fields that should be returned using query parameters.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request examples
Responses
200 OK
exchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/cancel#
Cancel an Exchange
Cancel an exchange and its associated return.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
no_notificationbooleanOptionalRequest examples
Responses
200 OK
exchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
reservation-item.deleted: Emitted when reservations are deleted.
POST /admin/exchanges/{id}/inbound/items#
Add Inbound Items to an Exchange
Add inbound (or return) items to an exchange. These inbound items will have the action RETURN_ITEM.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.Request body (application/json)
itemsobject[]OptionalThe details of the inbound (return) items.
itemsobject[]Optionallocation_idstringOptionalRequest examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectreturnobjectThe return's details.
returnobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/inbound/items/{action_id}#
Update an Inbount Item of an Exchange
Update an inbound (or return) item from an exchange using the ID of the item's RETURN_ITEM action.
Every item has an actions property, whose value is an array of actions. You can check the action's name using its action property, and use the value of the id property.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringaction_idstringRETURN_ITEM action.Request body (application/json)
quantitynumberOptionalinternal_notestringOptionalreason_idstringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectreturnobjectThe return's details.
returnobject400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/exchanges/{id}/inbound/items/{action_id}#
Remove Inbound Item from Exchange
Remove an inbound (or return) item from an exchange using the ID of the item's RETURN_ITEM action.
Every item has an actions property, whose value is an array of actions. You can check the action's name using its action property, and use the value of the id property.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringaction_idstringRETURN_ITEM action.Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.Request examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectreturnobjectThe return's details.
returnobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/inbound/shipping-method#
Add an Inbound Shipping Method to an Exchange
Add an inbound (or return) shipping method to an exchange. The inbound shipping method will have a SHIPPING_ADD action.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
shipping_option_idstringcustom_amountnumberOptionaldescriptionstringOptionalinternal_notestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectreturnobjectThe return's details.
returnobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/inbound/shipping-method/{action_id}#
Update Inbound Shipping Method of an Exchange
Update the shipping method for returning items in the exchange using the ID of the method's SHIPPING_ADD action.
Every shipping method has an actions property, whose value is an array of actions. You can check the action's name using its action property, and use the value of the id property.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringaction_idstringSHIPPING_ADD action.Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
custom_amountnumberOptionalinternal_notestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/exchanges/{id}/inbound/shipping-method/{action_id}#
Remove Inbound Shipping Method from Exchange
Remove the shipping method for returning items in the exchange using the ID of the method's SHIPPING_ADD action.
Every shipping method has an actions property, whose value is an array of actions. You can check the action's name using its action property, and use the value of the id property.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringaction_idstringSHIPPING_ADD action.Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.Request examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectreturnobjectThe return's details.
returnobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/outbound/items#
Add Outbound Items to Exchange
Add outbound (or new) items to an exchange. These outbound items will have the action ITEM_ADD.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
itemsobject[]OptionalThe details of outbound items.
itemsobject[]OptionalRequest examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/outbound/items/{action_id}#
Update Outbound Item of an Exchange
Update an outbound (or new) item from an exchange using the ID of the item's ITEM_ADD action.
Every item has an actions property, whose value is an array of actions. You can check the action's name using its action property, and use the value of the id property.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringaction_idstringITEM_ADD action.Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
quantitynumberOptionalinternal_notestringOptionalRequest examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/exchanges/{id}/outbound/items/{action_id}#
Remove Outbound Item from Exchange
Remove an outbound (or new) item from an exchange using the ID of the item's ITEM_ADD action.
Every item has an actions property, whose value is an array of actions. You can check the action's name using its action property, and use the value of the id property.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringaction_idstringITEM_ADD action.Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/outbound/shipping-method#
Add Outbound Shipping Method to Exchange
Add an outbound shipping method to an exchange. The outbound shipping method will have a SHIPPING_ADD action.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
shipping_option_idstringcustom_amountnumberOptionaldescriptionstringOptionalinternal_notestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/outbound/shipping-method/{action_id}#
Update Outbound Shipping Method of Exchange
Update the shipping method for delivering outbound items in the exchange using the ID of the method's SHIPPING_ADD action.
Every shipping method has an actions property, whose value is an array of actions. You can check the action's name using its action property, and use the value of the id property.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringaction_idstringSHIPPING_ADD action.Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
custom_amountnumberOptionalinternal_notestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/exchanges/{id}/outbound/shipping-method/{action_id}#
Remove Outbound Shipping Method from Exchange
Remove the shipping method for delivering outbound items in the exchange using the ID of the method's SHIPPING_ADD action.
Every shipping method has an actions property, whose value is an array of actions. You can check the action's name using its action property, and use the value of the id property.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringaction_idstringSHIPPING_ADD action.Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request examples
Responses
200 OK
order_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/exchanges/{id}/request#
Confirm an Exchange
Confirm an exchange request, applying its changes on the associated order.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request examples
Responses
200 OK
returnobjectThe return's details.
returnobjectorder_previewobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
order_previewobjectexchangeobjectThe exchange's details.
exchangeobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.exchange_created: Emitted when an exchange is created for an order.reservation-item.created: Emitted when reservations are created.
DELETE /admin/exchanges/{id}/request#
Cancel Exchange Request
Cancel a requested exchange.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "exchange"
deletedboolean400, 401, 404, 409, 422, 500: an error response is returned.