Skip to main content

Update Shipment Line Quantity

PATCH 

//:domain/api/v2/warehouse-transfers/shipments/:shipment/lines/:line

Update a warehouse transfer shipment line's quantity in place, scaling its inventory movements at the source (active negative) and destination (in-transit positive) accordingly.

Request body:

  • quantity (integer, required, >= 0) — new shipment line quantity. Capped by the parent warehouse transfer line quantity.
  • confirmed_implications (boolean, optional) — must be true when the change is non-zero; otherwise the endpoint returns 409 with the preview payload so the caller can confirm.

Behavior:

  • Increase: pulls delta additional units from source on-hand FIFO and places them in-transit toward the destination.
  • Decrease: returns abs(delta) units to source on-hand and removes them from in-transit at the destination.
  • The parent warehouse transfer line quantity is NEVER mutated by this endpoint — it preserves the original transfer intent (BBP invariant).

Errors:

  • 409 Conflict — non-zero delta without confirmed_implications: true; the preview is returned in data so callers can render and confirm.
  • 422 Unprocessable Entity with data.blocks.below_received: true — requested quantity is below the total already received against this line; adjust receipts first.
  • 422 Unprocessable Entity with data.blocks.above_transfer_line: true — requested quantity exceeds the parent warehouse transfer line quantity.
  • 422 Unprocessable Entity from InsufficientStockException thrown by the inventory manager if FIFO consumption cannot satisfy the delta at the moment of save (race / concurrency safety net).

Request

Responses

OK

Response Headers
    Content-Type