Overview / Finance / Generate and store a report

Generate and store a report

post https://api.flactrum.com/v1/reports

The figures are frozen at generation time, so the same report always reads the same afterwards.

Required scope reports.write
Success status201
Returns One Report object

Request body

FieldTypeDescription
category * string —
period_type * string Covers the previous complete period: daily means yesterday.
branch_id string|null —
send_by_email boolean Also e-mail the file to the signed-in user (management app only; an API key has no mailbox).
format string File format of the e-mailed report. Defaults to xlsx.

Response fields

FieldTypeDescription
id string —
category string —
branch_id string|null Null means the whole brand.
period_start string —
period_end string —
generated_at string —
figures object The report body, frozen at generation time. An order entered later never changes a stored report.

Examples

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

curl -X POST 'https://api.flactrum.com/v1/reports' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "category": "financial",
    "period_type": "daily"
}'

HTTP 201 · application/json

{
    "data": {
        "id": "01m43myas0fnbeamp04k7he18a",
        "category": "financial",
        "type": "daily",
        "branch_id": null,
        "period_start": "2026-10-02",
        "period_end": "2026-10-03",
        "generated_at": "2026-10-04T14:26:31+00:00",
        "figures": {
            "rows": [],
            "totals": {
                "net_revenue": 0,
                "discount": 0,
                "cost": 0,
                "profit": 0
            }
        },
        "created_at": "2026-10-04T14:26:31+00:00"
    }
}