Short answer: Treat an order, a payment, a shipment and a refund as related but separate records. Use stable identifiers, a repeat-safe processing design and a reconciliation report. An “order created” event alone should not authorise a paid status, shipment or refund in another system.
A growing online store can survive a delayed notification. It has a harder time with an order shipped twice or a refund that one system reports as complete while another still shows money due. Design the handoffs around those outcomes.
Build a state map your operations team understands
For a fictional Indian homewares store, separate the following decisions before connecting Shopify to an ERP, fulfilment system or accounting workflow.
| State | Keep | Test |
|---|---|---|
| Order | ID and current state | Address change |
| Payment | Reference and confirmed amount | Uncollected COD |
| Fulfilment | Items and shipped quantities | Partial shipment |
| Return | Quantity and inspection | Exchange |
| Refund | Reference and confirmed outcome | Unconfirmed request |
Full criteria
| Business fact | Record it separately | Example exception |
|---|---|---|
| Order accepted | Store order identifier and current order state | Customer changes an address after placing it |
| Payment confirmed | Provider transaction reference and confirmed amount | Cash on delivery remains uncollected |
| Fulfilment progressed | Shipment and item quantities | Only part of the order ships |
| Return received | Returned item, quantity and inspection outcome | An exchange needs different treatment |
| Refund confirmed | Refund reference, amount and outcome | A request is submitted but not yet confirmed |
This is an implementation planning model. Your finance and operations owners must approve how these states map to their products. Do not infer cash collection from order placement or infer a completed refund from a button click.
Why a webhook needs a safety net
Shopify documents both authenticated delivery checks and the possibility of receiving the same webhook again. Its guidance recommends idempotent processing or persistent duplicate detection, and also describes reconciliation to retrieve missed data. In business terms, a repeated message must not produce a second unintended action, and a quiet connection must not be assumed complete. Shopify delivery verification and duplicate handling
Use both the external event or delivery identity and the business object identity appropriately. Two different events can concern the same order; one event can be delivered more than once. Agree which transition is valid before changing the destination record. Keep a durable transfer record so a system restart does not erase the duplicate checks.
For supported payment operations, a provider may have its own retry protections. Stripe, for example, documents idempotency keys for supported requests. Those rules are provider-specific: verify your payment product rather than assuming every gateway behaves identically. Stripe idempotent requests
Give exceptions a destination, not just an error log
An address change before dispatch should reach the fulfilment owner. A refund mismatch should reach the responsible operations or finance owner. A technical authentication failure should reach the connection owner. Sending all three to the same unmonitored inbox makes the automation's output less useful.
Show the source order link, last confirmed state, intended next action, last attempt and assigned owner. Keep customer data restricted to the people who need it. The owner should be able to tell “waiting for a business decision” from “the connection failed.”
A worked exception-cost example
These numbers are hypothetical. Assume 1,000 orders monthly, with five minutes of manual cross-checking each: 83.3 hours. A proposed daily exception queue might require one minute per order for routine review, 50 exceptions at eight additional minutes each and three hours of maintenance. That totals approximately 26.3 hours, leaving 57 hours of capacity compared with the assumed baseline.
This is not proof of cash savings, extra profit or a Formula Works result. If exception volume doubles, or manual review is still necessary elsewhere, the benefit falls. Measure complete reconciled orders and review effort, not the number of successful API calls. See how to measure automation savings.
Five acceptance tests before a busy sales period
- Deliver the same incoming event twice and verify one intended outcome.
- Process an address update after the initial order event.
- Run a partial shipment and check quantities in both systems.
- Interrupt a transfer after the destination may have accepted it, then recover without duplicating it.
- Compare source and destination records over an agreed period and resolve every mismatch.
Add cash-on-delivery and partial-refund cases if they are part of your actual process. Record the maximum acceptable delay for each handoff. A stock update may need different treatment from an overnight management report.
Can the existing ERP remain the stock source?
Yes, that is a possible architecture when the products and access support it. Define one source of authority for each stock-related decision and test how cancellations, returns and timing differences are handled.
Can AI decide which orders to refund?
A classification suggestion is different from authorising a financial action. Keep the approved refund policy and authorised decision-maker explicit; automation should not invent eligibility or payment instructions.
Download the order-state acceptance checklist. Continue with the monitoring runbook, the ERP platform decision guide or Formula Works integration services.