Skip to content

Shopify Dude Fix

Shopify Webhook ID vs Event ID: Which One Should You Deduplicate?

Separate delivery deduplication from merchant-action correlation so legitimate subscriptions are not silently skipped.

Quick answer: For classic Shopify webhooks, deduplicate individual deliveries using X-Shopify-Webhook-Id. Use X-Shopify-Event-Id to correlate notifications caused by the same merchant action. Current Shopify documentation distinguishes these two jobs.
On this page

Why older guidance can fail

Some tutorials use the event ID as the only unique key. That can suppress legitimate work when multiple subscriptions receive notifications from one action. Conversely, a delivery ID alone does not prevent two independent subscriptions from creating the same external business record.

Implement two layers of protection

  1. Authenticate the request using the raw body and Shopify HMAC before trusting headers.
  2. Persist a delivery key scoped to the app and shop. Use a unique database constraint rather than a read-then-insert check.
  3. Store the event ID separately for tracing related deliveries.
  4. Commit the inbox record and durable job together before acknowledging success. A worker should retry unfinished jobs independently of HTTP delivery retries.
  5. Protect external side effects using a business key, such as shop and order ID for creation of an ERP order. Use an upsert or a destination-supported idempotency key.

Example

Two subscriptions receive a product edit: one updates search and one updates an ERP. They can share an event ID while having distinct delivery IDs. Both jobs must run. A retry of the search delivery must not create a second search job. If two jobs target the same ERP order, the ERP business key provides the second line of protection.

Common misunderstanding: Deduplicating an HTTP request guarantees exactly-once business effects. A worker can crash after an external write but before recording completion; the destination operation must also tolerate retries.
How to test this:

  1. Replay a signed test delivery twice and confirm one inbox job.
  2. Send two distinct delivery IDs sharing an event ID and confirm both intended handlers run.
  3. Simulate a database failure before acknowledgment; verify retry does not lose work.
  4. Simulate a worker crash after the external write; verify retry does not duplicate the record.
  5. Reject invalid signatures and test rapid edits to ensure stale data cannot overwrite newer state.
Sources and further reading: Shopify delivery verification; Webhook header reference. Documentation checked November 24, 2026.