Overview / Stock & supply / Batches nearing their best-before date

Batches nearing their best-before date

get https://api.flactrum.com/v1/stock-expiry

Best-before dates entered on goods receipts travel with the stock, first in first out. Lists every batch expiring within the window (or already expired) with a campaign suggestion for branches.

Required scope stock.read
Panel screenStock & supply → Expiry tracking
Success status200

Parameters

NameInTypeDescription
days query integer —
branch_id query string —

Examples

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

curl -X GET 'https://api.flactrum.com/v1/stock-expiry?days=7' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Accept: application/json'

HTTP 200 · application/json

{
    "data": [
        {
            "id": "branch:01m43sqbhgme40fvbkxj7hxw6x:01m43sqbmmrbg30va7tx30apnj:2026-10-06",
            "key": "branch:01m43sqbhgme40fvbkxj7hxw6x:01m43sqbmmrbg30va7tx30apnj:2026-10-06",
            "location_type": "branch",
            "location_id": "01m43sqbhgme40fvbkxj7hxw6x",
            "location_name": "Nişantaşı",
            "stock_item_id": "01m43sqbmmrbg30va7tx30apnj",
            "stock_item_name": "Süt",
            "base_unit": "mililitre",
            "quantity": 5000,
            "expires_at": "2026-10-06",
            "days_left": 2,
            "suggestion": {
                "state": "campaign",
                "discount": 30,
                "surplus": 5000,
                "extra_sales": 25,
                "product": {
                    "id": "01m43sqbmxbs8rnwx9nrh8j6w7",
                    "name": "Latte"
                },
                "products": [
                    {
                        "id": "01m43sqbmxbs8rnwx9nrh8j6w7",
                        "name": "Latte",
                        "usage": 200,
                        "daily_sales": 0
                    }
                ]
            }
        }
    ],
    "meta": {
        "days": 7
    }
}