Orders
Update an order
Changes the customer, the shipping address, the note, the lines, the amounts or the metadata. Send only what changes; change region and city together.
Order already with a courier. The change is sent to the courier first, exactly as saving the order in the dashboard does, and saved only if the courier accepts it: a refusal is courier_rejected and nothing changes. Each courier accepts only some details on a parcel it has (DHD and the Ecotrack family: all of them; Yalidine: all but the note; ZR Express: not the second phone), and only until the parcel is validated or picked up; outside that, invalid_state_transition says why. Email and metadata never reach the courier and can always change; scheduled_for and courier need the shipment cancelled first.
Path parameters
- order_idstringRequired
starts with ord_
Body
- customerobject
4 child fields
- namestring
1–160 characters
- phonestring
6–20 characters
- phone_2string or null
up to 20 characters
- emailstring or null
email · up to 160 characters
- shipping_addressobject
4 child fields
- countrystring
- regionstring
A region code
1–60 characters
- citystring
1–160 characters
- address1string
1–500 characters
- notestring or null
up to 1000 characters
- metadataobject
Up to 20 string key/value pairs of your own. Returned as sent, never shown to shoppers.
up to 20 keys
- line_itemsarray
The order's new lines, replacing the old ones (the order card's Edit items). Stock follows: units come back for removed lines, and more units must be available (or coming, for a pre-order) for added ones. The total is recalculated unless you send total.
up to 100 items · at least 1 item
5 child fields
- variant_idstring
starts with var_
- titlestring
A custom line's name
1–240 characters
- variant_titlestring
up to 240 characters
- quantityintegerRequired
1–999
- unit_pricestring
Set the price by hand, as the dashboard's Create order allows. Leave it out to use the variant's price. Required on a custom line.
- shipping_feestring
An amount as a decimal string in the store's currency, with no more decimals than the currency has ("3500.00" in DZD, "12.500" in TND).
- totalstring
What the courier collects, set by hand. For a cash collection, its amount.
- scheduled_forstring
Schedule the order for this moment (up to a year ahead); its status becomes scheduled, like the order card's Schedule.
ISO 8601 date-time, UTC
- courierobject
Change the courier this order will go to, like the order card's courier picker. Its delivery fee can change with it.
2 child fields
- courier_idstringRequired
starts with cour_
- shipping_feestring
An amount as a decimal string in the store's currency, with no more decimals than the currency has ("3500.00" in DZD, "12.500" in TND).
Returns
200 OK · The updated order. Order
- idstringRequired
starts with ord_
- objectstringRequired
always "order"
- numberstring or nullRequired
The number the merchant uses, e.g. "ORD-00042".
- statusstringRequired
pending→confirmed→ (with a courier)shipped→deliveredorreturned.scheduled,attempt_1…attempt_3,double,waitingandcancelledare set by the merchant's team;preparing,shipped,delivered,returnedanddeletedcome from the courier. New values may be added — treat an unknown one likepending.One of
pending,confirmed,scheduled,attempt_1,attempt_2,attempt_3,double,waiting,cancelled,preparing,shipped,delivered,returned,deleted - sourcestring
Where the order came from: storefront, dashboard, api or import.
- source_namestring or null
The integration that created it, as it named itself in source_name.
- external_idstring or null
The id the integration gave this order.
- needs_reviewstring or null
Why the merchant must check this order before it can go to a courier. city_unmatched — the city was not recognised. null when nothing needs checking.
- preorderboolean
Marked as a pre-order (the goods are on their way to the merchant).
- assigned_toobject or null
The teammate working this order.
2 child fields
- idstring
- namestring
- typestring
See OrderCreate.type. New values may be added.
One of
delivery,exchange,pickup,cash_collection - exchange_ofstring or null
The delivered order this exchange replaces goods from.
- collectobject or null
What the courier takes back, for an exchange or a pickup.
3 child fields
- stagestring or null
Where the collected goods are (pending until they come back).
- summarystring or null
The line the courier prints for the goods to collect.
- linesarray of objects
8 child fields
- original_line_item_idstring or null
- product_idstring or null
- variant_idstring or null
- titlestring
- variant_titlestring or null
- quantityinteger
- restockedinteger
Units put back into stock when they came back.
- written_offinteger
- metadataobject
Your own key/value pairs, returned as you sent them.
- customerobjectRequired
5 child fields
- idstring or null
- namestring
- phonestring or null
E.164.
- phone_2string or null
- emailstring or null
- shipping_addressAddressRequired
4 child fields
- countrystring
- regionobject
2 child fields
- codestring
- namestring
- cityobject
2 child fields
- codestring or null
- namestring
- address1string or null
- deliveryobject
7 child fields
- modestring or null
One of
home,pickup_point - labelstring or null
- courierobject or null
1 child field
- namestring
- pickup_pointobject or null
2 child fields
- idstring
- namestring or null
- tracking_codestring or null
- tracking_urlstring or null
The customer's tracking page for this order, on the store's address (https://<store>.myordexs.com/track/<code>). Send it to the customer: it shows every step of the delivery, in the store's language. Each order has its own private link, and it stays the same if the parcel is sent again. It stops working 3 days after the order is delivered or returned (the page then says the link has expired); a cancelled order has no tracking page. null in test mode.
uri
- shipped_atstring or null
ISO 8601 date-time, UTC
- line_itemsarray of objectsRequired
10 child fields
- idstring
- product_idstring or null
- variant_idstring or null
- titlestring
- variant_titlestring or null
- skustring or null
- quantityinteger
- unit_priceMoney
An amount of money.
amountis a decimal STRING with exactly the currency's number of decimals ("1250.00" in DZD, "12.500" in TND) — never parse it into a float.2 child fields
- amountstringRequired
- currencystringRequired
- totalMoney
An amount of money.
amountis a decimal STRING with exactly the currency's number of decimals ("1250.00" in DZD, "12.500" in TND) — never parse it into a float.2 child fields
- amountstringRequired
- currencystringRequired
- image_urlstring or null
- discount_codestring or null
The code the shopper used; null when none
- discount_namestring or null
The name of the discount applied
- offersarray of strings
Names of the offers applied.
- offer_idsarray of strings
The offers applied
- subtotalMoneyRequired
An amount of money.
amountis a decimal STRING with exactly the currency's number of decimals ("1250.00" in DZD, "12.500" in TND) — never parse it into a float.2 child fields
- amountstringRequired
- currencystringRequired
- shippingMoneyRequired
An amount of money.
amountis a decimal STRING with exactly the currency's number of decimals ("1250.00" in DZD, "12.500" in TND) — never parse it into a float.2 child fields
- amountstringRequired
- currencystringRequired
- discountMoney
An amount of money.
amountis a decimal STRING with exactly the currency's number of decimals ("1250.00" in DZD, "12.500" in TND) — never parse it into a float.2 child fields
- amountstringRequired
- currencystringRequired
- totalMoneyRequired
An amount of money.
amountis a decimal STRING with exactly the currency's number of decimals ("1250.00" in DZD, "12.500" in TND) — never parse it into a float.2 child fields
- amountstringRequired
- currencystringRequired
- paymentobjectRequired
6 child fields
- methodstring
"cod" (cash on delivery), "card" (paid in full online by card) or "card_deposit" (a deposit paid online by card, the rest in cash on delivery). More methods may be added.
- statusstring
unpaid: nothing received yet. pending: the shopper chose card and has not finished paying. partially_paid: a card deposit was received, the rest is collected on delivery. paid: fully paid (online, or the cash was recorded).
One of
unpaid,pending,partially_paid,paid - paid_atstring or null
ISO 8601 date-time, UTC
- amount_paidMoney
What the shopper already paid online toward the order.
2 child fields
- amountstringRequired
- currencystringRequired
- amount_to_collectMoney
What the courier collects in cash at delivery: total minus amount_paid.
2 child fields
- amountstringRequired
- currencystringRequired
- card_discountMoney
The store’s discount for paying by card, already included in discount and taken off total. Zero for cash on delivery.
2 child fields
- amountstringRequired
- currencystringRequired
- notestring or null
The customer's note at checkout.
- archivedboolean
- scheduled_forstring or null
ISO 8601 date-time, UTC
- livemodebooleanRequired
- created_atstringRequired
ISO 8601 date-time, UTC
- updated_atstringRequired
ISO 8601 date-time, UTC
Errors
Every error has the same shape. This endpoint can answer with:
- 401
authentication_required - 401
invalid_api_key - 402
plan_required - 403
insufficient_scope - 429
rate_limited - 400
invalid_request - 400
invalid_json - 400
unknown_field - 422
validation_failed - 409
idempotency_in_progress - 422
idempotency_key_reused - 404
not_found - 409
invalid_state_transition - 422
region_unknown - 422
country_not_served - 422
out_of_stock - 422
courier_rejected - 503
upstream_unavailable
