Shopify + NetSuite data integrity

How to Prevent Duplicate Orders and Inventory Errors Between Shopify and NetSuite

Why integrations create duplicate sales orders and wrong stock levels, and the design rules that stop both.

Short answer

Duplicate orders are prevented by making every write to NetSuite idempotent: the same Shopify order can arrive twice, but it can only create one sales order. Use the Shopify order ID (not the order number) as the unique key, store it in the NetSuite sales order’s External ID, and look up or upsert by that key before creating anything.

Inventory errors are prevented by making NetSuite the single source of truth for stock, sending available quantity (on hand minus committed) per location, mapping each Shopify location to exactly one NetSuite location, and setting absolute quantities rather than adjusting by a difference.

Both need the same safety net: retries with backoff, a dead-letter queue for records a retry cannot fix, and a scheduled reconciliation that compares Shopify with NetSuite, because webhooks can be late, repeated or missed.

Why duplicates happen

Shopify sends order data to integrations through webhooks. A webhook is a notification, not a transaction, and Shopify’s delivery rules make duplicates normal rather than rare:

  • Retries. If the receiving app does not acknowledge a delivery quickly, Shopify treats it as failed and retries for about four hours. If the first attempt actually reached NetSuite before timing out, the retry creates a second order unless the integration checks first.
  • Repeat deliveries. Shopify does not promise exactly-once delivery, and an app can receive the same event more than once. Each delivery carries identifying headers, such as X-Shopify-Webhook-Id, that an integration can record to skip a repeat.
  • No ordering guarantee. An order update can arrive before the order create, or a refund before the payment, so the integration cannot assume sequence.
  • Two writers. A connector and a second app, or a connector and manual entry, both create orders in NetSuite for the same Shopify order.
  • Replays after an outage. Someone re-runs a batch of failed orders without checking which ones already posted.

The fix for orders: one key, enforced in NetSuite

1. Pick the right unique key

