Overview / Stock & supply / Record waste

Record waste

post https://api.flactrum.com/v1/stock-wastes

Subtracts the quantity from branch stock and writes a waste movement carrying the reason. Send how much was LOST, not what is left — that is what the adjustment endpoint is for.

Required scope stock.write
Panel screenStock & supply → Waste and trim
Success status201
Returns One StockMovement object

Request body

FieldTypeDescription
branch_id * string —
stock_item_id * string —
quantity * number How much was thrown away, POSITIVE, in the item's base unit (gram / millilitre / piece). It is subtracted from stock.
reason * string Required. Reports break waste down by this, and separate avoidable loss (spoilage, breakage) from loss inherent to production (preparation).
note string|null Free text kept alongside the reason.

Response fields

FieldTypeDescription
id string —
stock_item_id string —
branch_id string|null —
warehouse_id string|null —
type string —
quantity number Negative means stock left.
waste_quantity number How much of this movement was loss, as a positive magnitude. On a waste movement it is the whole quantity; on a sale it is only the trim percentage built into the recipe. Zero means nothing was lost.
waste_reason string|null Set on hand-recorded waste only. Recipe trim has no reason: it is inherent to production.
waste_cost number waste_quantity valued at the movement's unit cost.
quantity_before number|null —
quantity_after number|null —
unit_cost number|null —
reference object|null The document that caused it: order, stock count, goods receipt…
note string|null —
expires_at string|null Expiry date of this batch: entered on the goods receipt line, carried along transfers.
photo_url string|null Evidence photo attached when the waste was recorded.
created_at string —

Examples

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

curl -X POST 'https://api.flactrum.com/v1/stock-wastes' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "branch_id": "01m43mznwd3zmkx6rnw9eay9kg",
    "stock_item_id": "01m43mznwpza1n41tvv2zcb5ha",
    "quantity": 2000,
    "reason": "spoilage",
    "note": "Buzdolabı arızası"
}'

HTTP 201 · application/json

{
    "data": {
        "id": "01m43mznx3t2p1dkczfkf6c7wy",
        "stock_item_id": "01m43mznwpza1n41tvv2zcb5ha",
        "stock_item": {
            "id": "01m43mznwpza1n41tvv2zcb5ha",
            "name": "Domates",
            "sku": null,
            "category_id": null,
            "unit": "kilogram",
            "base_unit": "gram",
            "default_cost": 0.04,
            "critical_level": 0,
            "is_active": true,
            "created_at": "2026-10-04T14:27:15+00:00",
            "updated_at": "2026-10-04T14:27:15+00:00"
        },
        "branch_id": "01m43mznwd3zmkx6rnw9eay9kg",
        "warehouse_id": null,
        "type": "waste",
        "quantity": -2000,
        "waste_quantity": 2000,
        "waste_reason": "spoilage",
        "waste_cost": 80,
        "quantity_before": 10000,
        "quantity_after": 8000,
        "unit_cost": 0.04,
        "total_cost": 80,
        "reference": null,
        "note": "Bozulma / SKT — Buzdolabı arızası",
        "expires_at": null,
        "photo_url": null,
        "created_at": "2026-10-04T14:27:15+00:00"
    }
}