Skip to main content

Stock reservations API (0.1.0)

Download OpenAPI specification:Download

Places the stock holds an order needs: a reservation against current ATP, and a future allocation for a pre-order item, which has no current stock to reserve.

Both operations are idempotent per sales order item. An item that already holds a reservation or a future allocation keeps the one it has and is reported as placed, so a caller retrying after a timeout cannot double-place a hold.

Neither operation falls back to the other. An item reported as not placed holds no stock, and the caller decides what that means for the order.

future-allocations

Holds placed against future stock for a sales order's pre-order items.

Allocate a sales order's pre-order items against future stock

Allocates the given items of one sales order against future inventory, for items sold before the product is in stock.

With preferred_fulfillment_node_id, allocates as much as that node's future availability covers and places the remaining items at other nodes. Without it, works through the nodes with the highest future availability first. An item that no node can cover comes back in unallocated_item_ids, and the response is still a 200.

Items already holding a future allocation keep it and are returned in allocated_items.

Request Body schema: application/json

The sales order and the items to allocate against future inventory.

sales_order_uuid
required
string [ 1 .. 256 ] characters

The uuid of the sales order the items belong to.

preferred_fulfillment_node_id
string <= 256 characters

The fulfillment node to allocate at. Items it cannot cover are allocated elsewhere. When omitted stock picks the node with the highest future availability.

required
Array of objects [ 1 .. 2000 ] items

Responses

Request samples

Content type
application/json
{
  • "sales_order_uuid": "8e3ba7ef-b3d3-4c40-a05a-9a83f6f6b6a4",
  • "preferred_fulfillment_node_id": "US01",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "allocated_items": [
    ],
  • "unallocated_item_ids": [ ]
}

reservations

Holds placed against current stock for a sales order's items.

Reserve current stock for a sales order

Reserves current stock for the given items of one sales order, holding it until the reservation expires.

Reserves as much as it can: an item with no current stock at its fulfillment node comes back in non_reserved_item_ids and the response is still a 200, because a partly reserved order is a normal outcome rather than a failure. Items already holding a reservation are returned in reserved_items without being reserved again.

Request Body schema: application/json

The sales order and the items to reserve stock for.

sales_order_uuid
required
string [ 1 .. 256 ] characters

The uuid of the sales order the items belong to.

required
Array of objects [ 1 .. 2000 ] items

Responses

Request samples

Content type
application/json
{
  • "sales_order_uuid": "8e3ba7ef-b3d3-4c40-a05a-9a83f6f6b6a4",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "reserved_items": [
    ],
  • "non_reserved_item_ids": [
    ]
}