Create product
Create a product
https://s.zo.sa/api/public/v1 /products products.read_writeIdempotency-Key supportedRequest
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
A product to create (POST, where name and variants are required) or to change (PATCH: only the keys sent change; name and description merge per language, so name.ar may be left out). Keys not listed here are ignored. On PATCH, options, variants and images each replace the whole set when sent (images when the background copy finishes: when at least one link copies, the pictures become the copies in the order sent; when none copies they stay as they were; an empty list removes them at once): an option or value sent with the same Arabic name as a saved one keeps it, and a variant whose values are all kept keeps its stock and id. Send options with variants when the product has options. Stock is never set here: a quantity key anywhere is refused with 422; use POST /inventory/adjustments. Prices are in halalas. A product without options has exactly one variant, whose price is the product's price. Dropping an option value on PATCH deletes the variants made with it, and their stock. A product with options cannot be turned back into one without options through the API in this version.
nameobjectrequired2 fields
arstringrequiredenstringnullable
descriptionobjectnullableHTML is cleaned to the storefront's safe subset.2 fields
arstringnullableenstringnullable
typestringTypes other than physical need the plan feature all_product_types (402 feature_locked without it).statusstringDefault draft. An active product that ships needs weight_grams.slugstringnullableLetters of any language, digits and single dashes. Made unique in the store.category_idsarray of integersbrand_idintegernullableweight_gramsintegernullableThe product's weight; every variant ships at it.track_stockbooleanDefault true. False makes every variant unlimited.imagesarray of objects1 field
urlstring (uri)required
optionsarray of objects2 fields
nameobjectrequired2 fields
arstringrequiredenstringnullable
valuesarray of objectsrequired2 fields
keystringrequiredYour own label for the value, unique in the body; variants refer to it.nameobjectrequired2 fields
arstringrequiredenstringnullable
variantsarray of objectsrequiredOne per combination of option values (at most 100): each variant's values hold exactly one key of every option, and no two variants hold the same combination (422 on variants.N.values otherwise). A combination left out is created at the product's price; on PATCH a saved one left out keeps its details.8 fields
valuesarray of stringsThe keys of this variant's option values, one per option. Required when options are sent.skustringnullableUnique in the store.barcodestringnullablepriceintegerrequiredsale_priceintegernullableBelow price.weight_gramsintegernullableThe product's weight_grams, given per variant: every variant must send the same value.track_stockbooleanThe product's track_stock, given per variant: every variant must send the same value.hiddenboolean
sale_starts_atstring (date-time)nullableA bare date is that whole day in Riyadh.sale_ends_atstring (date-time)nullable
cURL
curl -sS -X POST "https://s.zo.sa/api/public/v1/products" \
-H "Authorization: Bearer $ZO_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: erp-item-TSHIRT-BLUE-M" \
-d '{
"name": {
"ar": "Blue T-shirt",
"en": "Blue T-shirt"
},
"status": "active",
"weight_grams": 250,
"variants": [
{
"sku": "TSHIRT-BLUE-M",
"price": 2500
}
]
}'JavaScript
const response = await fetch('https://s.zo.sa/api/public/v1/products', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ZO_API_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json',
'Idempotency-Key': 'erp-item-TSHIRT-BLUE-M',
},
body: JSON.stringify({
"name": {
"ar": "Blue T-shirt",
"en": "Blue T-shirt"
},
"status": "active",
"weight_grams": 250,
"variants": [
{
"sku": "TSHIRT-BLUE-M",
"price": 2500
}
]
}),
});
console.log(response.status, await response.json());PHP
<?php
$ch = curl_init('https://s.zo.sa/api/public/v1/products');
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-item-TSHIRT-BLUE-M',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => [
'ar' => 'Blue T-shirt',
'en' => 'Blue T-shirt',
],
'status' => 'active',
'weight_grams' => 250,
'variants' => [
[
'sku' => 'TSHIRT-BLUE-M',
'price' => 2500,
],
],
]),
]);
$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/products",
headers={
"Authorization": f"Bearer {os.environ['ZO_API_KEY']}",
"Accept": "application/json",
"Idempotency-Key": "erp-item-TSHIRT-BLUE-M",
},
json={
"name": {
"ar": "Blue T-shirt",
"en": "Blue T-shirt",
},
"status": "active",
"weight_grams": 250,
"variants": [
{
"sku": "TSHIRT-BLUE-M",
"price": 2500,
},
],
},
timeout=30,
)
print(response.status_code, response.json())A product without options has one variant: its SKU and its price in halalas (2500 is 25.00 SAR). name.ar holds the Arabic name; the example puts the English name in both because these docs are English only.
{
"data": {
"id": 501,
"type": "physical",
"status": "active",
"name": {
"ar": "Blue T-shirt",
"en": "Blue T-shirt"
},
"description": {
"ar": null,
"en": null
},
"slug": "blue-t-shirt",
"url": "https://s.zo.sa/my-store/p/blue-t-shirt",
"images": [],
"images_pending": [],
"categories": [],
"brand": null,
"variants": [
{
"id": 811,
"sku": "TSHIRT-BLUE-M",
"barcode": null,
"price": 2500,
"sale_price": null,
"quantity": 0,
"unlimited": false,
"hidden": false,
"weight_grams": 250,
"options": []
}
],
"sale_starts_at": null,
"sale_ends_at": null,
"created_at": "2026-11-23T08:10:00Z",
"updated_at": "2026-11-23T08:10:00Z"
}
}Example. A new product has no stock yet: move it in with POST /inventory/adjustments.
Responses
Response schema
dataobjectrequiredA product has at least one variant (a product without options has exactly one), and prices live on its variants.16 fields
idintegerrequiredtypestringrequiredstatusstringrequirednameobjectrequired2 fields
arstringrequirednullableenstringrequirednullable
descriptionobjectrequired2 fields
arstringrequirednullableenstringrequirednullable
slugstringrequiredurlstring (uri)requiredThe product page on the storefront.imagesarray of objectsrequired4 fields
idintegerrequiredurlstring (uri)requiredaltstringrequirednullableReserved; null until images carry alt text.sortintegerrequired
images_pendingarray of objectsrequiredPicture links sent in a write that are copied in the background, usually within seconds. A link stays here with status pending until its copy joins images (and product.updated is sent), or with status failed when it could not be copied; failed links stay until the next picture write. Empty when nothing waits.3 fields
source_urlstring (uri)requiredThe link as it was sent.statusstringrequirederrorstringrequirednullableWhy a failed link was not copied; null while pending. too_many_images when the product already had 10 pictures by the time the copy finished; copy_failed when the copy job itself stopped, or ran out of time before this link (a job downloads for 60 seconds at most, 10 per link), so send it again in a new write.
categoriesarray of objectsrequired3 fields
idintegerrequirednameobjectrequired2 fields
arstringrequirednullableenstringrequirednullable
slugstringrequired
brandobjectrequirednullable3 fields
idintegerrequirednameobjectrequired2 fields
arstringrequirednullableenstringrequirednullable
slugstringrequirednullableReserved; null until brands carry slugs.
variantsarray of objectsrequired10 fields
idintegerrequiredskustringrequirednullablebarcodestringrequirednullablepriceintegerrequiredHalalas.sale_priceintegerrequirednullableHalalas. Applies only between the product's sale_starts_at and sale_ends_at (a null end is open, so both null means always); outside that window the variant sells at price.quantityintegerrequiredStock across all branches.unlimitedbooleanrequiredTrue when stock is not tracked; quantity is then no limit.hiddenbooleanrequiredHidden from shoppers by the merchant; still part of the catalogue.weight_gramsintegerrequirednullableoptionsarray of objectsrequired2 fields
nameobjectrequired2 fields
arstringrequirednullableenstringrequirednullable
valueobjectrequired2 fields
arstringrequirednullableenstringrequirednullable
sale_starts_atstring (date-time)requirednullableWhen the variants' sale_price starts to apply; null means from any time.sale_ends_atstring (date-time)requirednullableWhen the variants' sale_price stops applying; null means no end.created_atstring (date-time)requiredupdated_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"}}.