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
httpsURL. Addresses in a private network, and plainhttp, 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:readand the listing eventswatches:read.
whsec_, which you can read again on the same screen. Send test sends a
ping straight away and tells you what your address answered.
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
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
APOST with a JSON body:
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:
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.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.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:
Answering, and retries
Answer with any2xx 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.
The dashboard lists the last deliveries to each address with what it answered. We keep
them for 30 days.