Skip to main content

Stage a destination transfer receipt (count an arrival)

POST 

/transfers/:transferLineId/receipt

A destination site counted received goods against a transfer line (ADR 0031). The transfer_line_id is looked up in the transfer_allocations ledger: a recognized ALLOCATED line answers 201 with a STAGED transfer receipt (expected_quantity from the ledger, received_quantity as counted, variance = received - expected, SIGNED: positive is over, negative is short) and publishes TransferReceiptStaged through the transactional outbox. NO usable stock moves at this step.

An UNRECOGNIZED scan — no ledger row for the line (this service never allocated it), a row that was REJECTED, a transfer_id mismatch, or a destination equal to the transfer's own origin site — is QUARANTINED: an inventory_exceptions row is written (kind UNKNOWN_TRANSFER or UNRECOGNIZED_TRANSFER), nothing that could raise usable stock is published, and the 422 problem body carries the exception's coordinates in its exception extension member so an operator can resolve it.

Idempotent on transfer_line_id at the database level: an identical replay answers 200 with the ORIGINAL receipt (replay: true) and republishes nothing; the same line id with a DIFFERENT payload is a 409 transfer-receipt-conflict (the original receipt is immutable).

Request​

Responses​

Idempotent replay: this exact scan was already staged; the ORIGINAL receipt is returned (replay: true) and nothing was republished.

Response Headers
    Idempotency-Replayed

    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.