Skip to main content

Receive by scan

POST 

/receipts/:receiptId/scans

Receives goods from ONE scan. Give EITHER scan (the raw string the scanner delivered; GS1-128 element strings and ]E0/]I1/]C1 symbology prefixes are parsed server-side) OR kind and id (a client that already parsed it; the service re-validates). The scan resolves to SSCC (the carton's whole manifest is accepted), CASE_GTIN (qty counts CASES, default 1; the service multiplies by the active CASE units per pack) or EACH_GTIN (qty eaches, default 1). Every quantity booked, and every event, is in eaches. kind (or expectedKind with a raw scan) is the kind the screen expects: a scan of another kind is 422 scan-kind-mismatch and changes nothing.

A raw scan is also validated as a GS1 logistic label (ADR 0024): a label that breaks the GS1 rules (a bad check digit, AI 01 with AI 02, a missing mandatory AI, ...) is refused with the finding LabelNonCompliant (expected = the reason code, actual = the raw scan, supplierRef = the ASN's supplier); with RECEIVING_SITE_GLNS set, a label whose ship-to GLN (AI 410) is not one of the sites is refused with WrongDestination. Both are findings, not errors, and nothing is booked. A label that says no ship-to is never refused for it. The dates the label carries (AI 15, 17, 11, 13) are kept on the carton.

A scan that cannot be accepted because of a finding (an SSCC not on the manifest or already received, an unknown GTIN, a quantity that contradicts the pack) is NOT an error: it books nothing, raises the finding as CartonDiscrepancyRaised and answers 200 with accepted=false; an accepted scan answers 201. Carton discrepancies are never added to ReceiptClosed, whose three v1 kinds stay Short, Over and Damaged. This is NOT naturally idempotent, so the Idempotency-Key is required.

Request​

Responses​

The scan was refused with findings; nothing was booked.

Response Headers
    Idempotency-Replayed

    Present, with the value true, only when this response is the replay of a stored answer for the same Idempotency-Key.

    ETag

    Strong entity tag of the resource: the quoted version, for example "3".