Skip to main content

Cancel a transfer — synchronously pre-release, through RELEASING once allocated.

POST 

/v1/transfers/:transferId/cancellation

The operator cancel of the transfer saga (ADR 0022). Pre-release states (DRAFT/PROPOSED/APPROVED/ALLOCATING) cancel synchronously: 200 with state CANCELLED, no hold exists. ALLOCATED answers 202 with state RELEASING: the saga outboxes TransferAllocationReleaseRequested in the same transaction and inventory-storage resolves the origin reservation; its TransferStockAllocationReleased fact (outcome RELEASED or ALREADY_RESOLVED — both settle) completes the cancel to CANCELLED. A retried cancel is idempotent on the saga state: RELEASING answers 202 again, CANCELLED answers 200 again. PICKED onwards and UNFULFILLABLE refuse with 409 cancel-refused — the stock is physically in motion or the saga already closed. An unknown transfer is 404; a missing reason is 422 invalid-cancel. A body with an unknown field or malformed JSON is 400 invalid-request. Idempotent per the required Idempotency-Key header like every keyed write: same key and same request replays the stored answer (Idempotency-Replayed: true) when that answer is final for the request, a different request under the same stored key is 409 idempotency-key-reused. A stored answer is kept for 24 hours: past that window the key is free again (the same request executes once more, a different one is a NEW request). Replay classes (ADR 0024): a FINAL refusal (invalid-cancel, cancel-refused) is stored and replayed; a RETRYABLE refusal (transfer-not-found — the transfer arrives by another request) is not stored, the key is released and a retry executes; a 5xx is never stored.

Request​

Responses​

Cancelled synchronously (a pre-release state, or a replay of an already-settled cancel).

Response Headers
    Idempotency-Replayed

    Present, with the value true, only when the answer is a replay of an earlier request with the same Idempotency-Key.