Golden rules
- verify
X-Webhook-Secret - acknowledge quickly with
2xx - enqueue work instead of processing inline
- deduplicate on
(order.id, event)
Expected request
Points sends:Recommended handling sequence
Verification example
Node.js
PHP
Python
Fast-ack pattern
Do this:- call slow third-party services before responding
- send email synchronously
- update ERP/WMS inline if it can block the response
Idempotency strategy
Deduplicate using:order.idevent
200 and do nothing.
Status codes
| Your response | Meaning |
|---|---|
200 / 204 | Accepted |
401 / 403 | Secret invalid |
5xx | Temporary processing failure; may trigger retry |
Retry expectations
Current backend behavior:- each outbound request uses a
10second timeout - the job retries up to
3times on failure
Operational tips
Log verification failures separately
Log verification failures separately
A sudden wave of secret mismatches often means the secret was rotated on one side only, or the endpoint was copied incorrectly.
Persist raw payload for audit
Persist raw payload for audit
Store the raw JSON and headers for a limited retention period in staging/production so support can reconcile difficult cases.
Use one secret per environment
Use one secret per environment
Never reuse production webhook secrets in staging or local development.