Use the Shopify order ID, the numeric identifier Shopify assigns to every order. Do not use the order name (for example #1001): merchants can change its prefix and suffix, and it repeats across stores. If you run more than one Shopify store into one NetSuite account, prefix the key with the store, for example us-store:5520912345678.

2. Store it in the sales order’s External ID

Many NetSuite record types have an External ID field, and NetSuite identifies a record by its External ID together with its record type. Writing the Shopify key there lets the integration find the existing record by that key, and an upsert on External ID updates that record instead of creating a second one. Many integrations also copy the Shopify order ID and order name into custom body fields so staff can search and report on them.

3. Look up or upsert, never blind-create

Before creating a sales order, the integration should search for the key, or use an upsert operation keyed on External ID, so a repeat delivery updates or skips instead of creating. Apply the same rule to every record the integration writes: customers, cash sales, customer deposits, credit memos, cash refunds and item fulfillments each need their own Shopify key.

4. Record “done” only after the write is durable

If the integration keeps its own list of processed deliveries, it should mark a delivery as processed after the NetSuite record is saved, not before. Marked first, a failed write leaves a marker behind, and Shopify’s retry is then skipped as a duplicate: an order lost to the check meant to protect it. Keep that list for longer than Shopify’s retry window.

Retries, dead letters and reconciliation

  • Retry with backoff. Temporary failures such as NetSuite concurrency limits, timeouts and locked records should retry automatically, with growing delays.
  • Dead-letter what a retry cannot fix. An inactive item, a missing customer or a closed accounting period will fail every time. Move those records to a dead-letter queue, alert a named person, and require a note when someone resolves one, so every cleared error is accounted for.
  • Reconcile on a schedule. Shopify stops retrying after about four hours and can delete a webhook subscription that keeps failing. After that, orders simply stop arriving and nothing on the receiving side reports an error. A scheduled job that compares Shopify orders and refunds with NetSuite, by order ID, turns a silent gap into a named exception.
  • One writer per flow. Turn off any second app or connector that also creates orders, and stop manual entry of web orders in NetSuite.

The fix for inventory: one source of truth

Most inventory drift comes from breaking one of three rules: two systems both adjusting stock, locations mapped loosely, or a sync that runs too slowly for peak periods.

  • NetSuite owns stock. Receipts, transfers, counts and adjustments happen only in NetSuite. Shopify displays what NetSuite sends, and inventory editing in Shopify admin is locked down.
  • Send available, not on hand. NetSuite separates on-hand, committed and available quantities. Sending on hand oversells stock already promised to other orders.
  • Map locations one to one. Each Shopify location maps to exactly one NetSuite location, or to a documented roll-up rule. Returns, quarantine and inspection locations are not sellable.
  • Set absolute quantities. Shopify’s Admin API can set a quantity or adjust it by a difference. A set is safe to repeat; an adjustment sent twice changes stock twice. Inventory syncs should send the absolute available number.
  • Post orders to the fulfilling location. Otherwise committed quantities build up in the wrong place and the next sync shows the wrong stock.
  • Treat stock in transit as unavailable until it is received, and calculate kit and bundle availability from component stock in NetSuite.
  • Sync fast enough for your sales velocity. Use event-driven updates for receipts, transfers and fulfillments, and a per-location safety buffer for fast movers during promotions.

The full model is in Shopify and NetSuite multi-location inventory, explained.

Checklist: symptoms, causes and fixes

SymptomUsual causePrevention
Two NetSuite sales orders for one Shopify orderRetried or repeated webhook with no key checkShopify order ID in External ID; lookup or upsert before create
Duplicate orders after an outageFailed batch replayed without checking what postedReplays go through the same keyed lookup as live orders
Orders created twice by different toolsTwo apps, or an app plus manual entry, writing the same flowOne writer per flow; manual web-order entry stopped
Duplicate credit memos or refundsRefunds not keyedShopify refund ID as the key on each refund record
Orders missing from NetSuiteRetries exhausted or webhook subscription removedScheduled reconciliation by order ID; subscription health check
Shopify oversellsOn-hand sent instead of available, or slow syncSend available per location; faster sync or buffer for fast movers
Stock resets after staff editsInventory edited in both systemsAdjust only in NetSuite; lock Shopify inventory editing
Stock doubles or drops twiceDelta adjustments applied twiceSet absolute quantities from NetSuite
Store sells out online but has unitsLocation not mapped or not sellable onlineDocumented location mapping table, checked first when numbers disagree

How SCG builds this into an integration

SCG designs these rules into every Shopify NetSuite integration we implement, whether it runs on NetSuite Connector, an iPaaS or Lightning, SCG’s own NetSuite-first integration platform. In Lightning:

  • Each Shopify delivery gets a deterministic job ID built from its webhook ID, so the queue refuses a second copy, and a processed marker is written only after the job is safely queued.
  • Errors a retry cannot fix are dead-lettered and raise an alert. An admin resolves each one from the dashboard with a required note, recorded in the audit log.
  • An hourly check reports paid orders and refunds that Shopify has and Lightning never received, by order number, and a six-hourly check confirms the webhook subscriptions still exist.
  • Inventory runs NetSuite-to-Shopify with location-aware rules in the Inventory Operations plugin.

No integration on Shopify can promise that every order arrives in real time. What a good one promises is that a missed or repeated order becomes a named exception that someone fixes, instead of a duplicate or a gap you find at month-end. See the Shopify NetSuite integration overview and how integration platforms compare.

Frequently asked questions

Why does my integration create duplicate sales orders in NetSuite?

Usually because the same Shopify order reached NetSuite twice and nothing checked for it. Shopify retries deliveries it thinks failed and can send the same event more than once. The fix is a unique key, the Shopify order ID, stored in the sales order’s External ID, with a lookup or upsert before every create.

Should I use the Shopify order number or the order ID as the key?

The order ID. The order name (such as #1001) can change format when a merchant edits the prefix or suffix, and it repeats across stores. If several stores feed one NetSuite account, prefix the order ID with the store.

What is an External ID in NetSuite?

A field on many NetSuite record types that holds an identifier from another system. NetSuite identifies a record by its External ID and record type, so an integration can look up or upsert by the Shopify key instead of creating a second order, customer or refund.

How do I stop Shopify from overselling NetSuite inventory?

Make NetSuite the source of truth, send available quantity per location rather than on hand, map each Shopify location to one NetSuite location, set absolute quantities, and sync fast enough for your sales velocity. See multi-location inventory, explained.

What happens if a Shopify webhook is missed?

Shopify retries for about four hours, then stops, and it can delete a subscription that keeps failing. Without a scheduled reconciliation, the order never reaches NetSuite and no error appears. A reconciliation job that compares Shopify and NetSuite by order ID catches it.

Can you fix duplicates in an integration we already run?

Yes. We review your current connector or iPaaS flows, add keys and lookups where they are missing, clean up existing duplicates in NetSuite, and add reconciliation and alerting. We work on NetSuite Connector, Celigo, Boomi and Jitterbit as well as Lightning.

Stop duplicate orders and stock errors

Tell us which connector you run and what is going wrong. We will find where duplicates and drift come from and what it takes to fix them. The first consultation is free.

760-576-2560

hello@seibertconsulting.com