Update an order
Setting status to most values requires _policies.allow_status: true
in the request body.
Recommended pattern for retry-safe order creation
POST /v2/orders has no idempotency mechanism (see its description).
The recommended way to create an order safely under retry is
PUT /v2/orders/{id} with _upsert: true and an external_id
in the body:
- If no order exists yet with that
external_id(scoped to the seller resolved viashop_id), one is created (response status201) using the same request body fields asPOST /v2/orders(shop_id,contact,line_items, etc). The order gets a normal system-generatedcode— the URL:idis not used as, or turned into, the order’s code; a client cannot pick the public order code this way.:idcan be any placeholder (e.g. the sameexternal_idvalue, for readability), since matching is done byexternal_id, not by the URL. - If an order already exists with that
external_id, it’s updated in place (response status200) — a retried request converges on the same order instead of creating a duplicate. - Without
_upsert: true,PUTto a nonexistent:idreturns404as usual. _upsert: truewithout anexternal_idin the body returns422— the flag requiresexternal_idso a typo in the URL:idalone can’t silently create an unintended order.
This is the same external_id field documented on Order and on
POST /v2/orders — a collision there is rejected with 422;
here, under _upsert, a “collision” is the intended match and
updates the existing order instead.
Stock restoration on cancellation
Setting status to cancelled automatically restores/releases reserved
stock, but only when both of these hold:
- the order’s
fulfillment_statusis still unsent (queued,preparing, orready— not yetshipped/delivered), and - stock was actually reserved for the order in the first place (line
items on non-stock-tracked products, or without a
variant_idat all, never reserved anything, so there’s nothing to restore for them).
Cancelling an order that has already shipped does not auto-restore stock. Restoration is independent of payment state — it isn’t affected by whether the order was paid or refunded.
/orders/{id}AuthorizationBearer token (JWT) · headerrequiredidstringrequiredapplication/json_upsertbooleanstatusstringdraftcheckoutin_reviewpendingcancelledclosedcompletedfulfillment_statusstringnonequeuedpreparingreadyshippeddeliveredreturnedarchivedbooleanexternal_idstringtracking_codestringcourier_namestringfulfillment_methodstringshippingmailbox_pickuplocal_pickupnoneshipping_amountintegershipping_discountintegershipping_descriptionstringtagsstring[]notify_status_changebooleannotification_messagestring_policiesobjectShow propertiesHide properties
allow_statusbooleanappend_tagsboolean_linksHalLinksidintegershop_idintegercodestringexternal_idstring | nullstatusstringdraftcheckoutin_reviewpendingcancelledclosedcompletedfulfillment_statusstringnonequeuedpreparingreadyshippeddeliveredreturnedcheckout_urlstringarchivedbooleancurrency_codestringprices_include_taxbooleanitems_net_totalintegeritems_discount_totalintegeritems_totalintegernet_totalintegerdiscount_totalintegercart_totalintegersurcharge_totalintegershipping_totalintegershipping_discountintegershipping_minus_discountintegertax_ratenumbertax_totalintegertotalintegertotal_paidintegertotal_refundedintegermax_refundable_amountintegerpartial_payment_offeredbooleanpaying_partiallybooleanpartial_payment_percentageintegerpartial_payment_amountnumberpartial_payment_due_onstring<date>shipping_descriptionstringtracking_codestringcourier_namestringpayment_infoobjectShow propertiesHide properties
idintegernamestringtypestringdataobjectrequested_document_typestringtagsstring[]tag_idsinteger[]allowed_statusesstring[]allowed_fulfillment_statusesstring[]created_onstring<date-time>updated_onstring<date-time>checkout_onstring<date-time> | nullpending_onstring<date-time> | nullclosed_onstring<date-time> | nullshipped_onstring<date-time> | null_embeddedobjectShow propertiesHide properties
contactobjectShow propertiesHide properties
idintegernamestringemailstringphone_numberstringcompanyobjectShow propertiesHide properties
idintegernamestringid_numberstringactivity_codestringaddressAddressShow propertiesHide properties
streetstringstreet_2stringlocality_namestringregion_namestringcountry_namestringpostal_codestringaddressAddressShow propertiesHide properties
streetstringstreet_2stringlocality_namestringregion_namestringcountry_namestringpostal_codestringbilling_addressAddressShow propertiesHide properties
streetstringstreet_2stringlocality_namestringregion_namestringcountry_namestringpostal_codestringline_itemsobject[]Show propertiesHide properties
objectidintegerproduct_idintegerproduct_namestringvariant_idintegervariant_namestringvariant_skustringunitsintegerunit_priceintegernet_totalintegertotalintegerpaymentsOrderTransaction[]Show propertiesHide properties
OrderTransactionidintegerorder_idintegeramountintegerabsolute_amountintegersuccessfulbooleancard_token_idintegerpayment_method_typestringtransaction_idstringauthorization_codestringdescriptionstringcreated_atstring<date-time>refundsOrderTransaction[]Show propertiesHide properties
OrderTransactionidintegerorder_idintegeramountintegerabsolute_amountintegersuccessfulbooleancard_token_idintegerpayment_method_typestringtransaction_idstringauthorization_codestringdescriptionstringcreated_atstring<date-time>documentsOrderDocument[]Show propertiesHide properties
OrderDocumentidintegerdocument_typestringinvoicereceiptdocument_numberstringfile_urlstringcurl -X PUT "https://api.onbolder.com/v2/orders/string" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tracking_code": "1Z9999W99999999999",
"courier_name": "UPS",
"fulfillment_status": "shipped"
}'const response = await fetch("https://api.onbolder.com/v2/orders/string", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"tracking_code": "1Z9999W99999999999",
"courier_name": "UPS",
"fulfillment_status": "shipped"
})
});import requests
response = requests.put(
"https://api.onbolder.com/v2/orders/string",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"tracking_code": "1Z9999W99999999999",
"courier_name": "UPS",
"fulfillment_status": "shipped"
},
){
"id": 5001,
"code": "ORD-5001",
"status": "pending",
"fulfillment_status": "shipped",
"tracking_code": "1Z9999W99999999999",
"courier_name": "UPS",
"_links": {
"self": {
"href": "https://api.onbolder.com/v2/orders/ORD-5001"
}
}
}