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#
| Resource | What it covers | Operations | Scopes |
|---|
| Store | The store the key belongs to. | 1 | store.read |
Catalog#
| Resource | What it covers | Operations | Scopes |
|---|
| Products | Products and their variants, read and written by id or by SKU, and product images. | 9 | products.read products.read_write |
| Categories | The store's product categories. | 5 | products.read products.read_write |
| Brands | The store's brands. | 3 | products.read products.read_write |
| Inventory | Stock levels, stock movements, stock adjustments and the store's branches. | 4 | inventory.read inventory.read_write |
Orders#
| Resource | What it covers | Operations | Scopes |
|---|
| Orders | Orders, their status history and status changes, and the store's order statuses. | 6 | orders.read orders.read_write |
| Payments | Payments recorded on an order and the store's payment methods. | 2 | payments.read |
| Shipments | Shipments: create one for an order, list them, get a label, cancel. | 6 | shipments.read shipments.read_write |
Customers and marketing#
| Resource | What it covers | Operations | Scopes |
|---|
| Customers | The store's customers. | 4 | customers.read customers.read_write |
| Abandoned carts | Carts customers left without placing an order. | 1 | carts.read |
| Coupons | Discount coupons. | 5 | marketing.read marketing.read_write |
| Reviews | Customer reviews and the store's replies. | 4 | reviews.read reviews.read_write |
Webhooks#
| Resource | What it covers | Operations | Scopes |
|---|
| Webhooks | Webhook subscriptions, the events you can subscribe to, test sends, secret rotation and delivery logs. | 11 | webhooks.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.