Shopify & API integration
How to handle duplicate Shopify webhooks and retries
Design a Shopify webhook integration that handles retries without duplicate orders. Choose the right event ID and test replay before launch.

Work out which kind of duplicate you received
A webhook can arrive more than once after a timeout or retransmission. Shopify provides a webhook ID for the delivery and an event ID for the merchant action that generated it. Separate subscriptions can send different webhook IDs for the same event. Record the shop, topic, webhook ID and event ID so you can see what happened.
Choose the key according to the effect you want to protect. Use the webhook ID when filtering repeated deliveries. If more than one subscription can legitimately trigger the same ERP update, use a separate key for that effect, scoped to the shop and source event. Two consumers can still process the same event when one updates the ERP and the other maintains reporting.
Accept the event after it is safely stored
Verify that the request came from Shopify. Persist the event or put it in a durable queue before returning success, then process it separately. That avoids holding the request open while the ERP does its work. If storage is unavailable, let the provider retry under its documented policy instead of acknowledging a message that could disappear.
Give the event a traceable state. An operator should be able to tell whether it is waiting, processing, complete or held for review. Keep the external order reference and the reason for failure. Limit retained event payloads to what the team needs for processing and recovery.
Protect the order in the destination as well
Suppose the integration writes order 1042 to the ERP. The ERP commits the order, but its response never reaches the integration. A replay that simply creates an order again can duplicate it. Before retrying an uncertain write, look up the Shopify order reference in the destination. Use the destination’s supported idempotent write or a unique external reference when available.
Use one durable database claim per effect to stop two workers from claiming the same task concurrently. Design for interrupted work as well: the worker might fail after the destination commits but before completion is recorded locally. Persisted state plus a lookup or safe retry at the destination makes that case recoverable.
Test duplicate, delayed and missing examples
Replay a captured test event twice and verify that the ERP contains one order. Repeat with two workers and simulate a lost response after the destination accepts the order. Deliver a later update before an earlier one and confirm the final ERP state reflects the current source record. If an event is missed, a periodic reconciliation should flag the gap for replay or review.
Track how many events are accepted, retried, stuck or awaiting reconciliation. Give support a runbook to find an order by its external reference and see the result before repeating a write.
Checklist
- Record the shop, topic, webhook ID, event ID and order reference.
- Persist accepted messages before acknowledging delivery.
- Look up uncertain writes before retrying.
- Test duplicate deliveries, concurrent processing, reordered updates and missing events.
Reference
Shopify developer documentation on webhook delivery and duplicatesWhat if the same order has several valid events?
Keep separate records for distinct actions such as payment, fulfillment and cancellation. Use the event ID to trace the action, then choose a key for each destination operation so a later legitimate update can still run.
Shopify API Integration for Orders and InventoryPlanning a project?
Bring an anonymized example of a duplicated or missing order and the Shopify and ERP references. We can identify where the delivery or destination write needs a safer retry.
Related guides
- Shopify speed test checklist for a slow mobile store
- Odoo inventory reconciliation for warehouse teams
- How to measure invoice OCR accuracy before going live
- Odoo data migration checklist for a first ERP rollout
- Software requirements checklist for quoting a custom app
- CI/CD deployment checklist for a safer production release
- Business process automation examples and how to pilot one