Available for projects & agency overflow · Quick reply, from the person who does the work

Running a shared stock pool without overselling

Running a stock pool shared across several shops, without overselling or lag, is a common type of project when the same business operates across multiple sales channels.

Describe my issue Send a message

The typical need

A business sometimes sells the same physical stock across several online shops: a main shop and a shop dedicated to one range or brand, two shops targeting different countries, or a B2C shop and a B2B shop drawing from the same warehouse. Without a dedicated mechanism, each shop tracks its own stock figure independently, with a real risk of overselling: the same item sold twice on two different shops, when in reality only one is left.

How I approach this kind of need

The principle I use most often is a master/mirror architecture: one shop or system acts as the reference for actual stock, and the others mirror that value with synchronisation as fast as the context requires. The central question to settle before any development is when stock gets decremented: at add-to-basket, at order confirmation, or at shipping. Each choice has its own advantages and side effects, particularly on low-availability items.

I pay particular attention to race conditions: two orders placed almost simultaneously on two different shops for the last unit of the same item. The logic has to guarantee that only one of the two orders actually gets the item, with clear handling for the other — automatic refund, a substitute item offer, or a waiting list, depending on what the business can accept.

Factors that affect the quote

  • Number of shops involved

    Syncing two shops is simpler than a network of several points of sale sharing the same stock.

  • Freshness requirement

    Stock updated in real time needs a more robust architecture than syncing every few minutes, which is acceptable for some businesses.

  • Handling variants

    A product with many variants (size, colour) multiplies the number of stock combinations that need syncing correctly.

  • Link to an external system

    If actual stock is driven by an ERP or third-party management software, that system becomes the reference, adding an extra integration to the scope.

Frequently asked questions

Does stock have to be decremented at the basket stage?
No, it's a choice to make based on the business. Decrementing at basket stage reduces the risk of overselling but can needlessly tie up stock on baskets that never get completed; decrementing at order stage is more permissive but exposes more to conflict risk.
Does this approach work with shops on different CMS platforms?
Yes, the master/mirror principle still holds even when the shops don't run on the same platform; it's the synchronisation layer that adapts to each system.
How are single-unit, high-demand items handled?
These are the cases most exposed to overselling: I pay closer attention to managing conflicts between simultaneous orders on this type of item.
Does shared stock slow down product page loading?
No, if the architecture is well designed: the displayed availability can be cached and refreshed at a rate matching the actual freshness needed, without an expensive query on every page view.

Describe your need in one minute

A few targeted questions so I can reply with an estimate rather than another questionnaire.

outil
api
sens
frequence (facultatif)
Please provide an email or a phone number so I can get back to you.

Please provide an email or a phone number so I can get back to you.