Why your website sells pallets the counter already sold

An overnight ERP stock sync lets the website sell pallet lines the trade counter sold that morning. Why it happens and how to speed the stock feed up.

The product page says 10 pallets available. An order for five goes through at twenty past one, and when the warehouse goes to pick it, the ERP says there's nothing left. Somebody now has to ring a trade customer who has a crew booked for tomorrow and tell them the bricks aren't coming.

If your ERP sends stock to the website once a night, this is what it looks like. Both systems are doing what they were set up to do, from different moments in the day: the ERP knows about this morning, and the website knows about 2am.

Why the website and the ERP drift apart

Your ERP is the stock record. The trade counter, the phone team, reps out on the road and any EDI orders all take stock off in the ERP as they sell. The website keeps its own copy of the stock figure, because a product page can't go and ask the ERP every time someone loads it.

That copy gets refreshed when the sync runs. Between syncs, the website does count its own orders down. On Shopify, for example, each online order takes stock off the available figure, and once a tracked item hits zero the default is that nobody can buy it. What the website can't see is anything sold through the other channels. It has no idea the counter sold eight pallets at half seven.

So the figure on the product page is really "what we had at 2am, minus what the website has sold since". On slow lines that's close enough. On pallet lines it can be wildly out by lunchtime, because one trade counter sale can take most of the stock in a single transaction, and every pallet the website sells after that is a pallet you don't have.

There's a second, smaller fault worth knowing about. Some overnight syncs work by taking a snapshot of ERP stock and writing that figure onto the website as an absolute number. If a few web orders came in after the snapshot was taken but before they reached the ERP, the sync can write the old, higher figure back over the top, and stock that has already sold reappears on the site for a while. Shopify's API now has a check that helps, if the integration uses it properly. From its April 2026 version, an app that sets stock this way has to state the figure it expects Shopify to hold, or deliberately opt out. If a web order has changed that figure since, Shopify refuses the write instead of overwriting it.

One pallet line, one Tuesday

Here's a hypothetical builders' merchant on Shopify. The ERP pushes stock to the website at 2am, and web orders drop into the ERP as they come in. The line is a facing brick sold by the pallet, with 14 pallets in the yard when the sync runs. The figures are made up to show the mechanics.

TimeWhat happensERP stockWebsite shows
02:00Nightly sync runs1414
07:30Trade counter sells 8 pallets614
09:15Web order for 4 pallets210
10:40Phone team books 2 pallets010
13:20Web order for 5 palletsminus 55
15:05Web order for 3 palletsminus 82
02:00 next dayNightly sync runs0 to sell, 8 owed0

The counter, the phone team and the morning web order used all 14. The two afternoon web orders, eight pallets between them, were for stock that had already gone, and both came in hours after the ERP hit zero.

The cost turns up in different places, so nobody sees it added up. Two trade customers get a phone call they didn't want, and one of them may well go and buy those bricks elsewhere, along with the sand and cement that were on the same order. The branch spends the afternoon on refunds or chasing a supplier for a faster delivery. And because the cancelled orders still went through the checkout, your analytics and your ad platforms can record them as sales, so the campaign behind those two orders looks like it had a good day unless someone removes those orders from the figures.

Getting stock to the website faster

The fix is to make the website's figure move when the ERP's figure moves, or as close to that as your ERP allows. There are a few ways to do it, and which one fits depends on what your ERP can do.

Push changes as they happen. Some ERPs can tell another system when a record changes. Microsoft Dynamics 365 Business Central can do this, with a few catches. It can send a notification when an item changes, but it waits 30 seconds after the first change by default, the notification says which record changed without including the new figure, and the subscription expires after three days unless the integration renews it. Item ledger entries aren't on its standard list of records it will notify about (a custom API can be set up to send them), so whether a trade counter sale actually triggers a notification depends on how your setup records stock against the item. We test that with a real sale before anyone relies on it.

Ask for changes often. Where the ERP can't push, the integration can ask it every few minutes for any stock that has changed since it last asked. That's a small request for a few dozen lines, where a full catalogue of 5,000 products every few minutes would be heavy on both sides. Shopify's API limits are generous for this kind of work (100 points a second on the standard plan, ten times that on Plus), and Shopify caps each list in a request at 250 items, so a few dozen changed lines fit in one call.

Hold some stock back on fast lines. For pallet lines that sell in big lumps, the integration can publish a little less than the ERP holds, or switch the product to "call to confirm" below a set level. That costs you the odd web sale of the last pallet. It also means the last pallet goes to the customer standing at the counter with a van outside.

Keep the nightly sync as a check. Faster updates can still miss something. Shopify's own documentation says apps shouldn't rely on its webhooks arriving and should run reconciliation jobs to catch what was missed, and the same thinking applies to any ERP feed. The nightly full sync stays, as a check that catches the odd figure that slipped through, using that compare-before-you-write check so it doesn't put sold stock back on the site.

One Shopify setting can undo all of this, so we check it too. "Continue selling when out of stock" is set per product or variant. It's meant for things like pre-orders and stock that's already on its way, but if it has been switched on for a range during an import, the website will happily sell below zero whatever the sync does.

What a faster sync won't fix

A faster sync moves the ERP's figure to the website quicker. If that figure is wrong, you just publish the wrong number sooner. Pallets broken in the yard, a delivery booked in before it arrived, or a counter sale written on a pad and keyed in once the counter shuts all show up on the website exactly as they show up in the ERP.

So part of the work is agreeing with the branches when a sale has to go into the ERP, and keeping it simple enough that it happens. For merchants who also sell on account, pricing can have the same "which system owns this?" problem, which we've written about in why the website shows the wrong trade price.

What to do with the product page when a line does run out is a separate question. Deleting it throws away the search traffic it has built up, and we've covered the alternatives in why out-of-stock product pages shouldn't be deleted. For heavy lines, the delivery charge belongs in the same conversation, since a customer who has already been surprised by pallet charges at checkout is less forgiving about a cancelled order.

This is the kind of job our data integration work covers: working out what each system can actually send, how quickly, and what happens when one of them falls over. Done well, the product page shows none left within a few minutes of the counter selling the last one, and the warehouse stops finding out about the problem when it goes to pick.

Frequently asked questions

Does every ERP need a real-time integration with the website?

No. If a product sells a few units a week, a nightly sync is fine, because there's little chance of the counter and the website both selling the last few on the same day. The lines that need faster updates are the ones that sell in large quantities through more than one channel, and for many merchants that's a short list of pallet and bulk lines. You can start with those and leave the rest on the nightly run.

Is a webhook always better than checking for changes every few minutes?

Not always. A webhook is faster when it works, but ERPs differ in what they will notify about, and some, like Business Central, only send a pointer to the changed record, so the integration still has to go and fetch the figure. Checking every two to five minutes for changed stock is simpler and easier to monitor. For a trade counter selling pallets, a few minutes' delay is a much smaller window for overselling than a whole day.

Can Shopify stop selling when the ERP hits zero?

Shopify stops selling when its own stock figure reaches zero and "Continue selling when out of stock" is off. It doesn't know what the ERP holds, so it can only stop at the right moment if the integration has updated its figure in time. That's why the speed of the sync and the stock buffer on fast lines do most of the work, and the Shopify setting is a backstop.

Will a faster sync hit our ERP or Shopify API limits?

It can if it sends the whole catalogue every time. Sending only the lines that changed keeps each run small, and a few dozen changed lines fit inside Shopify's limit of 250 items per list in a request. On the ERP side it depends on the system and how it's hosted, so we check the limits for yours before setting the schedule.