Receiving Deliveries
The request
Each delivery is an HTTPS POST with a JSON body.
The event reference shows a complete body for each event type. Events can gain new fields and values over time, so ignore fields you don’t recognize.
Verifying a delivery
Verify every delivery before acting on it:
- The signed content is
{webhook-id}.{webhook-timestamp}.{body}: the two header values and the raw body, joined by periods. - The key is the part of the secret after
whsec_, Base64-decoded. - The expected signature is the HMAC-SHA256 of the signed content with that key, Base64-encoded.
- The delivery is authentic when the expected signature equals the value after
v1,in any of the header’s signatures.
The signature covers the body exactly as received. Verify the raw bytes before parsing them; JSON that is parsed and re-serialized will not match.
Reject a webhook-timestamp more than five minutes from the current time, to stop old
deliveries from being replayed.
The scheme follows the Standard Webhooks specification, so the Standard Webhooks libraries verify deliveries in many languages. The example below needs only the Python standard library (3.6 or later).
Test values
These values check an implementation of the signature step on its own (the timestamp is too old to pass the five-minute check):
Responses and retries
Each retry uses the subscription’s current URL and secret. Pausing or deleting a subscription cancels its pending retries.
Return a 2xx as soon as the delivery is verified and stored, and do slower work
afterward, so long processing doesn’t run past the 30-second limit.
Duplicates and ordering
Delivery is at least once. A repeated delivery carries the same webhook-id, so use it to
skip deliveries you have already processed.
A new event for the same order or package has a new webhook-id: order.shipped again
when a package gains a tracking number, and order.whready again when an order re-enters
the warehouse system under a new order number.
Deliveries can arrive out of order. timestamp gives the time each event happened.
