Record a scan

POST/v1/scan
Auth: 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

FieldTypeDescription
barcoderequiredstring·
locationstringRack bay for stock stations, e.g. A3
client_scan_idstringSet by offline clients so replays count once

Response

200

FieldTypeDescription
okboolean·
outcomestring·
one of: "ok", "duplicate", "not_found", "not_produced", "already_dispatched", "cancelled", "voided", "location_required", "bad_location", "test"
eventstringFixed by the station token, echoed back
one of: "produce", "stock", "dispatch"
barcodestring·
duplicateboolean·
replaybooleantrue when this outcome came from a replayed client_scan_id
itemobjectThe piece this scan matched, omitted when outcome is not_found or test.
item_idstring·
barcodestring·
order_nostring·
retailerstring·
skustring·
colourstring, nullable·
unitstringe.g. "1/2" (unit 1 of 2)
piecestringe.g. "2/3" (piece 2 of 3 for this unit)
piece_namestring, nullable·
statusstring·
one of: "awaiting_production", "produced", "in_stock", "dispatched", "cancelled", "voided"
locationstring, nullable·
produced_atstring (date-time), nullable·
in_stock_atstring (date-time), nullable·
dispatched_atstring (date-time), nullable·
orderobjectThe order roll up after this scan, omitted when outcome is not_found or test.
order_idstring·
order_nostring·
retailer_idstring·
statusstring·
one of: "awaiting_production", "in_production", "produced", "in_stock", "partially_dispatched", "dispatched", "cancelled"
pieces_totalinteger·
pieces_madeinteger·
pieces_in_stockinteger·
pieces_dispatchedinteger·
loadobjectPresent on a dispatch scan when the station has an open load attached
idstring·
refstring·
messagestring·
replacement_barcodestringPresent when outcome is voided and the label was remade

409

FieldTypeDescription
okboolean·
outcomestring·
one of: "ok", "duplicate", "not_found", "not_produced", "already_dispatched", "cancelled", "voided", "location_required", "bad_location", "test"
eventstringFixed by the station token, echoed back
one of: "produce", "stock", "dispatch"
barcodestring·
duplicateboolean·
replaybooleantrue when this outcome came from a replayed client_scan_id
itemobjectThe piece this scan matched, omitted when outcome is not_found or test.
item_idstring·
barcodestring·
order_nostring·
retailerstring·
skustring·
colourstring, nullable·
unitstringe.g. "1/2" (unit 1 of 2)
piecestringe.g. "2/3" (piece 2 of 3 for this unit)
piece_namestring, nullable·
statusstring·
one of: "awaiting_production", "produced", "in_stock", "dispatched", "cancelled", "voided"
locationstring, nullable·
produced_atstring (date-time), nullable·
in_stock_atstring (date-time), nullable·
dispatched_atstring (date-time), nullable·
orderobjectThe order roll up after this scan, omitted when outcome is not_found or test.
order_idstring·
order_nostring·
retailer_idstring·
statusstring·
one of: "awaiting_production", "in_production", "produced", "in_stock", "partially_dispatched", "dispatched", "cancelled"
pieces_totalinteger·
pieces_madeinteger·
pieces_in_stockinteger·
pieces_dispatchedinteger·
loadobjectPresent on a dispatch scan when the station has an open load attached
idstring·
refstring·
messagestring·
replacement_barcodestringPresent 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"
  }'