Pushbuild

How to stop Shopify webhooks creating duplicate CRM records

A new customer checks out and your CRM gets two or three copies of them. That happens because Shopify sends several webhooks for one checkout, within the same second, and sends some of them again if your endpoint is slow to answer. Each one runs "look up the contact, create it if it is not there" at the same moment, and each lookup finds nothing. Here is how to make the workflow create one record no matter how many webhooks arrive.

At a glance

  1. Why the duplicates happenOne checkout fires several topics, such as customers/create, orders/create and orders/paid, at nearly the same time.
  2. Four fixes, in order of effectPick one topic to create contacts from.
  3. Clean up the ones you already haveExport contacts, group them by email or Shopify customer ID, and merge each group in the CRM so the order history stays on one record.

Why the duplicates happen

  • One checkout fires several topics, such as customers/create, orders/create and orders/paid, at nearly the same time.
  • Shopify retries a webhook that does not get a 200 response within a few seconds, so a slow workflow receives the same event twice.
  • "Search, then create" is not safe when two runs start together: both searches come back empty, and both create.

Four fixes, in order of effect

  • Pick one topic to create contacts from. Let the others only update a record that already exists.
  • Upsert by a stable key, Shopify's customer ID or the email address in lower case, instead of searching and then creating. Most CRMs, HubSpot included, can create or update by email in one call.
  • Skip repeats: every delivery carries an X-Shopify-Webhook-Id header. Save the IDs you have handled and drop any you have seen.
  • Answer Shopify straight away and do the work afterwards, so it has no reason to retry. In n8n, set the webhook to respond immediately; in a queue, process one item at a time per customer.

Clean up the ones you already have

Export contacts, group them by email or Shopify customer ID, and merge each group in the CRM so the order history stays on one record. Then turn on the fixes above before the next sale.

Updated 2026-11-01. General guidance, not advice for your situation; we scope each project in writing before any work starts.

Questions people ask first

Is this a Shopify bug?

No. Shopify documents that webhooks can arrive more than once and out of order. The receiving side has to handle it.

Will a delay between steps fix it?

Rarely for long. A delay only moves the race. An upsert and a webhook ID check remove it.

Does this apply to WooCommerce too?

Yes. WooCommerce also retries webhooks, and the same upsert and dedupe steps work there.

Tell us what you need built.

Tell us the process and the tools involved, or call. We reply with questions or a written scope.

hello@pushbuild.com

(617) 299-8887