Please wait...
projx digital
0212 325 73 00

KNOWLEDGE BASE

How do you manage stock reservations and order statuses in e-commerce?

PROJX Insight: A stock reservation sets aside a quantity of a product for an order in progress, for a defined period and under defined conditions. Order, payment, and shipment statuses should be tracked separately, and stock movements should be tied to explicit transition rules.

Which stock concepts should be kept separate?

Physical stock is the quantity in the warehouse, reserved stock is the quantity set aside for a specific transaction, and sellable stock is the quantity that can be offered for sale. In a simple model, sellable stock is calculated by subtracting reservations and a safety buffer from physical stock. Conditions such as pre-orders, damaged goods, and multiple warehouses can extend this model.

As a prerequisite, every sellable variant needs a persistent ID and a known stock source. If the same stock pool is opened to different channels, you must determine which system holds reservation authority. The problem of channels independently selling the same last unit cannot be solved merely by refreshing screens more often.

How do you define the reservation flow?

1. Decide at which step the reservation is created. Adding to cart and starting checkout create different load and user behavior. The choice depends on your business model.

2. Update the available quantity and the reservation atomically. A "read first, write later" approach can create races under concurrent requests. The rule should be protected with mechanisms such as transactions or conditional updates.

3. Add an ID, quantity, linked transaction, status, and expiry time to the reservation. The duration should be set according to the business's payment experience; do not assume a universal number of minutes.

4. Define how the reservation is confirmed when payment succeeds, and how it is released when payment fails or the reservation has expired.

5. Handle the collision between a late payment and an expired reservation. If payment has been received but there is no stock, run a defined exception process instead of automatically starting shipment.

Why should order status not be limited to a single field?

"Order completed" can mean that payment, packing, or delivery is complete. When the commercial status, payment status, and shipment status of an order are kept separate, partial shipments and partial returns are represented more accurately. The simple label shown to the user should not replace the detailed internal statuses.

At what point should stock be returned?

A customer opening a return request does not mean the product is sellable again. After physical receipt and quality control, the eligible quantity can be put back on sale. An order that was cancelled but never shipped and a product coming back from a customer are different stock events. Handling both with the same "return" button can make records ambiguous.

The reason for each stock movement and the linked transaction ID should be kept. That way, besides the final quantity, you can also explain why the quantity changed. Manual corrections should have a justification and an authorization record.

With which examples is the model tested?

Send two concurrent reservations for a variant with a stock of one. In a model that does not allow overselling, only one should succeed. Then try expiry, a repeated payment event, and a repeated cancellation; stock should be reopened only once.

The final check is reconciling the physical count with the system quantity. If there is a difference, its source should be found through the movement history. Stock accuracy is a broader operational job than showing the right number on the sales screen.

PostgreSQL's documentation explains that read and update behavior in concurrent transactions varies by isolation level. You should not assume that a stock rule is protected merely by opening a transaction block; the locking and conditional update behavior of the chosen database must be tested.

Frequently asked questions

It depends on the system's reservation policy. A cart record alone does not mean a stock reservation.

No. Cases such as delays and reservation expiry require additional verification.

It is usually increased after physical receipt and a sellability check; the business rule should be clearly defined.

What is the next step?

Write down your reservation point, stock source, and exception rules; then check the model end to end with PROJX Digital.

Content Owner: Projx Digital
ASK A QUESTION NOW
projx digital