webhooks
object in your API request. This object specifies the event types you want to listen for and the URLs to notify.
What you send:The
webhooks
object in your request, specifying which events you want to receive and where.
What you receive:When an event occurs, Zinc sends a
POST
request to your specified URL(s). The body of the webhook is the same as the standard JSON response for that event (see Webhooks Reference, etc.).
Example Webhooks Object
Webhook Event Types
Event | Type | Description |
---|---|---|
request_succeeded | String | Webhook URL for when a request succeeds |
order_placed | String | (deprecated) Synonym for request_succeeded (orders only) |
request_failed | String | Webhook URL for when a request fails |
order_failed | String | (deprecated) Synonym for request_failed (orders only) |
tracking_obtained | String | Webhook URL for when ALL tracking for an order is retrieved (orders only) |
tracking_updated | String | Webhook URL for when ANY tracking for an order is retrieved (orders only) |
status_updated | String | Webhook URL for when the status of a request is updated |
case_updated | String | Webhook URL for when a ZMA case associated with the order receives an update |
- You can optionallypass an array of URLs for any webhook type; Zinc will notify all of them.
- Webhooks have “at least once” delivery—your endpoint may receive the same event more than once. Deduplicate on your end if needed.
- Webhooks are not signed. For security, you can include a secret query parameter or use HTTP basic authentication in your webhook URL. When you provide a URL like
https://user:password@example.com/zinc/tracking_obtained
, Zinc will send the webhook toexample.com
and include anAuthorization: Basic <base64(user:password)>
header in the request. - Additionally, for maximum security, you can discard the body of the webhook and instead use it as a trigger to re-fetch the body from the normal
/v1/orders/:order_id
API endpoint.
If no URL is specified for a webhook type, no notification will be sent for that event.