When ERP and WooCommerce show different stock, first decide which number each system is supposed to own. Physical on-hand, available-to-promise, reserved and web-sellable stock are not necessarily the same field; synchronising the wrong concept faster only spreads the inconsistency.
Define the stock contract
Write the formula WooCommerce should display: for example on-hand minus ERP reservations minus safety stock, or an explicitly exported web-available field.
Give every update an identity
Use SKU/product ID, source timestamp/version and a sync/run ID so an older message cannot silently overwrite a newer stock state.
Handle checkout reservations
WooCommerce can hold stock while payment is pending. Decide whether that reservation is also sent to ERP and how abandoned holds expire.
Make updates idempotent
Replaying the same ERP message must not subtract stock twice. Prefer setting a versioned absolute value when the integration contract allows it.
Detect races
Order creation, cancellation, refund and ERP batch import can arrive in different order. Reject or quarantine stale versions instead of accepting last-write-wins blindly.
Reconcile with a sample
Compare ERP source, integration payload, WooCommerce product/variation and active reservations for a controlled SKU set.
Compare the WooCommerce side with order stock reduction and preserve order history with the order-data guide.
Run a three-point stock reconciliation
For each sampled SKU, record the ERP authoritative value, the exact integration message/version and the WooCommerce value plus active reservations at the same time. Do this before and after one controlled order. If the middle message is already wrong, fix mapping; if it is right and WooCommerce diverges, inspect application/update logic.