Create an order
Creates an order. There is no Idempotency-Key-header-style replay
mechanism — a retried request always executes again server-side, it
never returns a cached copy of the original response. If a create
request times out or the response is otherwise lost, pass an
external_id and check GET /v2/orders?external_id={value} before
retrying: the first successful create claims that external_id, and a
second create attempt with the same value is rejected with a 422
instead of producing a duplicate order. (The id/code field does
not give you this protection via POST — see below.)
Alternatively, PUT /v2/orders/{id} with _upsert: true and an
external_id in the body finds-or-creates by external_id directly
— it creates the order (with a system-generated code, not the URL
:id) if no order with that external_id exists yet, or updates it
in place if one does, so a retried request converges instead of
duplicating. See that operation’s description for details.
/ordersAuthorizationBearer token (JWT) · headerrequiredapplication/jsonshop_idintegerrequiredidstringexternal_idstringsourcestringcontactobjectShow propertiesHide properties
idstringnamestringemailstringphone_numberstringaddressAddressShow propertiesHide properties
streetstringstreet_2stringlocality_namestringregion_namestringcountry_namestringpostal_codestringline_itemsobject[]Show propertiesHide properties
objectvariant_idstringunitsintegerpriceintegervariant_skustringtagsstring[]courier_namestringtracking_codestringfulfillment_methodstringshippingmailbox_pickuplocal_pickupnone_policiesobjectShow propertiesHide properties
allow_no_stockbooleanallow_statusbooleanforce_item_pricesbooleanallow_promotionsboolean_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 POST "https://api.onbolder.com/v2/orders" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"shop_id": 1,
"contact": {
"name": "Jane Doe",
"email": "customer@example.com"
},
"line_items": [
{
"variant_id": "101",
"units": 2
},
{
"variant_id": "205",
"units": 1
}
]
}'const response = await fetch("https://api.onbolder.com/v2/orders", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"shop_id": 1,
"contact": {
"name": "Jane Doe",
"email": "customer@example.com"
},
"line_items": [
{
"variant_id": "101",
"units": 2
},
{
"variant_id": "205",
"units": 1
}
]
})
});import requests
response = requests.post(
"https://api.onbolder.com/v2/orders",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"shop_id": 1,
"contact": {
"name": "Jane Doe",
"email": "customer@example.com"
},
"line_items": [
{
"variant_id": "101",
"units": 2
},
{
"variant_id": "205",
"units": 1
}
]
},
){
"id": 5002,
"shop_id": 1,
"code": "ORD-5002",
"status": "checkout",
"currency_code": "USD",
"total": 17997,
"created_on": "2024-06-20T14:30:00Z",
"_links": {
"self": {
"href": "https://api.onbolder.com/v2/orders/ORD-5002"
},
"orders:update": {
"href": "https://api.onbolder.com/v2/orders/ORD-5002",
"method": "put"
}
}
}