> ## Documentation Index
> Fetch the complete documentation index at: https://www.zinc.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Receive real-time updates from the Zinc API using webhooks.

Webhooks let you receive real-time notifications from the Zinc API whenever important events occur (such as order status changes, tracking updates, or failures).

To use webhooks, include a `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](/v1/object-reference/webhooks), etc.).

## Example Webhooks Object

```json theme={null}
{
  "request_succeeded": "https://example.com/zinc/request_placed",
  "request_failed": "https://example.com/zinc/request_failed",
  "tracking_obtained": "https://example.com/zinc/tracking_obtained",
  "tracking_updated": "https://example.com/zinc/tracking_updated",
  "status_updated": "https://example.com/zinc/status_updated",
  "case_updated": "https://example.com/zinc/case_updated"
}
```

## 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 to `example.com` and include an `Authorization: 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.

<Info>
  If no URL is specified for a webhook type, no notification will be sent for that event.
</Info>

For more details or advanced webhook usage, contact [support@zinc.com](mailto:support@zinc.com).
