Shopify webhook automation is not “run a script after a notification.” Define events, scopes, idempotency, ordering, failure queues, retries, monitoring, and human rollback. Cross-border stores often connect orders, stock, payments, fulfilment, and CRM; duplicate or out-of-order events can create duplicate shipments, overwritten inventory, or incorrect customer messages.
Define an event contract
For each topic record event name, version, resource ID, trigger, fields, signature verification, consumer, latency tolerance, and retention. Separate received, processed, and externally confirmed states; HTTP 200 alone does not prove business completion. Request minimum scopes and redact sensitive fields in logs.
Use idempotency and queues for failure
Use event ID, resource version, or business key for idempotency; return the existing result for a duplicate. Check versions for out-of-order delivery. Send failures to a retry queue with exponential backoff and a cap. Alert and pause risky actions after the cap, allowing controlled replay instead of infinite retries.
Run cross-border regression tests
Test order create/cancel, inventory, payment success/failure, refunds, fulfilment updates, time zones, currencies, partial shipment, duplicate events, bad signatures, API throttling, and external downtime. Retain event ID, order ID, state, retry count, and adjustment reason, then reconcile Shopify sales reporting with actual fulfilment.
FAQ
Does HTTP 200 mean a webhook was processed?
No. Separate receipt, queue, processing, and external confirmation.
How can duplicate fulfilment be prevented?
Make events and order actions idempotent, persist state, and review duplicates or out-of-order messages.
How long should retries run?
Set backoff, cap, and alerting by business deadline; risky payment or stock actions must not retry forever.
How should a webhook rollback work?
Pause consumers, preserve the queue, restore external state, replay a small batch, and reconcile orders and stock.