Journal

Why the stock on your storefront is wrong

The website said in stock. The warehouse said no. The five real causes of stock drift between an ERP and a storefront, and why none of them are fixed in the website.

A customer orders a product the website says is in stock. The warehouse says it is not. Someone phones the customer, apologises, and the order is cancelled or substituted. If you sell from an ERP-fed catalogue, you have had this conversation, and the first instinct is always to blame the website. The website is almost never where the problem lives.

Where stock numbers come from

A storefront does not know what is on the shelf. It knows what the ERP last told it, and it knows that as a number per product, updated on a schedule or by an event. Between updates the storefront is a snapshot. Every sale, return, transfer and stock-take in the ERP is a chance for the two to drift apart until the next sync catches up.

For a B2B portal we run against a live ERP, that sync happens continuously, and the stock figure on the site is a few seconds old at worst. Even then, “in stock” can be wrong, and when we traced the complaints the cause was never the sync.

The real causes, in the order we find them

  • Warehouse granularity. The ERP holds stock per warehouse, bin and location. The website shows one number. If the site sums every location, including a returns bay, a demo pool or a branch that does not ship online, the total is right and the sellable quantity is wrong. The fix is to decide, in the ERP, which locations count as sellable, and to expose only that.
  • Allocated but not shipped. An order placed in the ERP by a sales rep reserves stock that is still physically on the shelf. If the feed sends on-hand rather than available, the site sells it twice.
  • Stock on order. Some feeds count incoming purchase orders as stock so the website can show “available”. The customer reads that as “ships today”.
  • Negative stock. An ERP that allows stock to go below zero, usually because a receipt was captured late, produces a product that is simultaneously sold out and shows a quantity.
  • Product identity. A SKU changed on one side and not the other. The website is faithfully showing the stock of a product that no longer exists.

Notice that every one of these is a business rule, not a bug. The sync carried the number it was given.

What we do about it

First, we measure the drift instead of arguing about it. A small job on the storefront records what the ERP reported for each product and what the site shows, and flags any product where the two disagree for longer than the sync interval. Within a week the pattern is obvious: it is always the same warehouses, the same product groups, or the same kind of order.

Second, we take the finding to the ERP side and fix the rule there, because that is where it is true. Hiding a warehouse in the website code works until the next person wonders why the numbers do not add up. Marking the location as non-sellable in the ERP fixes it for every channel at once.

Third, we are honest on the product page. “In stock” and “available to order” are different promises, and a site that shows the difference gets fewer cancellations than one that rounds everything to a green tick.

The uncomfortable rule

If the ERP cannot answer “how many of this can I sell right now” in one number, the website cannot either, and no amount of integration work will make it so. The projects that go well start by settling that question with the people who run the warehouse. The ones that drag on try to solve it in code.

We build and run ERP-connected storefronts for distributors and retailers, and stock drift is the first thing we look at on every one of them.

Got a similar problem? Talk to us.

Start a project