Back to Blog
Ecommerce

Keeping ERP and Online Store Stock in Sync Without Overselling

By Ashker Published October 07, 2026 6 min
Two steel gears meshing precisely on a matte grey surface under controlled light

Short Answer

Sync stock between an ERP and an online store by pushing changes quickly, running a scheduled reconciliation to catch missed events, using compare-and-set updates and holding a small buffer on fast sellers.

A shopper in Sharjah buys the last unit online at the same minute a showroom customer buys it in person. The ERP knows about one sale and the store knows about the other. Neither system knows both, so the business has sold one item twice. The apology email and refund can cost more than the margin on the sale.

This guide compares the main ways to keep stock in sync between an ERP and an online store. It covers webhook push, scheduled pull, conflict handling and the stock buffer protecting fast sellers. Examples come from the official Shopify and WooCommerce developer documentation. It is written for UAE retailers and distributors planning a new ERP integration or repairing an old one.

Why does stock drift between an ERP and a store?

Stock drifts because several sales channels change the same quantity at slightly different times. The store records web orders, while the ERP records supplier deliveries, showroom sales, returns and warehouse transfers. Every delay between those updates opens a window where one unit can sell twice.

Start by naming one source of truth for each stock field. Usually the ERP owns physical on-hand quantity, and the store owns reservations from web orders until those orders reach the ERP. Writing this down early prevents two connected systems silently overwriting each other's numbers.

Quick Answer

ERP and online store stock drifts because several sales channels change quantities at different times. Name one source of truth per stock field, usually the ERP for physical on-hand stock.

Should stock changes be pushed or pulled?

Pushing sends each stock change immediately through webhooks or events, so the other system learns about it quickly. Pulling asks the other system for current quantities on a fixed schedule, which is simpler to build but slower. Most reliable integrations use both, side by side.

Shopify's developer documentation says apps should not rely on receiving webhooks, because delivery is not always guaranteed. It recommends reconciliation jobs that periodically fetch data so the app stays consistent. Shopify also does not guarantee webhook ordering, so sort events using the timestamps it provides.

Quick Answer

Push stock changes by webhook for speed, then run scheduled reconciliation to catch missed events. Shopify states webhook delivery and ordering are not guaranteed, so never rely on push alone.

How do you stop two updates overwriting each other?

Send updates that check the current value before changing it, an approach known as compare-and-set. Shopify's inventorySetQuantities mutation only updates a quantity if the stored value matches the one you expected. Otherwise it returns an error, and your integration should reread stock before trying again.

Shopify warns that skipping this check can produce inaccurate quantities when several requests run concurrently. Duplicate webhook deliveries are another real risk, so record each delivery's ID and ignore repeats. Shopify also requires an idempotency key on this mutation from its 2026-04 API version onwards.

Wooden abacus with plain beads resting on a clean white table beside a small brass weighing scale

Quick Answer

Use compare-and-set updates, such as Shopify's inventorySetQuantities check, so concurrent stock changes cannot overwrite each other. Also ignore duplicate webhook deliveries and send idempotency keys where the platform requires them.

How large should a stock buffer be?

A stock buffer hides a few units from the website to cover sales made elsewhere between syncs. Size it carefully from how fast your other channels sell each product during a single sync interval. Slow sellers and online-only items often need no buffer at all.

Here is a simple, hypothetical worked example. If a showroom sells about eight units an hour and stock syncs every fifteen minutes, roughly two units could sell unseen by the website. Too large a buffer causes phantom out-of-stock messages while the warehouse still holds units.

Quick Answer

A stock buffer hides units from the website to cover other channels' sales between syncs. Size it per product from sales speed and sync interval, avoiding buffers on slow sellers.

Which platform features help with stock sync?

WooCommerce's REST API exposes managestock and stockquantity fields on each product, so an integration can update stock directly. It also offers webhooks for topics such as order.created and product.updated, which suit push-style syncs. Its product batch endpoints handle up to 100 objects per request by default.

Shopify provides inventory mutations with compare-and-set checks, plus webhooks that you should back with reconciliation jobs. On either platform, log every sync, alert someone when it fails and record the last successful run. Without alerts, a broken sync can leave stock wrong for days.

