Create a Webhook
POST
v1/managers/webhooksWebhooks allow you to receive real-time data updates about various events.
For certain events, you can specify conditions under which the webhook should trigger,
allowing for more targeted data retrieval.
Supported Webhook Events
For more details on available events and their conditions,
please refer to the Supported Webhook Events page.
Request
The Authorization token is a unique key given to the third-party application (Partner) by Zid. It is used to authenticate the API requests made by the Partner application. The token verifies the partner's identity and ensures they have permission to access Zid's API but does not provide any specific user or store information. It should be included in the header of API requests when the partner application needs to access Zid's API.
This token is used to authenticate and access information related to the store. It is obtained through an OAuth mechanism and is required to perform operations on the store's data. The X-Manager-Token
should be included in the header of API requests that require store-related information.
Preferred language for the response. Defaults to en
if not specified.
The event that the webhook will subscribe to. It represents the type of event that will trigger the webhook.
The URL to which Zid will send a payload when the subscribed event triggers. This is the endpoint that will receive the webhook data.
An optional user-defined identifier for reference purposes. The original ID allows the user (Partner) to associate their own identifier with the webhook subscription.
The name or identifier of the subscriber. It indicates the source or owner of the webhook subscription.
Additional conditions that can be specified for the webhook subscription.
This field allows filtering the webhook events based on specific criteria.
For example, you may want to be notified only when an order's status is 'delivered'
or if the payment method is 'Cash On Delivery'.
Supported Events: order.create
and order.status.update
Key | Type | Description |
---|---|---|
delivery_option_id | integer | The delivery option ID in Zid. |
status | string | One of these statuses: [new, preparing, ready, inDelivery, delivered, cancelled]. |
payment_method | string | One of these methods: [Cash On Delivery, Credit Card, Bank Transfer]. |
The order status. Optional.
The delivery option ID in Zid. Optional.
The payment method. Optional.
{
"event": "order.status.update",
"target_url": "http://zid.sa",
"original_id": 1,
"subscriber": "My App",
"conditions": {
"status": "new",
"delivery_option_id": 55,
"payment_method": "Cash On Delivery"
}
}
Request samples
Responses
The status of the webhook creation request. Possible statuses codes are ready
, pending
, inactive
, and error
.
The UUID assigned to the webhook subscription by Zid.
The event that the webhook is subscribed to.
The URL to which Zid will send a payload when the subscribed event triggers.
The UUID of the store associated with the webhook.
The conditions under which the webhook will be triggered. These conditions were specified during the webhook creation and allow the webhook to be triggered only when certain criteria are met.
Supported Events: order.create
and order.status.update
Key | Type | Description |
---|---|---|
delivery_option_id | integer | The delivery option ID in Zid. |
status | string | One of these statuses: [new, preparing, ready, inDelivery, delivered, cancelled]. |
payment_method | string | One of these methods: [Cash On Delivery, Credit Card, Bank Transfer]. |
An optional user-defined identifier for reference purposes.
The name or identifier of the subscriber or the source of the webhook.
Indicates whether the webhook is active or not.
A message indicating the result of the webhook creation.
The type of the message.
The code associated with the message.
The name of the message.
A detailed description of the message.