Note • Nov 2, 2025

Shopify Webhook Retries That Don't Double-Write

Date
Nov 2, 2025
Tags
integrationsshopifybackend

Idempotent webhook retries.

The Problem

Shopify retries webhooks when your endpoint is slow or returns 5xx. Without idempotency, the same inventory_levels/update event could decrement stock twice.

Approach

  1. Persist first — store the raw body and headers before doing any business logic.
  2. Idempotency key — derive from Shopify’s event ID (or a hash of topic + resource + updated_at).
  3. Short-circuit duplicates — if the key exists in a processed table, return 200 immediately.
  4. Dead-letter — validation failures go to a review queue, not infinite retry loops.

Operational Win

Support could answer “what happened to order X?” by looking at job state instead of grep-ing logs.

When This Matters

Any webhook source that retries: Stripe, ShipStation, EDI adapters, internal event buses.