TecnoStack
Start a projectالعربية
Order 1042 travels left to right, times out and is retried, then passes a key check that lets through one sales order and skips the duplicate.
Product & strategy

Store platforms resend orders, and an order can arrive twice or late. Give each event an owner, make the store order number a unique key in the ERP, and reconcile orders and refunds by ID every day.

In this article

An ERP ecommerce integration stays reliable when every order event has one system that decides it and one key that identifies it, so a resent event can never create a second sales order. It also needs retries that stop after a set number and hand the case to a named person, and a daily reconciliation that compares store orders and refunds with ERP documents, ID by ID. Design on the assumption that an event can arrive twice, late or not at all, because the store platforms document all three.

The problem shows up as two sales orders for one order, stock reserved twice, a cancelled order the warehouse is still packing, or a refund booked twice. This guide follows one hypothetical order through three stages: who owns each event, how to stop a retry from duplicating the order, and how returns and refunds reach the ERP and are reconciled.

We use the Shopify, Salla, Zid and WooCommerce documentation for delivery and retries, and the ERPNext and Odoo 19 documentation for the ERP side, as reviewed in November 2026. The example is hypothetical, and TecnoStack is not an Odoo or Frappe partner. Which system owns each customer field is covered in our guide to data ownership in CRM and ERP integration, so we do not repeat it here.

Before connecting anything, list the order events you use, the system that decides each one, what the ERP does with it and the key that identifies a repeat. The store decides the order, the payment and the customer’s cancellation; the ERP decides shipment, stock and receiving returned goods. Each arrow follows the owner: the order travels from the store to the ERP, and the stock level from the ERP to the store. If it is not yet clear which system owns orders in your company, start with the difference between CRM and ERP in the work each one owns.

EventDecided inWhat the ERP doesDuplicate key
Order placedStoreCreates one sales orderStore order number
Payment confirmedStore or payment gatewayRecords the payment against the order or invoicePayment transaction ID
Cancelled before shipmentStoreCancels the sales order if nothing has shipped or been invoicedOrder number and status
ShipmentERPIssues the delivery note and updates the store statusDelivery note number
Stock levelERPSends the available quantity to the storeItem code
Return receivedERPIssues a return delivery noteReturn number
RefundStore or payment gatewayIssues a credit noteRefund transaction ID

The hard rows are the ones both systems touch: cancelling an order the warehouse has started, and refunds. Frappe’s open-source ecommerce_integrations app, which connects Shopify to ERPNext, is cautious here: on a cancellation it cancels the sales order only if no sales invoice or delivery note exists for it, and otherwise records the store status on those documents for a person to decide. Write down your own rule for a packed order: stop it, ship and then return it, or deliver it.

Diagram titled Who owns each order event? with the Store on the left and the ERP on the right. Four arrows run from the Store to the ERP: Order placed, Payment, Cancellation and Refund, and two run from the ERP to the Store: Shipment and Stock level, above the line One key per event.

Each event travels from the system that decides it, and each one carries a key that identifies a repeat.

The store platform sends each event to your receiving endpoint and waits for a successful reply; if none arrives in time, it sends the event again. If the ERP saved the order and the reply was lost on the way back, the resent event is a duplicate. Platforms differ in how long they wait, how often they retry and what happens after repeated failures:

PlatformWaits for a replyRetriesAfter repeated failures
ShopifyFive secondsUp to 8 times over 4 hoursThe subscription is deleted if it was created through the Admin API
SallaAbout 30 secondsThree times, about five minutes apartNot described on the documentation page
ZidNot stated on the webhook health pageUp to 3 attempts per event with growing gapsAt 30 failures in an hour, delivery stops and pending events are discarded
WooCommerceNot stated on the documentation pageNot described on the documentation pageThe webhook is disabled after more than five consecutive failures

Sources, reviewed in November 2026: Shopify on delivery and duplicates and response time, Salla webhooks, Zid webhook health tracking and WooCommerce webhooks. Check your platform’s page before you design, because these figures can change.

Shopify’s documentation adds two points. It does not guarantee the order of events, so it recommends ordering them by the X-Shopify-Triggered-At header or the updated_at field. And an app should not rely on webhooks alone; it needs reconciliation jobs that fetch data periodically. Verify each request’s signature before acting on it: Shopify signs every delivery with HMAC, and Salla adds the X-Salla-Signature header by default.

Make every write to the ERP safe to repeat, so the same event arriving twice has the same result as arriving once. Four steps get you there:

  1. Accept quickly, process later. Save the event with its delivery ID in a log or queue, reply with success, then create the documents in the background. Shopify fails a delivery that gets no reply within five seconds and recommends a queue for this reason.
  2. Skip deliveries you have handled. Record each delivery ID, such as X-Shopify-Webhook-Id, and skip any already processed.
  3. Make the store order number unique in the ERP. Store it in a field on the sales order. In ERPNext, a custom field can be marked Unique, so the database refuses a second sales order with the same number. Frappe’s Shopify app looks for a sales order with the Shopify order ID before creating one, but a lookup alone can let two deliveries processed at the same moment both pass; the unique field closes that gap.
  4. Create the order in one operation. In Odoo 19, each call to the JSON-2 API runs in its own transaction, and the documentation recommends calling a single method that performs all related operations. Creating the header in one call and the lines in another can leave half an order. The same page says the older XML-RPC and JSON-RPC endpoints are scheduled for removal in Odoo 22 (fall 2028) and Odoo Online 21.1 (winter 2027), so ask which API your connector uses.

