Stock checks

Called with warehouse account keys. A key only sees its own account's data. Every example uses the same sample brand, order and item, so you can follow one item from call to call.

Base URL http://62.169.23.239:8001/api/v1Auth Bearer token4 endpoints

Start a stock check#

POST/warehouse/stock-checks

Requires scope warehouse_stock:write

Open a scan-to-verify audit against everything currently held.

Request body

  • notesstring | null

Returns

HTTP 201
  • check_idstringRequired
  • statusstringRequired

    Current state of the object. See the allowed values.

    One ofopencompletedcancelled
  • expected_countinteger

    Defaults to 0

  • scanned_countinteger

    Defaults to 0

  • matched_countinteger

    Defaults to 0

  • unexpected_countinteger

    Defaults to 0

  • coverage_pctinteger

    Defaults to 0

  • missingarray of objects
    +Show 7 child attributes
    • refstringRequired
    • ref_kindstringRequired
      One ofboxunit
    • product_namestring

      Defaults to —

    • brand_namestring

      Defaults to —

    • colorstring | null

      Colour name, exactly as on the product's variants.

    • sizestring | null

      Size name, exactly as on the product's variants.

    • locationstring | null

      Where to find it, e.g. "Aisle 4, Bay B" — None when not recorded.

  • unexpectedarray of strings
  • notesstring | null
  • started_attimestamp | null
  • completed_attimestamp | null
POST /warehouse/stock-checks
curl
curl -X POST http://62.169.23.239:8001/api/v1/warehouse/stock-checks \
  -H "Authorization: Bearer $SKANNIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "notes": "Received at dock 3"
  }'
201Response
json
{
  "check_id": "7fe88e63-8269-5209-a216-5aa043212aa9",
  "status": "open",
  "expected_count": 24,
  "scanned_count": 24,
  "matched_count": 24,
  "unexpected_count": 24,
  "coverage_pct": 72,
  "missing": [
    {
      "ref": "BOX-F4E1A9-0003",
      "ref_kind": "box",
      "product_name": "Trail Tee",
      "brand_name": "Northwind Apparel",
      "color": "White",
      "size": "M",
      "location": "Aisle 4, Bay B"
    }
  ],
  "unexpected": [
    "Qx9…"
  ],
  "notes": "Received at dock 3",
  "started_at": null,
  "completed_at": null
}

Record a stock-check scan#

POST/warehouse/stock-checks/{check_id}/scan

Requires scope warehouse_stock:write

Record one scanned box or unit. The server works out which it is.

Parameters

  • check_idstringpathRequired

Request body

  • scanned_refstringRequired

Returns

HTTP 200
  • scanned_refstringRequired
  • ref_kindstringRequired
    One ofboxunit
  • matchedbooleanRequired

    True when the scanned item was accepted. False is a normal answer (wrong item, already sold) — scan another.

  • detailstring

    False + matched=False means the item is not in this holder's stock at all — a genuine finding, not an error.

    Defaults to

  • scanned_countinteger

    Defaults to 0

  • expected_countinteger

    Defaults to 0

POST /warehouse/stock-checks/{check_id}/scan
curl
curl -X POST http://62.169.23.239:8001/api/v1/warehouse/stock-checks/7fe88e63-8269-5209-a216-5aa043212aa9/scan \
  -H "Authorization: Bearer $SKANNIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "scanned_ref": "Qm7xK2pL9vR4tY8wZ1nB3c"
  }'
200Response
json
{
  "scanned_ref": "Qm7xK2pL9vR4tY8wZ1nB3c",
  "ref_kind": "box",
  "matched": true,
  "detail": "",
  "scanned_count": 24,
  "expected_count": 24
}

Complete a stock check#

POST/warehouse/stock-checks/{check_id}/complete

Requires scope warehouse_stock:write

Close the audit and return the final reconciliation.

Parameters

  • check_idstringpathRequired

Returns

