Sifr Wahid Developers

API reference

API reference

All 61 operations, grouped as in the OpenAPI file. Each has its own page with the scope it needs, every parameter and field, the responses and code samples in cURL, JavaScript, PHP and Python.

Base URL and authentication

  • Every path is relative to https://s.zo.sa/api/public/v1.
  • Send the key as a bearer token: Authorization: Bearer zo_live_…. See Authentication and scopes.
  • Each operation names the scope it needs; a key with {resource}.read_write also holds {resource}.read.

Conventions

  • Money is an integer in halalas (1 SAR = 100 halalas).
  • Dates are ISO 8601 in UTC.
  • Translated text is an object {ar, en} whose members may be null.
  • Errors are {error: {code, message, fields?}}. See Errors.
  • Lists are sync lists ordered by (updated_at, id) and read page by page with meta.next_cursor. See Lists and pagination.

Resources

Store

ResourceWhat it coversOperationsScopes
StoreThe store the key belongs to.1store.read

Catalog

ResourceWhat it coversOperationsScopes
ProductsProducts and their variants, read and written by id or by SKU, and product images.9products.read products.read_write
CategoriesThe store's product categories.5products.read products.read_write
BrandsThe store's brands.3products.read products.read_write
InventoryStock levels, stock movements, stock adjustments and the store's branches.4inventory.read inventory.read_write

Orders

ResourceWhat it coversOperationsScopes
OrdersOrders, their status history and status changes, and the store's order statuses.6orders.read orders.read_write
PaymentsPayments recorded on an order and the store's payment methods.2payments.read
ShipmentsShipments: create one for an order, list them, get a label, cancel.6shipments.read shipments.read_write

Customers and marketing

ResourceWhat it coversOperationsScopes
CustomersThe store's customers.4customers.read customers.read_write
Abandoned cartsCarts customers left without placing an order.1carts.read
CouponsDiscount coupons.5marketing.read marketing.read_write
ReviewsCustomer reviews and the store's replies.4reviews.read reviews.read_write

Webhooks

ResourceWhat it coversOperationsScopes
WebhooksWebhook subscriptions, the events you can subscribe to, test sends, secret rotation and delivery logs.11webhooks.read webhooks.read_write

About the examples

The OpenAPI file has no example bodies. Every write's request body and the answers of the main reads (orders, products, stock, customers, webhooks) are written for these docs and checked against the schema on every build; their ids and values are examples. The other answers are generated from the schema (types, enums, formats and required fields) and say so.

The full contract

The field-level contract of every operation is the OpenAPI 3.1 file on GitHub. Open it in any OpenAPI viewer (Swagger Editor, Redocly, Stoplight), or import it into Postman. See OpenAPI file.