What is Inventory?
In ecommerce, Inventory represents the physical stock count of a specific variant recorded at a fulfillment location (warehouse, retail store, or 3PL provider).
Inventory is dynamic and changes continuously as orders are placed, reserved, packed, shipped, returned, or restocked.
Inventory States
Modern ecommerce systems distinguish between different inventory states:
- On Hand: Total physical stock present in the building.
- Committed / Reserved: Units allocated to customer orders that have been placed but not yet shipped.
- Available: Stock actually available to sell to new customers online (
Available = On Hand - Committed). - Incoming: Stock in transit from suppliers or manufacturers.
- Safety Stock / Threshold: Minimum buffer quantity to prevent stockouts.
Multi-Location Inventory
Modern merchants store stock across multiple physical locations (e.g. Warehouse East, Warehouse West, Main Storefront).
An order placed in California will automatically reserve inventory from the closest warehouse (Warehouse West) to minimize shipping distance and delivery times.
Common Confusion
Developer Takeaway
Race Conditions & Overselling: Never update inventory counts using naive SQL UPDATE variants SET stock = 10 queries during checkout. Use atomic decrements (e.g. UPDATE inventory_levels SET available = available - 1 WHERE available >= 1) or distributed inventory lock queues to prevent overselling popular items during flash sales.