Overview /
Stock & supply /
Create a stock item
Create a stock item
post
https://api.flactrum.com/v1/stock-items
| Required scope | stock_items.write |
| Success status | 201 |
| Returns | One StockItem object |
Request body
| Field | Type | Description |
|---|---|---|
| name * | string | — |
| sku | string|null | — |
| category_id | string|null | — |
| unit * | string | — |
| base_unit * | string | Must be in the same family as unit: weight, volume or count. |
| default_cost | number|null | Per base unit — mixing this up multiplies costs by a thousand. |
| critical_level | number|null | — |
| is_active | boolean | — |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | — |
| name | string | — |
| sku | string|null | — |
| category_id | string|null | — |
| unit | string | Preferred display unit. |
| base_unit | string | Everything — balances, recipes, costs — is stored in this unit. |
| default_cost | number|null | Cost per base unit. Coffee at 1200 TRY/kg is 1.2 on a gram-based item. |
| critical_level | number|null | Below this the item counts as critical. |
| is_active | boolean | — |
| purchase_units | array | — |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X POST 'https://api.flactrum.com/v1/stock-items' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"name": "Süt",
"unit": "litre",
"base_unit": "mililitre",
"default_cost": 0.04,
"critical_level": 5000,
"category_id": "01m43mzhy70xgv3t4cjbavkd3r"
}'
HTTP 201 · application/json
{
"data": {
"id": "01m43mzhyf9w2t1ankf0bjcns2",
"name": "Süt",
"sku": null,
"category_id": "01m43mzhy70xgv3t4cjbavkd3r",
"unit": "litre",
"base_unit": "mililitre",
"default_cost": 0.04,
"critical_level": 5000,
"is_active": true,
"purchase_units": [],
"created_at": "2026-10-04T14:27:11+00:00",
"updated_at": "2026-10-04T14:27:11+00:00"
}
}
curl -X POST 'https://api.flactrum.com/v1/stock-items' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"name": "Hatalı",
"unit": "litre",
"base_unit": "gram"
}'
HTTP 422 · application/json
{
"error": {
"code": "validation_failed",
"message": "The submitted data is invalid.",
"details": {
"fields": {
"base_unit": [
"unit and base_unit must belong to the same family (weight, volume or count)."
]
}
}
}
}