Stock reservations
The stock reservation object and the allowed CRUD operations on the related resource endpoint
Stock reservations are used to reserve the stock associated with an order's line items of type
skus
or bundles
until the order is approved.You can temporarily reserve the stock associated with a line item before the order placement by sending a specific trigger attribute when adding the line item to the order. This way the necessary stock reservations are created in
draft
status, with an expiration date of 1 hour (you can change the default value at the inventory model level). If the order isn't placed before the expiration date or the line item is removed, the corresponding reserved stock is released and any associated active stock reservation is deleted.Stock reservations act on the whole line item quantity. If the available stock is split between different stock locations, multiple stock reservations are created.
When the order is placed any existing active stock reservation associated with its line items is moved from
draft
to pending
. If no draft stock reservation is associated with the order's line items, the stock reservations needed to block the whole order's stock are automatically created in pending
status and the associated stock is reserved without decrementing the stock item quantities. Once the order is approved, the stock item quantities are decremented. If the order is cancelled before approval, the reserved stock is released becoming available again. In both cases, the involved stock reservations are deleted.Only draft stock reservations have an expiration date before order placement. Once the order is placed the stock is reserved until the order is approved or cancelled.
Check the related ER diagram and explore the flowchart that illustrates how the stock reservation resource relates to the other API entities.
This is an immutable API, meaning that create, update, and delete operations are not allowed on this endpoint. You can only fetch a list of stock reservations or a specific single one.
Last modified 5d ago