Skip to main content

Pull Stock To Line

POST 

/api/v2/inventory-allocations/pull-stock

Pulls soft on-hand stock from one or more donor sales order lines onto a backordered line, atomically. Each donor's soft allocation is backordered by the pulled quantity and the freed on-hand is allocated to the destination line — a conserved swap that preserves total demand and FIFO cost layering across every affected order. All pulls succeed or roll back together.

Body:

  • destination_sales_order_line_id (required, integer) — the backordered line that receives the stock.
  • pulls (required, array, min 1) — the donors to pull from.
  • pulls[].sales_order_line_id (required, integer) — a donor sales order line holding soft allocations of the same product + warehouse. Get valid donors from GET /pull-stock-donors.
  • pulls[].quantity (required, numeric, > 0) — how much soft on-hand to pull from that donor.

Returns 422 when a donor no longer holds enough soft-allocated stock, a donor is the same line as the destination, or the destination has no matching backorder to receive the pull.

On success returns the total pulled_quantity and the refreshed donor list.

Request

Responses

OK

Response Headers
    Content-Type