Complete a task on behalf of the station that claimed it
POST/tasks/:id/completions
Finishes the task's lifecycle (Claimed -> Completed) and publishes TaskCompleted. Only the owning station's claim may complete it, and a completed task can never be completed again — this endpoint enforces the no-double-complete invariant, returning 409 on a repeat call rather than silently succeeding twice. A RELOCATE task (a slot-plan move, ADR-0047) completes only with the operator's confirmation: quantity (counted, at least 1) and the bins the move left open — fromBin for an Assign, toBin for a Vacate (see the task's relocation). A scan of a side the plan fixed must equal the planned bin. The confirmed move is published on TaskCompleted (sku, from_bin, to_bin, quantity, relocation_ref). A REPLENISH task (a pick-face replenishment, ADR-0050) completes only with quantity (counted, at least 1); fromBin and toBin are optional scans that must equal the task's planned replenishment bins. The confirmed move is published on TaskCompleted (sku, from_bin, to_bin, quantity, request_ref). Any other task type takes none of these fields.
Request
Responses
- 204
- 400
- 404
- 409
- 422
- 500
Task completed. No response body.
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 not 1-128 printable ASCII characters (idempotency-key-invalid) on a POST, or the request body could not be read or contains a NUL character (malformed-request-body), or the request body is malformed JSON, a required field is missing or empty, or a field value is invalid (e.g. a task type outside the TaskType enum).
No task exists with this id.
The task was already completed (double-complete, rejected), has no active claim, or stationId does not own the active claim. Also pick-incomplete (a PICK task whose confirmed scans do not add up to the planned eaches) and case-break-completion-required (a BREAK_CASE task, which completes only through POST /tasks/{id}/case-breaks). The same Idempotency-Key reused with a different method, path or body is also a 409, problem type idempotency-key-reused.
The RELOCATE confirmation is missing or does not fit the planned move (ADR-0047): relocation-confirmation-required (a RELOCATE task completed without quantity and the open bins), invalid-relocation-confirmation (an open side not scanned, a scan that differs from the planned bin, or equal bins), or not-relocation-task (quantity/fromBin/toBin sent for a task that is neither RELOCATE nor REPLENISH). The REPLENISH confirmation (ADR-0050) is replenishment-confirmation-required (a REPLENISH task completed without quantity) or invalid-replenishment-confirmation (a quantity below 1, or a scan that differs from the planned bin). The task stays Claimed.
An unexpected server-side failure (e.g. a repository or event-publisher error).