Decide what happens to a held unit
POST/held-stock/:id/dispositions
The disposition decision (ADR 0052). RELEASE returns the quantity to usable stock through the same staged-receipt seam as a fresh receipt (it is usable once stowed) and emits StockReleased; RETURN_TO_VENDOR and SCRAP remove the unit; REWORK keeps it HELD under a new reason (default OTHER). Every decision emits StockDispositioned. The decision, the unit's save and the events are one transaction. A unit that already has a final disposition is 409 held-unit-closed.
Behind the Idempotency-Key middleware like the other creating POSTs (ADR 0018).
Request
Responses
- 200
- 400
- 404
- 409
- 422
- 500
The unit after the decision (REMOVED, or still HELD for REWORK).
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.
Malformed body, or the Idempotency-Key header absent.
No held unit has this id.
The unit already has a final disposition (held-unit-closed), or a concurrent writer changed it (concurrent-modification). The same Idempotency-Key reused with a different method, path or body is also a 409 (idempotency-key-reused).
The disposition is not one of the four (invalid-disposition), or the REWORK reason is not a hold reason (invalid-hold-reason).
An unexpected internal error occurred.