WooCommerce stock is out of sync
"Out of sync" almost always means two systems each believe they own the truth about stock, with nothing arbitrating between them. WooCommerce manages stock per product, or per variation, through the "Manage stock?" option; the problem starts as soon as an external source, a supplier, an ERP or another sales channel, changes that figure without going through the same rules.
How I go about it
-
Checking the source of truth
I look at where the displayed figure actually comes from: the _stock value in the WooCommerce database, or data re-imported from a supplier feed, an ERP, or another sales channel, and how often.
-
Analysing the sync frequency
A nightly CSV import or a sync over the wc/v3/products REST API that doesn’t run often enough leaves a window where two simultaneous sales, on two different channels, can oversell the same item.
-
Checking the hold delay
The woocommerce_hold_stock_minutes setting reserves stock for an unpaid order for a set number of minutes. A payment gateway slow to confirm can make this normal reservation look like a desync.
-
Looking for orders created outside the normal flow
An order inserted directly through the API or an import, outside WooCommerce’s usual checkout flow, can bypass the normal stock-decrement hook and leave a wrong figure with no visible order to explain it.
-
Deciding on the target sync mechanism
Once the cause is identified, I work out whether a setting is enough or whether the real fix is a small dedicated sync service, with a clear arbitration logic between the systems involved.
What I handle regularly
- A product sold on WooCommerce when the supplier was already out of stock
- The stock shown doesn’t match either the ERP or the supplier, with no obvious pattern
- Orders hold stock for several minutes without completing, throwing off the available figures
- A stock import overwrites quantities that had just been sold minutes earlier
- Stock is correct right after the import, then drifts through the day
Where the gap actually comes from
WooCommerce stores the quantity (_stock) and a computed status (_stock_status) as product or variation metadata. As long as a single source changes that figure, through the normal checkout flow, everything stays consistent. The problem starts as soon as a second system, a supplier feed, an ERP or another sales channel, also writes that value, with neither one aware of what the other just did.
A nightly CSV import or a sync over WooCommerce’s REST API (the wc/v3/products endpoint) that only runs once or twice a day creates a window where the catalogue can be oversold between two passes, particularly on a fast-moving catalogue.
The woocommerce_hold_stock_minutes setting adds a nuance that’s often overlooked: an unpaid order reserves stock for a fixed period. If the payment gateway is slow to confirm, that normal reservation can be misread as a desync.
Worth reading too
Describe your need in one minute
A few targeted questions so I can reply with an estimate rather than another questionnaire.