Re-attempt allocation for backordered lines, then release
POST/orders/:id/allocation-retries
The RetryAllocation use case. Re-attempts allocation for the order's Backordered lines and ONLY those lines — it is the single sanctioned route from Backordered back to Allocated, and it is what unblocks a ship-complete order held back by BR3. UNLIKE the implicit allocation attempt folded into POST /orders, this is an explicit, on-purpose operator/recovery action: a hard (non-409) failure here fails the call with 503 rather than being swallowed — invoking this endpoint IS asking for allocation right now.
A line still short of stock stays Backordered (no error). The same fail-closed rule as intake's implicit allocation applies to any non-409 failure. An order with no backordered line at all is rejected with 409: retrying an order that is not backordered is a caller mistake, not a no-op.
On success, this ALSO attempts release in the same call — the same allocation-then-release flow POST /orders uses — announced via the enriched OrderAllocated / OrderPartiallyAllocated Kafka events rather than any synchronous call to a Supplier.
Idempotent through the Idempotency-Key header (REST guideline, ADR 0023/0048): a retry with the same key, method, path and body replays the stored answer with Idempotency-Replayed: true and allocates nothing again, so the key row, the order change and the outbox rows commit together. A refusal that depends on the order's state or on a concurrent writer (no-backordered-lines, concurrent-modification) and every 5xx are not stored: the key is released and a retry under the same key executes again.
Request
Responses
- 200
- 400
- 404
- 409
- 500
- 503
The order after the retry-then-release pass.
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.
The Idempotency-Key header is missing (idempotency-key-required) or is not 1-128 printable ASCII characters (idempotency-key-invalid), or the order id in the path is invalid.
No order has this id.
This order has no backordered line to retry (no-backordered-lines), or the write lost an optimistic-concurrency race (concurrent-modification). The same Idempotency-Key reused with a different method, path or body is also a 409 (idempotency-key-reused).
An unexpected internal error occurred.
inventory-storage could not be reached (transport error, timeout, open circuit breaker), answered with an unexpected status, or is wired in permissive (no-op) mode, or reported insufficient usable stock. Problem type is downstream-unavailable for an infrastructure failure, downstream-not-configured for permissive mode and insufficient-stock for the latter. Never papered over with a 2xx: allocating real stock must not appear to succeed when it did not.