The real symptom
- Orders reduce Shopify availability, then the ERP sync restores it.
- Popular items oversell even though Shopify initially reserved stock.
- The ERP and Shopify disagree on On hand, Available, or Committed units.
- Multi-location inventory gets overwritten at the wrong location.
Likely causes
- The integration confuses On hand and Available.
- Committed inventory is ignored by the ERP feed.
- The sync sends absolute values without compare-and-set protection.
- The ERP updates one location while orders are assigned to another.
- Fulfillment is delayed, leaving many units committed.
Fix path
- Map every Shopify location to the matching ERP warehouse.
- Decide whether the ERP is the source of truth for On hand or Available.
- Use Shopify inventory states consistently.
- Inspect adjustment history for overwritten quantities.
- Use compare-and-set or audit references where the API supports them.
- Stop sending blind absolute updates during order peaks until the logic is corrected.
Simple checks
- Compare one SKU across ERP, Shopify On hand, Shopify Available, and Shopify Committed.
- Open inventory adjustment history after a sale and after the next ERP sync.
- Check whether the sync writes to the location that fulfills online orders.
Useful code or DevTools check
# Conceptual rule:
# Do not replace Available with physical stock if Shopify has committed units.
# Sync the intended named quantity and location deliberately.
Do not do this
Do not “fix” overselling by enabling Continue selling when out of stock. That turns a sync bug into an operational policy.

