Overview / Stock & supply / Start a stock count

Start a stock count

post https://api.flactrum.com/v1/stock-counts
Required scope stock_counts.write
Success status201
Returns One StockCount object

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 POST 'https://api.flactrum.com/v1/stock-counts' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "branch_id": "01m43mzkcqydk36n7dykxw4f5d"
}'

HTTP 201 · application/json

{
    "data": {
        "id": "01m43mzkdkbkwyhs2hr4p08xv1",
        "code": "SAY-261004-YNXQ",
        "branch_id": "01m43mzkcqydk36n7dykxw4f5d",
        "status": "draft",
        "note": null,
        "started_at": "2026-10-04T14:27:12+00:00",
        "completed_at": null,
        "item_count": 0,
        "items": [],
        "created_at": "2026-10-04T14:27:12+00:00",
        "updated_at": "2026-10-04T14:27:12+00:00"
    }
}