Orders API Routes
An order is a purchase made by a customer through a storefront.
Orders can also originally be created as draft orders.
These API routes allow admin users to view and manage orders.
GET /admin/orders#
List Orders
Retrieve a list of orders. The orders can be filtered by fields such as id. The orders 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-.idstring | string[]Optionalstatusstring | string[]Optional$andobject[]Optional$orobject[]Optionalsales_channel_idstring[]Optionalregion_idstring | string[]OptionalqstringOptionalcreated_atobjectOptionalupdated_atobjectOptionalcustomer_idstring | string[]Optionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberordersobject[]The list of orders.
ordersobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/orders/export#
Export Orders
Start an order export process to retrieve a CSV of exported orders.
You'll receive in the response the transaction ID of the workflow generating the CSV file. To check the status of the execution, send a GET request to /admin/workflows-executions/export-orders/:transaction-id.
Once the execution finishes successfully, a notification is created for the export. You can retrieve the notifications using the /admin/notification API route to retrieve the file's download URL.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
idstring | string[]Optionalsales_channel_idstring[]Optionalregion_idstring | string[]Optionalcustomer_idstring | string[]OptionalqstringOptionalcreated_atobjectOptionalupdated_atobjectOptionallimitnumberOptionaloffsetnumberOptionalorderstringOptional-.with_deletedbooleanOptionalfieldsstringOptional+ 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.status"canceled" | "completed" | "pending" | "draft" | "archived" | "requires_action" | ("canceled")[] | ("completed")[] | ("pending")[] | ("draft")[] | ("archived")[] | ("requires_action")[] | objectOptionalThe status of the orders to export.
status"canceled" | "completed" | "pending" | "draft" | "archived" | "requires_action" | ("canceled")[] | ("completed")[] | ("pending")[] | ("draft")[] | ("archived")[] | ("requires_action")[] | objectOptional$andobject[]Optional$orobject[]OptionalRequest examples
Responses
202 OK
transaction_idstring/admin/workflows-executions/export-orders/:transaction-id400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/orders/{id}#
Get an Order
Retrieve an order by its ID. You can expand the order's relations or select the fields that should be returned.
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.versionnumberOptionalRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/orders/{id}#
Update Order
Update an order's details.
Updating the order's shipping or billing address doesn't recalculate the order's taxes or totals; the existing tax lines are preserved as-is. You also can't change the address's country_code.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
versionnumberOptionalfieldsstringOptional+ 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)
emailstringOptionalshipping_addressobjectOptionalThe address's details.
shipping_addressobjectOptionalbilling_addressobjectOptionalThe address's details.
billing_addressobjectOptionalmetadataobjectOptionallocalestringOptionalen-USRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.updated: Emitted when the details of an order or draft order is updated. This doesn't include updates made by an edit.
POST /admin/orders/{id}/archive#
Archive an Order
Change the status of an order to archived.
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.versionnumberOptionalRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.archived: Emitted when an order is archived.
POST /admin/orders/{id}/cancel#
Cancel Order
Cancel an order. The cancelation fails if:
-
The order has captured payments.
-
The order has refund payments.
-
The order has fulfillments that aren't canceled.
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.versionnumberOptionalRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.canceled: Emitted when an order is canceld.reservation-item.deleted: Emitted when reservations are deleted.
GET /admin/orders/{id}/changes#
List Changes on an Order
Retrieve a list of changes made on an order, including returns, exchanges, etc...
The changes can be filtered by fields like created_at. The changes can also be paginated.
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.created_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptionalidstring | string[] | objectOptionalFilter by an order change ID.
idstring | string[] | objectOptionalstatusstring | string[] | objectOptionalFilter by the order change's status.
statusstring | string[] | objectOptionalchange_typestring | string[] | objectOptionalFilter by the order change's type.
change_typestring | string[] | objectOptional$andobject[]Optional$orobject[]OptionalRequest examples
Responses
200 OK
order_changesobject[]An order's changes.
order_changesobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/orders/{id}/complete#
Complete Order
Mark an order as completed.
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.versionnumberOptionalRequest body (application/json)
additional_dataobjectOptionaladditional_data parameter.Request examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.completed: Emitted when orders are completed.
POST /admin/orders/{id}/credit-lines#
Create Credit Line for Order
Create a credit line for an 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.versionnumberOptionalRequest body (application/json)
amountnumber100referencestringorderreference_idstringorder_123metadataobjectOptionalRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/orders/{id}/fulfillments#
Create an Order Fulfillment
Create a fulfillment for an order. The creation fails if the order is canceled.
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.versionnumberOptionalRequest body (application/json)
itemsobject[]The items to fulfill.
itemsobject[]location_idstringno_notificationbooleanOptionaldelivery_addressobjectOptionalThe address to deliver the items to.
delivery_addressobjectOptionalmetadataobjectadditional_dataobjectOptionaladditional_data parameter.Request examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.fulfillment_created: Emitted when a fulfillment is created for an order.inventory-level.updated: Emitted when inventory levels are updated. This includes adjustments to the stocked or reserved quantity, such as during order fulfillment.reservation-item.updated: Emitted when reservations are updated.reservation-item.deleted: Emitted when reservations are deleted.
POST /admin/orders/{id}/fulfillments/{fulfillment_id}/cancel#
Cancel Fulfillment
Cancel an order's fulfillment. The fulfillment can't be canceled if it's shipped.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringfulfillment_idstringRequest body (application/json)
no_notificationbooleanOptionaladditional_dataobjectOptionaladditional_data parameter.Request examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.fulfillment_canceled: Emitted when an order's fulfillment is canceled.inventory-level.updated: Emitted when inventory levels are updated. This includes adjustments to the stocked or reserved quantity, such as during order fulfillment.reservation-item.created: Emitted when reservations are created.reservation-item.updated: Emitted when reservations are updated.
POST /admin/orders/{id}/fulfillments/{fulfillment_id}/mark-as-delivered#
Mark a Fulfillment as Delivered.
Mark an order's fulfillment as delivered.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringfulfillment_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.versionnumberOptionalRequest body (application/json)
no_notificationbooleanOptionalRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
delivery.created: Emitted when a fulfillment is marked as delivered.
POST /admin/orders/{id}/fulfillments/{fulfillment_id}/shipments#
Create Shipment for an Order's Fulfillment
Create a shipment for an order's fulfillment.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringfulfillment_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.versionnumberOptionalRequest body (application/json)
itemsobject[]The items to create shipment for.
itemsobject[]labelsobject[]OptionalThe labels to create for the shipment.
labelsobject[]Optionalno_notificationbooleanOptionalmetadataobjectadditional_dataobjectOptionaladditional_data parameter.Request examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
shipment.created: Emitted when a shipment is created for an order.
GET /admin/orders/{id}/line-items#
List Line Items
Retrieve a list of line items in a order. The line items can be filtered by fields like FILTER FIELDS. The line items can also be paginated.
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.idstring | string[]Optionalitem_idstring | string[]Optionalversionnumber | number[]OptionalRequest examples
Responses
200 OK
order_itemsobject[]The order's order items.
order_itemsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/orders/{id}/payment-sessions/authorize#
Authorize Payment Session
Authorize a payment session for an order. This is useful for orders created from draft orders.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
payment_session_idstringRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobjectis_authorizedboolean400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/orders/{id}/preview#
Get Preview
Retrieve a preview of an order using its associated change, such as an edit.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
orderobjectA preview of an order if a change, such as exchange, return, edit, or claim is applied on it.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/orders/{id}/shipping-options#
List Shipping Options for Order
Retrieve a list of shipping options that can be used for outbound shipping in an order. This is especially useful when adding outbound shipping to order exchanges or claims.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
shipping_optionsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/orders/{id}/transfer#
Request Order Transfer
Request an order to be transfered to another customer. The transfer is confirmed by sending a request to the Accept Order Transfer Store API route.
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.versionnumberOptionalRequest body (application/json)
customer_idstringdescriptionstringOptionalinternal_notestringOptionalupdate_order_emailbooleanOptionalDefault: false
Request examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.transfer_requested: Emitted when an order is requested to be transferred to another customer.
POST /admin/orders/{id}/transfer/cancel#
Cancel Transfer Request
Cancel a request to transfer an order to another customer.
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.versionnumberOptionalRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/orders/{id}/transfer/guest#
Transfer Order to Guest Customer
Transfer an order to a guest customer. This is useful when the order email was incorrectly entered and you want to set it to a guest customer. The order will be transferred to a new guest customer with the provided email. For transferring orders to registered customer, check out the Request Order Transfer API route instead.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
versionnumberOptionalfieldsstringOptional+ 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)
emailstringinternal_notestringOptionaldescriptionstringOptionalRequest examples
Responses
200 OK
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.