Change order status
Move an order to another status
https://s.zo.sa/api/public/v1 /orders/{id}/status orders.read_writeIdempotency-Key supportedOnly the moves GET /order-statuses lists are allowed. Cancelling or returning puts stock back when the store's order settings say so. The Idempotency-Key header is optional. History records the change with actor api.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | required | At least 1 |
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | 1 to 120 visible ASCII characters. A write sent again with the same key runs once; the retry gets the first answer back with the header Idempotent-Replayed: true. Use a new key for each new write. 1 to 120 characters |
Request body
statusstringrequiredA status the order may move to from its current one (GET /order-statuses).notestringnullableKept in the order's history; sent to the shopper with the status message only when the store sends notes.
cURL
curl -sS -X POST "https://s.zo.sa/api/public/v1/orders/1042/status" \
-H "Authorization: Bearer $ZO_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: erp-status-SO1042-ready" \
-d '{
"status": "ready",
"note": "Packed at the main warehouse"
}'JavaScript
const response = await fetch('https://s.zo.sa/api/public/v1/orders/1042/status', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ZO_API_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json',
'Idempotency-Key': 'erp-status-SO1042-ready',
},
body: JSON.stringify({
"status": "ready",
"note": "Packed at the main warehouse"
}),
});
console.log(response.status, await response.json());PHP
<?php
$ch = curl_init('https://s.zo.sa/api/public/v1/orders/1042/status');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ZO_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
'Idempotency-Key: erp-status-SO1042-ready',
],
CURLOPT_POSTFIELDS => json_encode([
'status' => 'ready',
'note' => 'Packed at the main warehouse',
]),
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $body, PHP_EOL;Python
import os
import requests
response = requests.post(
"https://s.zo.sa/api/public/v1/orders/1042/status",
headers={
"Authorization": f"Bearer {os.environ['ZO_API_KEY']}",
"Accept": "application/json",
"Idempotency-Key": "erp-status-SO1042-ready",
},
json={
"status": "ready",
"note": "Packed at the main warehouse",
},
timeout=30,
)
print(response.status_code, response.json())The note is kept in the order's history, and reaches the shopper with the status message only when the store sends notes.
{
"data": {
"id": 1042,
"number": "1042",
"status": "ready",
"payment_status": "pending",
"payment_method": "cod",
"source": "storefront",
"currency": "SAR",
"totals": {
"subtotal": 5000,
"discount": 0,
"shipping": 2500,
"tax": 978,
"total": 7500
},
"customer": {
"id": 2187,
"name": "Sara Ahmed",
"mobile": "+966501234567",
"email": "sara@example.com"
},
"customer_note": null,
"shipping_address": {
"name": "Sara Ahmed",
"mobile": "+966501234567",
"country": "SA",
"city": "Riyadh",
"district": "Al Olaya",
"street": "King Fahd Road",
"building": "12",
"postal_code": "12211",
"details": null
},
"items": [
{
"id": 3301,
"product_id": 501,
"variant_id": 811,
"sku": "TSHIRT-BLUE-M",
"name": {
"ar": "...",
"en": "Blue T-shirt"
},
"quantity": 2,
"unit_price": 2500,
"total": 5000,
"options": null
}
],
"created_at": "2026-11-23T06:01:53Z",
"updated_at": "2026-11-23T09:05:00Z"
}
}Example.
Responses
Response schema
dataobjectrequiredAn order. shipping_address is present only with the customers.read scope (null for an order with nothing to ship) and so is customer_note; without that scope both keys are absent. Card codes, gift links, file paths and merchant notes are never shown.14 fields
idintegerrequirednumberstringrequiredThe order number the merchant and the shopper see.statusstringrequiredpayment_statusstringrequiredpayment_methodstringrequiredsourcestringrequirednullableWhere the order came from: storefront, manual (typed in the dashboard), api (created through this API), or a marketplace (trendyol, amazon).currencystringrequiredtotalsobjectrequiredHalalas. shipping includes the cash-on-delivery fee; tax is the VAT already included in total. total may also hold paid order options.5 fields
subtotalintegerrequireddiscountintegerrequiredshippingintegerrequiredtaxintegerrequiredtotalintegerrequired
customerobjectrequiredWho placed the order. Without the customers.read scope only id and name are present; with it, mobile and email are added.4 fields
idintegerrequirednullableThe customer record (GET /customers/{id}).namestringrequirednullablemobilestringnullablePresent only with customers.read. E.164 for Saudi numbers.emailstringnullablePresent only with customers.read.
customer_notestringnullableWhat the shopper wrote with the order. Present only with customers.read (free text that may hold contact details).shipping_addressobjectnullable9 fields
namestringrequirednullableThe recipient (the customer unless the address names someone else).mobilestringrequirednullablecountrystringrequiredISO 3166-1 alpha-2; SA unless the address says otherwise.citystringrequirednullableThe city's name as the shopper reads it.districtstringrequirednullablestreetstringrequirednullablebuildingstringrequirednullablepostal_codestringrequirednullabledetailsstringrequirednullableAddress details the shopper typed (landmark, floor and so on).
itemsarray of objectsrequired9 fields
idintegerrequiredproduct_idintegerrequirednullableNull when the line is not tied to a product.variant_idintegerrequirednullableskustringrequirednullablenameobjectrequired2 fields
arstringrequirednullableenstringrequirednullable
quantityintegerrequiredunit_priceintegerrequiredHalalas.totalintegerrequiredHalalas.optionsobjectrequirednullableThe chosen option values as one text (for example "Red / L"); null for a product without options.2 fields
arstringrequirednullableenstringrequirednullable
created_atstring (date-time)requiredWhen the order was placed.updated_atstring (date-time)required
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.