Sifr Wahid Developers

Guides

Testing

Try everything on a test store before the merchant's real one: the sample app, an API client with the OpenAPI file, and webhooks through a tunnel.

A test store

Try everything on a test store on Pro with its own key before the merchant's real store. Keys are bound to one store, so a test key never reaches the real one.

The sample app

The sample app on GitHub is a small Node app with no packages to install (Node 20 or later). It reads the store and its first products, subscribes to order.created and product.updated with signature version 2 and verifies every delivery, places a demo order twice with one Idempotency-Key so the second answer is the replay, and adds one to a variant's stock. Its key needs store read; products, orders, inventory and webhooks read and write; and customers read.

Postman and Insomnia

  • There is no ready-made collection in this release. Postman and Insomnia both import an OpenAPI 3.1 file: import the raw openapi-public.yaml from its URL to build the requests from the contract.
  • Set the base URL to https://s.zo.sa/api/public/v1 and Bearer authentication with a variable holding the key.
  • Add an Idempotency-Key header to the writes that require it: POST /orders, POST /inventory/adjustments and POST /orders/{id}/shipments.

Webhooks on your machine

A webhook's URL must be https on a public address, so a receiver on your machine needs a tunnel: run one, such as cloudflared tunnel --url or ngrok http, and register the public https address it gives you, the exact final URL with no redirect. Then send a sample at any time with POST /webhooks/{id}/test, and read what your receiver answered in GET /webhooks/{id}/deliveries.

Before you go live

Work through the go-live checklist.