Skip to main content

Update Retention Sample Submission

PATCH 

/api/v2/fifo-layers/:fifoLayer/retention-samples/:sample/submissions/:submission

Edit a trip. Send only the fields that change — for example {"returned_at": "2026-11-20"} to mark a trip back.

Required scope: inventory:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Fields: destination_type (lab, amazon, third_party, other), recipient (required, max 255), sent_at (required, YYYY-MM-DD), tracking_number (max 120), quantity (units sent, optional), return_expected (boolean, default true), returned_at (YYYY-MM-DD), result (pending, passed, failed, no_result; default pending), result_document_id (a document already filed on the sample's lot), notes (max 2000).

Status. The sample's status is re-derived on every trip change: any open trip (expected back, no returned_at) makes it sent_to_lab ("Sent out"); with no open trip and at least one returnable trip back it becomes returned, and any stock it holds stays on hold. A released sample stays released until a new open trip. A one-way trip (return_expected: false) does not change the status. A discarded sample is never changed. The response returns both the trip and the re-derived sample.

Refused with 422: a trip on a discarded sample ("This sample was discarded."); sent_at before the sample's retained_at (or received_at for manufacturer samples); returned_at before sent_at; a result_document_id not linked to the sample's lot; an archived lot.

Returns 404 when the trip does not belong to the sample, or the sample to the lot.

Requires permission: inventory.manage_quality

Request​

Responses​

OK

Response Headers
    Content-Type