A headlight is listed on two channels and ordered on one. Hours pass before it is packed. If it is ordered again on the second channel in the meantime, one buyer has to be turned down — and that costs more than just this sale.
The reservation binds a concrete stocked piece to an order line. It ends consumed when the goods leave the building, or released when the sale does not happen; state also knows the value expired. Both take quantities and appear as entries in the ledger.
| Surface | Roles |
|---|---|
| Commerce | Parts trading, Vehicle recyclers |
What this case requires
- An order with lines. The reservation requires
salesOrderIdandorderLineId; a reservation without an order is not provided for. - A stocked piece instead of an item number. What is reserved is a concrete specimen with a
stockItemId. - The current revision. Every change to the reservation carries
expectedRevision. - A channel that supports reservations. The capabilities state it per channel.
The sequence
The table names the responsible call per stage and what exists afterwards. The reasoning for why a stage cannot be skipped follows below it.
| Stage | Call | What exists afterwards |
|---|---|---|
| Reserve | POST /commerce/v1/inventory/reservations | stockItemId, salesOrderId and orderLineId, optionally expiresAt |
| Check the state | GET /commerce/v1/inventory/reservations/{reservationId} | reservedQuantity, releasedQuantity and consumedQuantity |
| Consume | POST /commerce/v1/inventory/reservations/{reservationId}/consume | reasonCode fulfilled when the goods leave the building |
| Release | POST /commerce/v1/inventory/reservations/{reservationId}/release | reasonCode order_cancelled or expired when the sale does not happen |
| Read the ledger | GET /commerce/v1/inventory/ledger | reservation, consumption and release as traceable entries |
Why each stage is needed
- Reserve.
POST /commerce/v1/inventory/reservationstakesstockItemId,quantity,salesOrderId,orderLineId,expectedRevisionand optionallyexpiresAt. From now on the piece is bound to this line; according to the contract,availableQuantityin the stock is derived taking active reservations into account. - Check the state.
GET /commerce/v1/inventory/reservations/{reservationId}namesinitialQuantity,reservedQuantity,releasedQuantity,consumedQuantityandstate. With several pieces this shows how much is still bound. - Consume.
POST /commerce/v1/inventory/reservations/{reservationId}/consumetakesquantity,reasonCode— on shipmentfulfilled— andexpectedRevision. Consumption happens when the goods leave the building, not when the order comes in. - Release.
POST /commerce/v1/inventory/reservations/{reservationId}/releasereturns quantities, for example withorder_cancelled,order_changed,expiredormanual_review. A reservation that is never released blocks a sellable part without a buyer. - Read the ledger.
GET /commerce/v1/inventory/ledgerrecords reservation, consumption and release as entries withreservationId,quantityDeltaandbalance. Every movement of a unique piece can thus be explained later.
curl -X POST \
-H 'X-Api-Key: <API_KEY>' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: reservierung-4711-versand' \
-d '{"quantity":1,"reasonCode":"fulfilled","expectedRevision":"<revision>"}' \
'https://commerce-preview.invalid/commerce/v1/inventory/reservations/<reservationId>/consume'What you end up with
In the end reservedQuantity, releasedQuantity and consumedQuantity show which quantity is still bound, released or consumed, and state names the state of the reservation. Whether a second buyer could still order the part in the meantime depends on how promptly the offer on the second channel was updated.
Where to find this in the documentation
The binding field lists, error codes and sample responses live in this surface’s OpenAPI contract at docs.tapinomahub.com (tapinoma-commerce). All use cases arranged by surface and role: overview of the use cases.
Sources and legal references
Frequently asked
Can I reserve without an order?
No. The reservation requires salesOrderId and orderLineId; it binds a piece to a concrete order line.
When do I consume the reservation?
When the goods leave the building, with reasonCode fulfilled. The incoming order alone is not yet consumption.
Can I release a reservation partially?
Yes. Consumption and release take quantities; the state shows how much is reserved, released and consumed.
