Test webhook
Send a test delivery now and answer its result
https://s.zo.sa/api/public/v1 /webhooks/{id}/test webhooks.read_writeSends the store's latest subject of the event's kind (or an empty sample) marked as a test. A test never counts as a failure of the webhook. The receiver has 5 seconds in all (1 to connect) to answer; a slower one is recorded as error timeout. When the platform's outbound slots are all busy, the test is queued instead: the answer is the delivery with status pending and queued true, and its result is read later. Up to 10 a minute.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | required | At least 1 |
cURL
curl -sS -X POST "https://s.zo.sa/api/public/v1/webhooks/7/test" \
-H "Authorization: Bearer $ZO_API_KEY" \
-H "Accept: application/json"JavaScript
const response = await fetch('https://s.zo.sa/api/public/v1/webhooks/7/test', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ZO_API_KEY}`,
Accept: 'application/json',
},
});
console.log(response.status, await response.json());PHP
<?php
$ch = curl_init('https://s.zo.sa/api/public/v1/webhooks/7/test');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ZO_API_KEY'),
'Accept: application/json',
],
]);
$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/webhooks/7/test",
headers={
"Authorization": f"Bearer {os.environ['ZO_API_KEY']}",
"Accept": "application/json",
},
timeout=30,
)
print(response.status_code, response.json()){
"data": {
"id": 1,
"uuid": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10",
"event": "string",
"is_test": false,
"status": "pending",
"attempts": 1,
"response_status": null,
"error": null,
"duration_ms": null,
"next_attempt_at": null,
"created_at": "2026-11-23T06:01:53Z",
"payload": {},
"response_body": null,
"queued": false
}
}Example generated from the schema.
Responses
Response schema
dataobjectrequiredOne send of a webhook, kept 30 days. payload and response_body only on a single delivery (detail, test, resend).14 fields
idintegerrequireduuidstring (uuid)requiredThe X-Zo-Delivery header the receiver saw.eventstringrequiredis_testbooleanrequiredstatusstringrequiredattemptsintegerrequiredresponse_statusintegerrequirednullableerrorstringrequirednullableWhy it failed: timeout, connection_failed, blocked_url, http_{status}, webhook_disabled, or feature_locked (the store no longer has the public API, so a key's webhook stopped).duration_msintegerrequirednullablenext_attempt_atstring (date-time)requirednullablecreated_atstring (date-time)requiredpayloadobjectThe body sent: {event, merchant, created_at, data}.response_bodystringnullableThe first 10 KB of the answer.queuedbooleanOnly on a test send that could not run at once (every outbound slot busy): true, and the delivery waits on the queue with status pending.
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"}}.