Quick Answer

WooCommerce offers stock fields, order and product webhooks and 100-object batch updates by default. Shopify offers compare-and-set inventory mutations, and syncs on both platforms need logging, monitoring and failure alerts.

Main Takeaways

Overselling usually comes from delays between sales channels updating the same stock quantity. Name one owner per field, push changes for speed and run scheduled reconciliation to recover missed webhooks. Use compare-and-set updates and idempotency so concurrent or duplicate changes cannot corrupt quantities. Hold small buffers only on fast multi-channel sellers, and alert a named person whenever a sync fails.

Getting your stock numbers to agree

Reliable stock sync is mostly about owning each number and catching the inevitable failures you cannot prevent. Push changes quickly, reconcile on a regular schedule and reject any update based on outdated quantities. Keep buffers small and targeted at fast multi-channel sellers. Then watch the logs closely, because a sync that fails silently does more damage than a slow one.

For the checkout side, see how reserving stock during payment prevents abandoned carts locking items. Our comparison of architectures for a catalogue that changes daily covers fast-moving prices and stock. Auronix Web Studio builds ERP and store connections through its custom integration and automation service. Tell us which ERP and platform you use, and we will outline a sync plan.

Sources & References

  • Shopify - Webhooks best practices (delivery not guaranteed, reconciliation jobs, ordering, duplicate deliveries) - https://shopify.dev/docs/apps/build/webhooks/best-practices (checked 2026-10-02)
  • Shopify - Admin GraphQL API, inventorySetQuantities mutation (compareQuantity check, idempotency key required from 2026-04) - https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventorySetQuantities (checked 2026-10-02)
  • WooCommerce - REST API documentation (managestock, stockquantity, webhook topics, batch limit of 100 objects) - https://woocommerce.github.io/woocommerce-rest-api-docs/ (checked 2026-10-02)
  • FAQs

    Questions readers usually ask next

    These FAQs are written to match the topic of this post and to help readers move from understanding to action.

    Why do stores connected to an ERP oversell?

    Delay between a sale in one channel and the stock update in another is the usual cause. Missed webhooks and failed sync jobs that nobody notices make the problem worse.

    How often should a scheduled stock sync run?

    That depends on how quickly your products sell and what your ERP's API allows. Fast sellers need shorter intervals, but always check the API rate limits before shortening the schedule.

    Can we sync stock in both directions?

    Yes, but each field should have one owner, or updates will overwrite each other. Typically, confirmed web orders flow to the ERP, and on-hand quantities flow back to the store.

    Should web orders reserve stock immediately?

    Reserve stock when the shopper starts paying, and release it if payment fails or expires. Make it permanent once the gateway confirms payment, then send the order to the ERP.

    What happens if the ERP is offline during a sale?

    The store keeps selling from its last known quantities, which increases the overselling risk. Queue outgoing orders, retry automatically and run a full reconciliation once the ERP is reachable again.

    Do we need middleware between the ERP and the store?

    Not always, because simple setups can connect directly through each system's own API. Middleware helps when several channels, warehouses or ERPs are involved, but it adds another system to monitor.

    How do bundles and kits affect stock sync?

    A bundle's available quantity depends on its scarcest component, so calculate it from component stock. Syncing bundles as independent products with their own counts usually leads to overselling the components.

    How do we know the sync is working?

    Compare ERP and store quantities for a random sample of products every day. Alert someone automatically whenever a sync job fails or the last successful run is older than expected.

    Should a buffer apply to every product?

    No, apply buffers mainly to fast sellers that are stocked in several sales channels. Slow sellers and online-only items rarely need one, and unnecessary buffers hide stock you could sell.

    What should we ask an integration developer before starting?

    Ask which system owns each field, how missed events are recovered and how conflicts are detected. Also ask how failures are logged and who receives the alerts when something breaks.

    Related Resources

    Need help deciding whether to keep a platform or go custom?

    We help UAE businesses scope the checkout, data model, and integrations before they commit to a stack that is too heavy or too limited.

    Built for stores where pricing, inventory, or delivery rules need more control than a default template gives.

    WhatsApp Start project chat