HTTP 200
  • check_idstringRequired
  • statusstringRequired

    Current state of the object. See the allowed values.

    One ofopencompletedcancelled
  • expected_countinteger

    Defaults to 0

  • scanned_countinteger

    Defaults to 0

  • matched_countinteger

    Defaults to 0

  • unexpected_countinteger

    Defaults to 0

  • coverage_pctinteger

    Defaults to 0

  • missingarray of objects
    +Show 7 child attributes
    • refstringRequired
    • ref_kindstringRequired
      One ofboxunit
    • product_namestring

      Defaults to —

    • brand_namestring

      Defaults to —

    • colorstring | null

      Colour name, exactly as on the product's variants.

    • sizestring | null

      Size name, exactly as on the product's variants.

    • locationstring | null

      Where to find it, e.g. "Aisle 4, Bay B" — None when not recorded.

  • unexpectedarray of strings
  • notesstring | null
  • started_attimestamp | null
  • completed_attimestamp | null
POST /warehouse/stock-checks/{check_id}/complete
curl
curl -X POST http://62.169.23.239:8001/api/v1/warehouse/stock-checks/7fe88e63-8269-5209-a216-5aa043212aa9/complete \
  -H "Authorization: Bearer $SKANNIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
200Response
json
{
  "check_id": "7fe88e63-8269-5209-a216-5aa043212aa9",
  "status": "open",
  "expected_count": 24,
  "scanned_count": 24,
  "matched_count": 24,
  "unexpected_count": 24,
  "coverage_pct": 72,
  "missing": [
    {
      "ref": "BOX-F4E1A9-0003",
      "ref_kind": "box",
      "product_name": "Trail Tee",
      "brand_name": "Northwind Apparel",
      "color": "White",
      "size": "M",
      "location": "Aisle 4, Bay B"
    }
  ],
  "unexpected": [
    "Qx9…"
  ],
  "notes": "Received at dock 3",
  "started_at": null,
  "completed_at": null
}

Retrieve a stock check#

GET/warehouse/stock-checks/{check_id}

Requires scope warehouse_stock:read

Coverage so far, plus what is missing and what turned up unexpectedly.

Parameters

  • check_idstringpathRequired

Returns

HTTP 200
  • check_idstringRequired
  • statusstringRequired

    Current state of the object. See the allowed values.

    One ofopencompletedcancelled
  • expected_countinteger

    Defaults to 0

  • scanned_countinteger

    Defaults to 0

  • matched_countinteger

    Defaults to 0

  • unexpected_countinteger

    Defaults to 0

  • coverage_pctinteger

    Defaults to 0

  • missingarray of objects
    +Show 7 child attributes
    • refstringRequired
    • ref_kindstringRequired
      One ofboxunit
    • product_namestring

      Defaults to —

    • brand_namestring

      Defaults to —

    • colorstring | null

      Colour name, exactly as on the product's variants.

    • sizestring | null

      Size name, exactly as on the product's variants.

    • locationstring | null

      Where to find it, e.g. "Aisle 4, Bay B" — None when not recorded.

  • unexpectedarray of strings
  • notesstring | null
  • started_attimestamp | null
  • completed_attimestamp | null
GET /warehouse/stock-checks/{check_id}
curl
curl http://62.169.23.239:8001/api/v1/warehouse/stock-checks/7fe88e63-8269-5209-a216-5aa043212aa9 \
  -H "Authorization: Bearer $SKANNIT_TOKEN"
200Response
json
{
  "check_id": "7fe88e63-8269-5209-a216-5aa043212aa9",
  "status": "open",
  "expected_count": 24,
  "scanned_count": 24,
  "matched_count": 24,
  "unexpected_count": 24,
  "coverage_pct": 72,
  "missing": [
    {
      "ref": "BOX-F4E1A9-0003",
      "ref_kind": "box",
      "product_name": "Trail Tee",
      "brand_name": "Northwind Apparel",
      "color": "White",
      "size": "M",
      "location": "Aisle 4, Bay B"
    }
  ],
  "unexpected": [
    "Qx9…"
  ],
  "notes": "Received at dock 3",
  "started_at": null,
  "completed_at": null
}
NextRetailer orders→