Webhooks that don't lie. A pattern for at-least-once delivery.
Reconciliation, idempotency keys, conflict resolution. Everything we wish Shopify's docs would just say plainly.
Every commerce platform's webhook docs say 'at-least-once delivery'. What they mean is 'sometimes we'll deliver the same event seven times in a row and sometimes we'll never deliver it at all.' Plan for both.
Step 1: idempotency keys, always.
Every event has a unique ID. Store it. If you see it again, do nothing. This is one Redis SET away from a working solution; don't skip it.
Step 2: reconcile every 10 minutes.
We poll Shopify's order list every ten minutes and diff against our local state. Anything missing, we backfill. Anything we have that they don't, we flag for human review. Cheap, boring, saves us once a fortnight.
Step 3: surface conflicts. Don't hide them.
When the webhook says 'order shipped' but Royal Mail's API says 'label not yet printed', surface that conflict. Don't pick a side automatically; let an operator decide.
Want to talk about something you read?
Aria is in the bottom-right corner, or just send the team an email.
