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
- 200
- 201
- 400
- 404
- 409
- 412
- 422
- 500
The scan was refused with findings; nothing was booked.
Response Headers
Present, with the value true, only when this response is the replay of a stored answer for the same Idempotency-Key.
Strong entity tag of the resource: the quoted version, for example "3".
The scan was accepted.
Response Headers
Present, with the value true, only when this response is the replay of a stored answer for the same Idempotency-Key.
Strong entity tag of the resource: the quoted version, for example "3".
Malformed JSON or an unknown field (malformed-request), a bad query
parameter (invalid-query, invalid-limit, invalid-cursor,
unknown-query-parameter), a missing or malformed Idempotency-Key
(idempotency-key-required, idempotency-key-invalid), or a value that breaks a domain rule
(the invalid-*, *-requires-*, duplicate-* and
invalid-condition, invalid-carton*, invalid-scan*, invalid-counted-contents, invalid-cases,
invalid-gtin, invalid-sscc and invalid-owner-ref slugs), a reason code outside the list
(invalid-override-reason) or a tolerance band that breaks 0 <= tolerance < hardStop <= 1
(invalid-tolerance-band).
The resource in the path does not exist: asn-not-found,
appointment-not-found, receipt-not-found, carton-not-found or
receiving-policy-not-found (no policy declared for the exact owner and supplier).
The request conflicts with current state: asn-already-exists,
asn-in-progress, asn-terminal, asn-not-receivable,
appointment-cancelled, receipt-already-open, receipt-closed, sscc-prefix-not-configured and
sscc-serial-exhausted (receiver-assigned SSCCs, ADR 0024), tolerance-override-required
(a line sits between the declared band and its hard stop and no valid override reason was given) and
tolerance-blocked (a line is at or beyond the hard stop: no override passes, the receipt stays
open; ADR 0026), a write that lost a race
(concurrent-modification), or an Idempotency-Key already used with
a different request (idempotency-key-reused).
The If-Match value does not match the resource's current version; re-fetch and retry.
The request is well-formed but refers to something that does not hold:
unknown-sku, unknown-dock-door,
unknown-asn, unknown-appointment,
asn-not-on-appointment, line-not-on-asn, invalid-sscc,
duplicate-sscc, homogeneous-carton-mixed, carton-contents-mismatch,
scan-kind-mismatch, unsupported-pack-level,
counted-contents-not-mixed, counted-sku-unknown or unknown-gtin.
Unexpected server error.