Record a scan
POST
/v1/scanAuth: Scan station token
The event is fixed by the station, never by the request.
Auth is a station token (st_...), which is locked to one event (produce, stock or dispatch): the request cannot choose it. Returns 200 with ok:true (outcome ok or duplicate) or 409 with ok:false and an outcome explaining why the scan was refused: not_found (barcode does not match a label), not_produced (stock/dispatch scanned before produce), already_dispatched, cancelled, voided (see replacement_barcode), location_required / bad_location (stock scans need a valid rack bay from location or the station's default), or test for the printed hardware test label, which never touches an order. Set client_scan_id from an offline client so a queued replay is only ever counted once.
Request body
| Field | Type | Description |
|---|---|---|
barcoderequired | string | · |
location | string | Rack bay for stock stations, e.g. A3 |
client_scan_id | string | Set by offline clients so replays count once |
Response
200
| Field | Type | Description |
|---|---|---|
ok | boolean | · |
outcome | string | · one of: "ok", "duplicate", "not_found", "not_produced", "already_dispatched", "cancelled", "voided", "location_required", "bad_location", "test" |
event | string | Fixed by the station token, echoed back one of: "produce", "stock", "dispatch" |
barcode | string | · |
duplicate | boolean | · |
replay | boolean | true when this outcome came from a replayed client_scan_id |
item | object | The piece this scan matched, omitted when outcome is not_found or test. |
item_id | string | · |
barcode | string | · |
order_no | string | · |
retailer | string | · |
sku | string | · |
colour | string, nullable | · |
unit | string | e.g. "1/2" (unit 1 of 2) |
piece | string | e.g. "2/3" (piece 2 of 3 for this unit) |
piece_name | string, nullable | · |
status | string | · one of: "awaiting_production", "produced", "in_stock", "dispatched", "cancelled", "voided" |
location | string, nullable | · |
produced_at | string (date-time), nullable | · |
in_stock_at | string (date-time), nullable | · |
dispatched_at | string (date-time), nullable | · |
order | object | The order roll up after this scan, omitted when outcome is not_found or test. |
order_id | string | · |
order_no | string | · |
retailer_id | string | · |
status | string | · one of: "awaiting_production", "in_production", "produced", "in_stock", "partially_dispatched", "dispatched", "cancelled" |
pieces_total | integer | · |
pieces_made | integer | · |
pieces_in_stock | integer | · |
pieces_dispatched | integer | · |
load | object | Present on a dispatch scan when the station has an open load attached |
id | string | · |
ref | string | · |
message | string | · |
replacement_barcode | string | Present when outcome is voided and the label was remade |
409
| Field | Type | Description |
|---|---|---|
ok | boolean | · |
outcome | string | · one of: "ok", "duplicate", "not_found", "not_produced", "already_dispatched", "cancelled", "voided", "location_required", "bad_location", "test" |
event | string | Fixed by the station token, echoed back one of: "produce", "stock", "dispatch" |
barcode | string | · |
duplicate | boolean | · |
replay | boolean | true when this outcome came from a replayed client_scan_id |
item | object | The piece this scan matched, omitted when outcome is not_found or test. |
item_id | string | · |
barcode | string | · |
order_no | string | · |
retailer | string | · |
sku | string | · |
colour | string, nullable | · |
unit | string | e.g. "1/2" (unit 1 of 2) |
piece | string | e.g. "2/3" (piece 2 of 3 for this unit) |
piece_name | string, nullable | · |
status | string | · one of: "awaiting_production", "produced", "in_stock", "dispatched", "cancelled", "voided" |
location | string, nullable | · |
produced_at | string (date-time), nullable | · |
in_stock_at | string (date-time), nullable | · |
dispatched_at | string (date-time), nullable | · |
order | object | The order roll up after this scan, omitted when outcome is not_found or test. |
order_id | string | · |
order_no | string | · |
retailer_id | string | · |
status | string | · one of: "awaiting_production", "in_production", "produced", "in_stock", "partially_dispatched", "dispatched", "cancelled" |
pieces_total | integer | · |
pieces_made | integer | · |
pieces_in_stock | integer | · |
pieces_dispatched | integer | · |
load | object | Present on a dispatch scan when the station has an open load attached |
id | string | · |
ref | string | · |
message | string | · |
replacement_barcode | string | Present when outcome is voided and the label was remade |
Code samples
curl -X POST "https://api.skuflo.io/v1/scan" \
-H "Authorization: Bearer st_live_..." \
-H "Content-Type: application/json" \
-d '{
"barcode": "OAK 7F3K9QZ2",
"location": "A3",
"client_scan_id": "phone-c8f1-1"
}'