Sifr Wahid Developers

API reference / Orders

Change order status

Move an order to another status

POST https://s.zo.sa/api/public/v1/orders/{id}/status
Scope orders.read_writeIdempotency-Key supported

Only 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

NameTypeRequiredDescription
idintegerrequiredAt least 1

Headers

NameTypeRequiredDescription
Idempotency-Keystring1 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

application/json required

  • statusstringrequired
    A status the order may move to from its current one (GET /order-statuses).
    One of awaiting_payment, under_review, in_progress, ready, shipping, delivered, completed, cancelled, return_in_progress, returned
  • notestringnullable
    Kept in the order's history; sent to the shopper with the status message only when the store sends notes.
    Up to 300 characters

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.

Response 200
{
  "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

200The order after the change.
Response schema
  • dataobjectrequired
    An 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
    • idintegerrequired
    • numberstringrequired
      The order number the merchant and the shopper see.
    • statusstringrequired
      One of awaiting_payment, under_review, in_progress, ready, shipping, delivered, completed, cancelled, return_in_progress, returned
    • payment_statusstringrequired
      One of pending, paid, refund_due, refunded
    • payment_methodstringrequired
      One of cod, bank_transfer, online, manual
    • sourcestringrequirednullable
      Where the order came from: storefront, manual (typed in the dashboard), api (created through this API), or a marketplace (trendyol, amazon).
    • currencystringrequired
      Examples SAR
    • totalsobjectrequired
      Halalas. shipping includes the cash-on-delivery fee; tax is the VAT already included in total. total may also hold paid order options.
      5 fields
      • subtotalintegerrequired
      • discountintegerrequired
      • shippingintegerrequired
      • taxintegerrequired
      • totalintegerrequired
    • customerobjectrequired
      Who placed the order. Without the customers.read scope only id and name are present; with it, mobile and email are added.
      4 fields
      • idintegerrequirednullable
        The customer record (GET /customers/{id}).
      • namestringrequirednullable
      • mobilestringnullable
        Present only with customers.read. E.164 for Saudi numbers.
      • emailstringnullable
        Present only with customers.read.
    • customer_notestringnullable
      What the shopper wrote with the order. Present only with customers.read (free text that may hold contact details).
    • shipping_addressobjectnullable
      9 fields
      • namestringrequirednullable
        The recipient (the customer unless the address names someone else).
      • mobilestringrequirednullable
      • countrystringrequired
        ISO 3166-1 alpha-2; SA unless the address says otherwise.
      • citystringrequirednullable
        The city's name as the shopper reads it.
      • districtstringrequirednullable
      • streetstringrequirednullable
      • buildingstringrequirednullable
      • postal_codestringrequirednullable
      • detailsstringrequirednullable
        Address details the shopper typed (landmark, floor and so on).
    • itemsarray of objectsrequired
      9 fields
      • idintegerrequired
      • product_idintegerrequirednullable
        Null when the line is not tied to a product.
      • variant_idintegerrequirednullable
      • skustringrequirednullable
      • nameobjectrequired
        2 fields
        • arstringrequirednullable
        • enstringrequirednullable
      • quantityintegerrequired
      • unit_priceintegerrequired
        Halalas.
      • totalintegerrequired
        Halalas.
      • optionsobjectrequirednullable
        The chosen option values as one text (for example "Red / L"); null for a product without options.
        2 fields
        • arstringrequirednullable
        • enstringrequirednullable
    • created_atstring (date-time)required
      When the order was placed.
    • updated_atstring (date-time)required
401Missing, unknown, revoked or expired key.

An error object: {"error": {"code", "message", "fields"}}.

402The store's plan does not include this feature (error code feature_locked, with the feature and the plan that has it). Every operation answers it with feature public_api when the key's store is not on the Pro plan.

An error object: {"error": {"code", "message", "fields"}}.

403The key lacks the scope (code insufficient_scope, naming it in scope), the caller's address is not allowed (ip_not_allowed), or the store is suspended (store_suspended: reads stay allowed, every write answers this).

An error object: {"error": {"code", "message", "fields"}}.

404No such row in this store (code not_found).

An error object: {"error": {"code", "message", "fields"}}.

409channel_order_cancel_remote (a marketplace order is cancelled on the marketplace), or duplicate_request (the same Idempotency-Key is still running).

An error object: {"error": {"code", "message", "fields"}}.

422invalid_transition (the order cannot move from its status to this one; from and to name both), or validation_failed.

An error object: {"error": {"code", "message", "fields"}}.

429Too many requests (code rate_limited); see Retry-After.

An error object: {"error": {"code", "message", "fields"}}.