Draft Orders API Routes
A draft order is an order created by the admin user. This is useful for orders created offline or from clients other than a storefront, such as a third-party integration.
These API routes allow admin users to create and manage draft orders.
GET /admin/draft-orders#
List Draft Orders
Retrieve a list of draft orders. The draft orders can be filtered by fields such as id. The draft 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[] | objectOptional$andobject[]Optional$orobject[]Optionalsales_channel_idstring[]Optionalregion_idstring | string[]OptionalqstringOptionalcreated_atobjectOptionalupdated_atobjectOptionalcustomer_idstring | string[]Optionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberdraft_ordersobject[]The list of draft orders.
draft_ordersobject[]estimate_countnumberOptional400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders#
Create Draft Order
Create a draft order. This creates an order with the is_draft_order property enabled. You can later convert the draft order to an order.
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)
status"completed"Optionalsales_channel_idstringemailstringcustomer_idstringbilling_addressstring | objectOptionalThe draft order's billing address.
billing_addressstring | objectOptionalshipping_addressstring | objectOptionalThe draft order's shipping address.
shipping_addressstring | objectOptionalitemsobject[]OptionalThe draft order's items.
itemsobject[]Optionalregion_idstringpromo_codesstring[]Optionalcurrency_codestringno_notification_orderbooleanOptionalshipping_methodsobject[]The draft order's shipping methods.
shipping_methodsobject[]metadataobjectadditional_dataobjectOptionaladditional_data parameter.Request examples
Responses
200 OK
draft_orderobjectThe draft order's details.
draft_orderobject400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/draft-orders/{id}#
Get a Draft Order
Retrieve a draft order by its ID. You can expand the draft order's relations or select the fields that should be returned using the 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
draft_orderobjectThe draft order's details.
draft_orderobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}#
Update a Draft Order
Update a draft order's details. This doesn't include updating the draft order's items, shipping methods, or promotions. To update those, you need to create an edit that you can later request or confirm.
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)
emailstringOptionalshipping_addressobjectOptionalThe address's details.
shipping_addressobjectOptionalbilling_addressobjectOptionalThe address's details.
billing_addressobjectOptionalmetadataobjectOptionalcustomer_idstringOptionalsales_channel_idstringOptionallocalestringOptionalRequest examples
Responses
200 OK
draft_orderobjectThe draft order's details.
draft_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.
DELETE /admin/draft-orders/{id}#
Delete a Draft Order
Delete a draft order.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/convert-to-order#
Convert a Draft Order to an Order
Convert a draft order to an order. This will finalize the draft order and create a new order with the same details.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
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
orderobjectThe order's details.
orderobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
order.placed: Emitted when an order is placed, or when a draft order is converted to an order.reservation-item.created: Emitted when reservations are created.
POST /admin/draft-orders/{id}/edit#
Create a Draft Order Edit
Create an edit on a draft order. This will allow you to make changes to the draft order's items, shipping methods, or promotions. Once you've made the necessar changes, you can later either request the edit (which requires a confirmation from the customer), or force-confirm the edit.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/draft-orders/{id}/edit#
Cancel Edit on Draft Order
Cancel an unconfirmed edit on a draft order.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/confirm#
Confirm an Edit on a Draft Order
Confirm an edit on a draft order. This will apply the changes made to the draft order.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/items#
Add Item to Draft Order Edit
Add an item to a draft order edit.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
itemsobject[]OptionalThe items to add to the draft order.
itemsobject[]OptionalRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/items/item/{item_id}#
Update Existing Item in Draft Order Edit
Update an existing item in a draft order edit.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringitem_idstringRequest body (application/json)
quantitynumberunit_pricenumberOptionalcompare_at_unit_pricenumberOptionalinternal_notestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/items/{action_id}#
Update New Item in Draft Order Edit
Update a new item that was added to a draft order edit by 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.Request body (application/json)
quantitynumberunit_pricenumberOptionalcompare_at_unit_pricenumberOptionalinternal_notestringOptionalRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/draft-orders/{id}/edit/items/{action_id}#
Remove Item from Draft Order Edit
Remove an order item from a draft order edit by the ID of the item's ITEM_ADD or ITEM_UPDATE 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 or ITEM_UPDATE action.Request examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/promotions#
Add Promotions to Draft Order Edit
Add promotions to a draft order edit.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
promo_codesstring[]Request examples
Responses
200 OK
draft_order_previewobjectThe draft order preview's details.
draft_order_previewobject400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/draft-orders/{id}/edit/promotions#
Remove Promotions from Draft Order Edit
Remove specified promotions from a draft order edit.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest body (application/json)
promo_codesstring[]Request examples
Responses
200 OK
draft_order_previewobjectThe draft order preview's details.
draft_order_previewobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/request#
Request Edit on Draft Order
Change the status of a draft order's edit to be requested. Later, the edit can be confirmed or canceled.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/shipping-methods#
Add Shipping Method to Draft Order Edit
Add a shipping method to a draft order edit.
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
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}#
Update Existing Shipping Method in Draft Order Edit
Update an existing shipping method in a draft order edit.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringmethod_idstringRequest body (application/json)
shipping_option_idstringOptionalcustom_amountnumberOptionalinternal_notestringOptionalRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}#
Remove Shipping Method from Draft Order Edit
Remove an existing shipping method from a draft order edit.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringmethod_idstringRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/draft-orders/{id}/edit/shipping-methods/{action_id}#
Update New Shipping Method in Draft Order Edit
Update a new shipping method that was added to a draft order edit 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.Request body (application/json)
shipping_option_idstringcustom_amountnumberOptionaldescriptionstringOptionalinternal_notestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/draft-orders/{id}/edit/shipping-methods/{action_id}#
Remove New Shipping Method from Draft Order
Remove a shipping method that was added to a draft order edit 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.Request examples
Responses
200 OK
400, 401, 404, 409, 422, 500: an error response is returned.