Get inventory
One variant's stock in each branch (pass sku or variant_id)
GET
https://s.zo.sa/api/public/v1 /inventory Scope
inventory.readRequest
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
sku | string | The variant's exact SKU. Either sku or variant_id is required; with both, the variant must match both. Up to 64 characters | |
variant_id | integer |
cURL
curl -sS "https://s.zo.sa/api/public/v1/inventory?sku=TSHIRT-BLUE-M" \
-H "Authorization: Bearer $ZO_API_KEY" \
-H "Accept: application/json"JavaScript
const response = await fetch('https://s.zo.sa/api/public/v1/inventory?sku=TSHIRT-BLUE-M', {
headers: {
Authorization: `Bearer ${process.env.ZO_API_KEY}`,
Accept: 'application/json',
},
});
console.log(response.status, await response.json());PHP
<?php
$ch = curl_init('https://s.zo.sa/api/public/v1/inventory?sku=TSHIRT-BLUE-M');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ZO_API_KEY'),
'Accept: application/json',
],
]);
$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.get(
"https://s.zo.sa/api/public/v1/inventory?sku=TSHIRT-BLUE-M",
headers={
"Authorization": f"Bearer {os.environ['ZO_API_KEY']}",
"Accept": "application/json",
},
timeout=30,
)
print(response.status_code, response.json()){
"data": [
{
"variant_id": 811,
"sku": "TSHIRT-BLUE-M",
"branch_id": 1,
"quantity": 30,
"updated_at": "2026-11-23T06:01:53Z"
},
{
"variant_id": 811,
"sku": "TSHIRT-BLUE-M",
"branch_id": 2,
"quantity": 7,
"updated_at": "2026-11-21T12:40:05Z"
}
]
}Example. One row per branch; together they are the variant's 37.
Responses
200One row per branch that holds a level for the variant; empty when no variant of this store matches.
Response schema
dataarray of objectsrequired5 fields
variant_idintegerrequiredskustringrequirednullablebranch_idintegerrequiredquantityintegerrequiredupdated_atstring (date-time)requirednullable
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"}}.
422A query parameter is invalid (code validation_failed, with fields).
An error object: {"error": {"code", "message", "fields"}}.
429Too many requests (code rate_limited); see Retry-After.
An error object: {"error": {"code", "message", "fields"}}.