Webhook delivery lifecycle
What happens to one event from the store to your receiver, and the tools to inspect, test and recover deliveries.
Signing
- Every delivery carries
X-Zo-Event,X-Zo-Delivery(the same id on a retry),X-Zo-Security-StrategyandUser-Agent: ZoSa-Webhooks/1.0, and the body{event, merchant, created_at, data}. - With the
signaturestrategy it also carriesX-Zo-Signature, and with signature version 2X-Zo-Timestamptoo. Withtokenit carriesAuthorization: Bearer <secret>instead. Make the webhook through the API to use version 2. - Version 2 (
signature_version: 2, recommended):X-Zo-Signatureis the hex HMAC-SHA256 of"{timestamp}.{body}"with the secret, wherebodyis the request body exactly as it arrived. Refuse a timestamp more than 300 seconds away. - Version 1:
X-Zo-Signatureis the hex HMAC-SHA256 of the raw body with the secret, and there is noX-Zo-Timestamp. - The secret is shown once, in the create answer (
secret).
The verifiers in PHP, Node and Python: Verifying the signature.
The answer and the retries
- Answer any 2xx within 15 seconds. Otherwise the delivery is tried 3 more times, 5 minutes apart.
- A retry carries the same
X-Zo-Delivery: use it to drop duplicates. - After 50 failures in a row, or 10 timeouts in a row, the webhook switches itself off and the owner is told. Switch it back on with
PATCH /webhooks/{id}and{"is_active": true}once the receiver is fixed; switching a webhook back on clears its failure count.
The log and the tools
| Tool | Call | What it does |
|---|---|---|
| Delivery log | GET /webhooks/{id}/deliveries | The last 30 days, ordered by created_at; filter[status] pending, success or failed. |
| One delivery | GET /webhooks/{id}/deliveries/{delivery} | The body sent and the answer. |
| Resend | POST /webhooks/{id}/deliveries/{delivery}/resend | The same data as a new delivery (a new X-Zo-Delivery): 202 with status pending; read the outcome with the call above. |
| Test send | POST /webhooks/{id}/test | Sends a sample now and answers its result; your receiver has 5 seconds (1 to connect). It never counts as a failure. |
| New secret | POST /webhooks/{id}/secret | A new secret, shown once; the old one stops at once. |
Ownership and plan
- A key sees and manages only the webhooks it made; others answer 404. Revoking the key stops them.
- A store has 10 webhooks (Pro), shared by the dashboard and every key.
- Subscribing to an event needs the read scope of the event's resource, and scopes are checked again at every send.
- A store without the
webhooksfeature has none (402feature_locked), so it polls withupdated_since.