Move stock of one SKU between two bins of the same site
POST/relocations
Records an intra-site relocation (ADR 0039; slotting-optimization ADR 0010): quantity units of sku leave fromBin and arrive in toBin, both bins of siteCode. Only the usable (unreserved) quantity of the SKU in fromBin can move. Both bins' occupancy, every touched StockUnit, a new StockUnit in toBin, the relocation record and the StockRelocated event (transactional outbox) commit in one transaction; a concurrent change to either bin or a touched unit is a 409 concurrent-modification and nothing moves.
Behind the Idempotency-Key middleware like the other creating POSTs (ADR 0018): a replay with the same key and body returns the original 201 without moving stock again; the same key with a different body is 409 idempotency-key-reused.
Request
Responses
- 201
- 400
- 404
- 409
- 422
- 500
The stock moved; the body is the relocation record.
Response Headers
Present, with the value true, ONLY when this response is a replay of the stored answer for the request's Idempotency-Key (the handler did not run again). The first execution of a key never carries it, and neither does a retry of a refusal that was not stored (ADR 0053: concurrent-modification and every refusal that depends on state that can change): that retry executes again.
/relocations/{id} of the new relocation.
Malformed JSON body, an empty siteCode, sku, fromBin or toBin, or the Idempotency-Key header absent (ADR 0018).
fromBin or toBin is not a registered bin.
A bin is not in siteCode (bin-not-at-site), the usable quantity of the SKU in fromBin is below quantity (insufficient-usable), toBin has no room (bin-full), or a concurrent writer changed a bin or a touched unit (concurrent-modification), or the bin is an AutomatedStorage location, which holds container stock only (automated-storage-requires-container, ADR 0054). The same Idempotency-Key reused with a different method, path or body is also a 409 (idempotency-key-reused).
fromBin equals toBin (same-bin), quantity is not positive (zero-quantity), reason is not SLOTTING, CONSOLIDATION or MANUAL (invalid-relocation-reason), sourceRef is longer than 200 characters (source-ref-too-long).
An unexpected internal error occurred.