Availability updates reach the open product page through a live browser connection.
How stock updates and reservations work
This guide covers: how warehouse changes update the shop and how checkout reserves the available stock.
About this guide
Prepared with AI under human direction. This guide describes the July 2026 implementation, with source and test references where noted.
1. What it does
Warehouse changes update the availability shown to customers. At checkout, Stock checks the current quantity again before reserving it.
An atomic reservation guard accepts one valid hold and refuses every request that arrives too late.
2. From warehouse to product page
The first film shows the complete visible story with on-screen captions.
Warehouse changes update the open shop
A damage adjustment closes the purchase action. A goods receipt reopens it. The customer does not reload the page and the operator does not coordinate with the storefront.
3. The final unit is decided once
A displayed quantity does not reserve stock. The second film shows what happens when two customers try to reserve the last unit.
One shopper wins the last unit
Both customers begin checkout simultaneously. Stock grants one reservation, lets that customer continue to shipping, and gives the other customer a clear sold-out result.
Reservation accepted
The guarded update holds the unit and checkout continues.
available ≥ requestedInsufficient stock
No stock remains to reserve, so this checkout cannot continue.
4. What changes for the customer
- 01More accurate availabilitySold-out inventory stops looking purchasable to active customers.
- 02More sellable timeReplenished stock returns to sale without manual storefront coordination.
- 03No final-unit oversellOne request receives the hold; every later request receives a clear outcome.
- 04Recorded stock changesReceipts, damage, reservations and releases remain recorded stock movements.
How inventory works
The sections below explain ownership, transactions, asynchronous delivery, browser recovery and the database decision that prevents overselling.
5. How inventory moves
One path keeps the shop current. A separate path confirms availability at checkout before any unit is reserved.
| Boundary | Owns | May project | Must never decide |
|---|---|---|---|
| Stock | Quantity, movements, reservations, available-to-sell | Authoritative state and audit ledger | Product merchandising or order lifecycle |
| Catalog / Storefront | Product presentation and customer interaction | Availability for fast customer reads | Whether the final unit is held |
| Cart | Checkout orchestration | Reservation identity and status | Stock allocation without Stock confirmation |
6. Live availability sequence
The browser starts from a database snapshot and then follows complete availability updates emitted after committed warehouse transactions.
7. Reservation concurrency
Two requests can reach checkout together. Correctness comes from the database mutation predicate, not request timing or the customer-facing projection.
8. Reservation lifecycle
A checkout hold either becomes committed order stock, returns through cancellation, or expires safely. Each route keeps quantity changes and reservation state consistent.
FULFILLED is the current Stock state name for a reservation committed to an Order; it does not mean Cart owns the business capability of fulfilment. Quantity remains reserved until shipment deducts physical stock. Cancellation and expiry return held quantity. Cleanup claim and release share one transaction, so a release failure leaves the active hold available for the next sweep.9. Failure and recovery
Distributed reads can update at different times. Stock saves quantity and reservation changes in one transaction, while other services may take longer to catch up.