Stock & Warehouses
Tracking availability across locations, the event-based stock model, and batches and expiry dates.
Stock is recorded as events rather than as a single number, which is what makes it possible to say where a shortfall came from.
Where to find it
Architect Panel → Commercial:
- Carts — the cart itself and its options
Architect Panel → Data:
- Datastores — then View Data on the cart table, and look for the row actions
The model
Each stock record is an event against a product: a name for what happened, a quantity, how much of it remains, the warehouse it is in, optional batch information, an optional expiry date, and room for additional data.
Available stock is the sum of what remains. So a product with three deliveries has three records, each depleting as it sells.
Why events rather than a number
Because a number tells you what you have and nothing else. Events tell you which delivery a shortfall came from, which batch a customer received, and what is about to expire — and they survive a stock check disagreeing with the system.
Warehouses
Each has a name and a country, and stock belongs to one. The country matters: shipping methods are defined between a sender country and a recipient country, so which warehouse holds the stock affects what shipping is offered and what it costs.
Stock for a warehouse is reachable directly from the warehouse row.
Batches and expiry
Where you need them, they are already there. Batch information supports recall — being able to say which customers received a particular batch is the difference between a targeted recall and a general one.
Expiry dates support rotation and let you see what is about to become unsellable while it still has value.
Stock tracking is a cart option
It can be off, which is right for made-to-order, services and digital goods. If it is on, it needs to be maintained — a shop showing stock levels that are wrong is worse than one showing none.
Count regularly
System stock and physical stock diverge. Breakages, miscounts and unrecorded movements all erode accuracy, and the divergence compounds silently until an order cannot be fulfilled.
Count the fast-moving lines often and everything periodically.
Decide what happens at zero
Hidden, shown as out of stock, or available to back-order. Each is defensible; not having decided means you find out during your busiest week.
Worked example
A distributor holds stock across two warehouses in different countries, recording each delivery as an event with its batch and expiry. When a supplier issued a recall, the affected batch identified the specific orders within minutes. Fast-moving lines are counted weekly.
Recommendations
- Record batch information if recall is ever plausible.
- Remember warehouse country drives shipping options.
- Count fast-moving lines weekly.
- Decide the zero-stock behaviour in advance.