Confirm one scan of an each or case GTIN against a PICK task
POST/tasks/:id/scans
The station holding the claim on a PICK task scans a GTIN (ADR 0054). The GTIN is resolved against the local copy of product-master's pack levels (no synchronous call): it must identify the task's SKU and, for a task planned in eaches, an EACH level; for a task planned in cases, a CASE level. count packs are added (default 1) and the answer reports the eaches confirmed so far. Quantities are always in eaches; POST /tasks/{id}/completions and TaskCompleted are unchanged. A rejected scan changes nothing.
Idempotent per Idempotency-Key (ADR-0055). Send a fresh Idempotency-Key for each physical scan and reuse it only when retrying that scan after a lost response. A retry with the same key and the same body on the same path replays the stored answer verbatim (same status and body, including a cached 4xx) and does not count the scan again; two scans with different keys both count. Reusing a key with a different body or on another task is 409 idempotency-key-reused; omitting the header is 400 idempotency-key-required.
Request
Responses
- 200
- 400
- 404
- 409
- 500
The scan is accepted (or, on a retry with a repeated Idempotency-Key and identical body, the original answer replayed without counting the scan again).
Response Headers
Present, with the value true, ONLY when this answer is the stored replay of an earlier request that used the same Idempotency-Key (the handler did not run again). The first execution never carries it.
The Idempotency-Key header is missing (idempotency-key-required), or the request body is malformed JSON, a required field is missing or empty, or a field value is invalid (invalid-request).
No task exists with this id.
The scan does not fit the task or its claim: the task has no active claim or another station owns it, unknown-gtin (no pack level carries the code), invalid-scanned-gtin (a bad check digit or a variable-measure indicator), scan-sku-mismatch (the GTIN of another SKU, for example the each barcode printed on a case of something else), scan-level-mismatch (a case scan on an each pick or the reverse), no-pick-plan or pick-over-quantity. The same Idempotency-Key reused with a different method, path or body is also a 409, problem type idempotency-key-reused.
An unexpected server-side failure (e.g. a repository or event-publisher error).