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

# Webhooks

> Hearing about orders and listings the moment they change, instead of asking.

A webhook is an address of yours that we call as soon as something happens: an order
is placed, paid or shipped, a listing is approved or sold. Your system no longer has
to ask `filter[updatedSince]` every few minutes whether anything changed.

## Setting one up

Webhooks belong to one of your own keys. In the dashboard, go to **Settings →
Integrations** and choose **Settings** beside the key. Under **Webhooks** you give:

* **the address** — a public `https` URL. Addresses in a private network, and plain
  `http`, are refused;
* **the events** it should hear about. Only the events your key may read are offered:
  hearing that an order was paid is reading that order, so the order events need
  `orders:read` and the listing events `watches:read`.

A key can have up to five webhooks. Each one gets its own **signing secret**, starting
with `whsec_`, which you can read again on the same screen. **Send test** sends a
`ping` straight away and tells you what your address answered.

> [!NOTE]
>
> The scopes keep counting after you subscribe. If a key loses `orders:read`, its
> webhooks stop hearing about orders, and a withdrawn key stops them all — including
> deliveries that were still being retried. The same goes for the business's
> subscription: without an active one, nothing is sent, as the API answers nothing.

## The events

| Event | When |
| - | - |
| `order.placed` | A buyer placed an order. It may not be paid yet; the watch is reserved for them. |
| `order.awaiting_payment` | The buyer chose a bank transfer and we are waiting for it. |
| `order.paid` | The money arrived. Time to ship. |
| `order.shipped` | The order has tracking, from you or from the dashboard. |
| `order.tracking_updated` | The tracking of a shipped order was changed — a corrected number or courier, from you or from the dashboard. The shipping date and the timeline stay as they were. |
| `order.delivered` | The courier delivered it. |
| `order.completed` | The order is complete. |
| `order.paid_out` | We paid the order out to you. Its `status` stays `completed`: a payout is a step on the order's timeline, not a status of its own. |
| `order.cancelled` | The order was cancelled — also when nobody paid within the reservation window. |
| `order.refunded` | The order was refunded. |
| `watch.status_changed` | A listing changed `status`: approved, sent back for changes, sold, taken offline… Also a listing created anywhere but `draft` (straight into review, or live from a feed), with `previousStatus: null`. |
| `watch.deleted` | A listing was deleted, in the dashboard or over the API. It answers `404` from then on. |

Every order event needs `orders:read`; the listing events need `watches:read`.
Each step of an order is sent once, even if the status is written twice. Listing
events come for every listing of the business — also one without an
`externalIdentifier` (`null`), and one from a Connect feed.

**Changes to what a listing says send nothing**: a new price, description or
specification — by you, in the dashboard, or by Wristler — is not an event; only its
status, its creation and its deletion are. Sync those by `updatedAt`
(`filter[updatedSince]`). Orders are the other way round: every step and every
tracking change is an event.

## What we send

A `POST` with a JSON body:

```json theme={null}
{
  "id": "0b5a8b8e-5f1e-4c51-9b3e-6a1d2f9c7e10",
  "type": "order.paid",
  "createdAt": "2026-11-12T10:15:00.000000Z",
  "seller": { "id": "42" },
  "data": {
    "type": "orders",
    "id": "4471",
    "attributes": {
      "number": "202606830",
      "status": "payment_received",
      "items": [{ "watchId": "9120", "externalIdentifier": "SKU-1042" }]
    },
    "links": { "self": "https://api.wristler.eu/v1/sellers/42/orders/4471" }
  }
}
```

Times are in UTC, as everywhere in the API. Every order event names the listings
in the order (`items`), so a stock system knows without a call which watch an order
is about: `order.awaiting_payment` holds it for a bank transfer, `order.cancelled`
frees it again.

The body says what happened and to what, not everything about it. Read the rest from
`data.links.self` with your key's token: that way a webhook never carries more than
the key may read, and you never act on a copy that went stale while it was being
retried.

`watch.status_changed` carries the listing's `externalIdentifier`, so you can find
your own product without a call, and the status before and after:

```json theme={null}
{
  "type": "watch.status_changed",
  "data": {
    "type": "watches",
    "id": "9120",
    "attributes": {
      "externalIdentifier": "SKU-1042",
      "status": "sold",
      "previousStatus": "available"
    },
    "links": { "self": "https://api.wristler.eu/v1/sellers/42/watches/9120" }
  }
}
```

The headers:

**Wristler-Event** `string`

The event, the same as `type` in the body. `ping` for a test delivery.

**Wristler-Event-Id** `string`

The event's id, the same as `id` in the body. A retry carries the same id: store the
ones you handled and drop a repeat.

**Wristler-Delivery** `string`

Our number for this delivery of this event to this address, for when you ask us
about one. It counts up across all deliveries and stays the same on a retry: it is
not the attempt number. Tell a retry by a `Wristler-Event-Id` you have seen before.

**Wristler-Signature** `string`

`t=<unix time>,v1=<signature>`. See below.

## Checking the signature

Anybody can post to your address, so check that a delivery came from us before you
act on it. `v1` is the hex HMAC-SHA256 of the timestamp, a full stop and the raw body,
keyed with the webhook's signing secret:

```php theme={null}
[$t, $v1] = [null, null];

foreach (explode(',', $_SERVER['HTTP_WRISTLER_SIGNATURE'] ?? '') as $part) {
    [$key, $value] = array_pad(explode('=', $part, 2), 2, null);
    if ($key === 't') { $t = $value; }
    if ($key === 'v1') { $v1 = $value; }
}

$body = file_get_contents('php://input'); // the raw body, before any JSON decoding
$expected = hash_hmac('sha256', $t . '.' . $body, $secret);

if ($v1 === null || !hash_equals($expected, $v1) || abs(time() - (int) $t) > 300) {
    http_response_code(400);
    exit;
}
```

Sign the raw bytes you received, not JSON you decoded and encoded again: the
signature is over exactly what was sent. Refuse a timestamp more than five minutes
off, so a delivery somebody captured cannot be sent to you again later.

## Answering, and retries

Answer with any `2xx` within 10 seconds; what you put in the body is not read. Do the
work afterwards, in your own queue, rather than before you answer.

Anything else — another status, a timeout, a refused connection, a redirect — counts
as not arrived, and we try again: after 1 and 5 minutes, half an hour, 1, 3, 6 and 12
hours. Eight attempts, about a day in all. Redirects are not followed: if the address
moved, change it in the dashboard.

Deliveries can arrive out of order and, rarely, twice. Use `createdAt` and the order or
listing you read back, not the order in which deliveries arrived.

> [!WARNING]
>
> A webhook whose deliveries keep failing — ten in a row that used up every retry — is
> switched off, and the dashboard says so. We email whoever created the key (or the
> business's main account) once, when it happens. Switch it on again once your address
> answers.

The dashboard lists the last deliveries to each address with what it answered. We keep
them for 30 days.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.