Late events need one more rule: keep the time of the last event applied to each order, and if an older one arrives, fetch the current order from the store’s API instead of applying it.

Example: order 1042

A hypothetical homeware store in Riyadh on Salla receives order 1042 for three items. The integration follows the four steps.

TimeWhat happenedWhat the integration didResult
10:02The order-created event for 1042 arrivedSaved it and created sales order SO-0815 with store number 1042; the connection dropped before the reply arrivedThe platform recorded a failed delivery
10:07The platform resent the same eventThe key check found 1042 on SO-0815, logged the duplicate as skipped and replied with successOne sales order
10:15A status update created at 10:11 arrived after one from 10:13 had been appliedFetched the current order from the store insteadThe newer status stayed

Separate temporary failures, where a retry helps, from permanent ones that resending will not fix. An order with an item that is not mapped in the ERP fails the same way every time.

What happenedRetry?Who actsNext step
The ERP did not reply or returned a server errorYes, a limited number of times with growing gapsThe integrationThe exception list if it keeps failing
Item not mapped in the ERPNoItem master ownerMaps the item code, then reprocesses the event
Tax or shipping account not mappedNoAccountantCompletes the setup, then reprocesses
Cancelled after shipment or invoicingNo automatic cancellationOperations and financeDecide between a return and a credit note
Subscription removed or endpoint brokenNoIntegration maintainerRegisters it again, then recovers missed orders by date

Each row on the exception list carries the order number, the reason, the next permitted action and a named owner. Nobody resends an event by hand while the integration is still retrying it, so one event never travels two paths at once.

Silence is the bigger risk. After repeated failures Shopify deletes the subscription, Zid stops delivery and discards pending events, and WooCommerce disables the webhook. Monitor subscription status and keep a catch-up job that fetches orders for a date range and passes them through the same key check. Frappe’s Shopify app has such an option: it fetches old orders between two dates and sends them through the same sales order sync, which skips orders already created.

Separate goods coming back to the warehouse from money going back to the customer. A refund event does not prove the item has arrived, and a received return does not mean the money has been paid.

ERPNext records a sales return through a return delivery note, a credit note (a sales invoice marked as a return), or both, starting from the original document. Its documentation warns against returning the same stock through both: if a return delivery note has already received the goods, leave Update Stock cleared on the credit note. In Odoo 19, a return before invoicing uses a Reverse Transfer; after invoicing it needs a credit note as well, because validated invoices cannot be changed. Odoo’s credit note documentation calls the credit note the only legal way to cancel, refund or modify a validated invoice.

Key credit notes by the refund transaction ID, not the order number, because one order can be partly refunded more than once. A resent refund event then creates no second credit note, while a genuine second partial refund still gets its own. How gateways confirm and settle payments and refunds is covered in our guide to payment gateways in Saudi Arabia.

In the example, the customer returned one item the next day. The warehouse issued a return delivery note against the original delivery; the store then issued refund R-1, and the integration created a credit note against the invoice without updating stock, because the goods were already back.

Each morning, compare the previous day’s lists by ID, not by count alone: the counts can match while one duplicate hides one missing order. A hypothetical day at the same store:

CheckStoreERPWhat the ID comparison foundOwner
Orders4848 sales ordersOrder 1057 is duplicated and order 1063 is missingIntegration maintainer with sales
Cancellations33MatchedNo action
Refunds21 credit noteRefund R-2 is for a damaged item the customer kept, so no return is expectedAccountant

A colleague had entered order 1057 by hand while it waited on the exception list, without the store number, so the key could not stop the later reprocessing. The manual order was cancelled and the store number became mandatory for manual entry. Order 1063 was waiting for an unmapped item, which was mapped and reprocessed. The accountant issued a credit note for R-2 without a stock return.

The day is closed when every difference is resolved or on the exception list with an owner and a date. Compare order amounts with gateway payouts too, by transaction reference, because a payout can arrive after the day of sale.

Diagram titled Daily reconciliation. In the Store column on the left are Orders and Refunds, in the ERP column on the right are Sales orders and Credit notes, and the cards meet at a Match by ID node that points down to the Exception list, above the line Every gap has an owner.

Lists are compared by ID rather than by count, and every gap moves to the exception list with an owner who closes it.

Before go-live, test a resent order, a late event, an unmapped item, a cancellation after shipment and a partial refund. The ERP implementation roadmap places these tests in the acceptance decision, and the integration deserves a row in your ERP change register, with an owner and a test at every update of either system.

Prepare the order events you use and the owner of each, and sample orders with personal data removed, including a cancellation, a partial refund and a return. Add your returns policy, the item code mapping between the systems and the person who will review the exception list each day. Note the store platform and the ERP edition and hosting; if you have not chosen the ERP yet, compare Odoo and ERPNext with one purchasing trial.

Through our CRM and ERP implementation team, we review the order flow and your existing integrations. CRM/ERP connector inclusions in store plans remain as published, and we review overlap before quoting additional work. What needs code we build through custom ERP ecommerce integration development, with agreed integrations and a documented handover your team can operate.

Share your process, sample documents and the integrations you need for a scoped discussion you can review.

Discuss your website, store, app or AI project in Arabic or English. We agree the scope before work starts.

Book a free scoping callCompare services and prices