Set up your first webhook
- Create a public HTTPS
POSTendpoint in your backend, for examplehttps://api.example.com/webhooks/haulstow. - In the HaulStow developer portal, open your application and add a webhook endpoint.
- Choose the test environment and the events you want.
- Copy the signing secret beginning with
whsec_. It is shown only once. - Save the secret in your server-side secret manager.
- Use the portal’s test button and confirm that your endpoint returns a
2xxresponse.
Events
data.delivery.
Save the top-level event id. HaulStow may send the same event more than once, so use this ID to detect duplicates. The sequence number increases for one delivery. If you already applied sequence 5, do not move your local status backwards when sequence 4 arrives late.
Verify the signature
Each request includes:Node.js
Node.js
Register the raw-body parser on the webhook route before a global JSON parser. In frameworks such as Next.js, NestJS, Laravel, Django, or Rails, use the framework’s documented raw-request-body feature.
timingSafeEqual.
During secret rotation, a callback may contain two v1 values for 24 hours. Keep the previous secret during that overlap and accept the request when either the current or previous secret validates its matching signature.
Delivery and retries
HaulStow delivers webhooks at least once, which means duplicates are normal and your handler must be safe when they happen. Return2xx only after you have saved the event or placed it on a durable queue. Do not wait for slow work such as sending email or updating several services.
Network errors, timeouts, 408, 425, 429, and 5xx responses retry. Other 4xx responses stop automatic retries and require a manual replay from the portal.
Retries occur immediately, then at approximately 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours, and 24 hours, with jitter. Retry-After is honored for 429 and 503 when it fits within the retry window.
Perform slow work asynchronously after persisting the event. A manual replay keeps the event ID but receives a new Haulstow-Delivery-Id.
Debugging checklist
If no webhook arrives:- Confirm the endpoint is active in the correct test/live environment.
- Confirm its URL is public HTTPS and uses port 443 or 8443.
- Confirm the event type is selected.
- Check attempt history in the developer portal.
- Make sure your firewall accepts HaulStow’s request and your route accepts
POST.
- Confirm you used the webhook’s
whsec_...secret, not an API key. - Confirm the correct environment’s secret is loaded.
- Verify against the raw body before JSON parsing.
- Parse every
v1value during a rotation overlap. - Make sure the server clock is accurate.
