Overview / Stock & supply / Update a stock count

Update a stock count

patch https://api.flactrum.com/v1/stock-counts/{count}

Sending items replaces every line. An applied count can no longer be changed.

Required scope stock_counts.write
Success status200
Returns One StockCount object

Parameters

NameInTypeDescription
count * path string ULID of the record.

Request body

FieldTypeDescription
branch_id * string —
code string|null Generated when omitted.
status string —
note string|null —
started_at string|null Count date. Defaults to today.
items array Sending this replaces every line. Each entry is {stock_item_id, counted_quantity?, theoretical_quantity?, waste_quantity?, reason?}. difference is derived, never sent.

Response fields

FieldTypeDescription
id string —
code string —
branch_id string —
status string —
started_at string|null —
completed_at string|null —
items array theoretical_quantity, counted_quantity, difference, waste_quantity, reason.

Examples

Recorded from the test suite — these are real requests and their real responses.

curl -X PATCH 'https://api.flactrum.com/v1/stock-counts/01m43mzkdkbkwyhs2hr4p08xv1' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "items": [
        {
            "stock_item_id": "01m43mzkd0x463k38957kyyf2t",
            "theoretical_quantity": 1000,
            "counted_quantity": 960,
            "reason": "Fire"
        }
    ]
}'

HTTP 200 · application/json

{
    "data": {
        "id": "01m43mzkdkbkwyhs2hr4p08xv1",
        "code": "SAY-261004-YNXQ",
        "branch_id": "01m43mzkcqydk36n7dykxw4f5d",
        "status": "in_progress",
        "note": null,
        "started_at": "2026-10-04T14:27:12+00:00",
        "completed_at": null,
        "item_count": 1,
        "items": [
            {
                "id": "01m43mzkeqrf5ars9p7hj896f6",
                "stock_item_id": "01m43mzkd0x463k38957kyyf2t",
                "theoretical_quantity": 1000,
                "counted_quantity": 960,
                "difference": -40,
                "waste_quantity": 0,
                "reason": "Fire"
            }
        ],
        "created_at": "2026-10-04T14:27:12+00:00",
        "updated_at": "2026-10-04T14:27:12+00:00"
    }
}