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 status | 201 |
| Returns | One Report object |
Request body
| Field | Type | Description |
|---|---|---|
| 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
| Field | Type | Description |
|---|---|---|
| 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"
}
}
curl -X POST 'https://api.flactrum.com/v1/reports' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"category": "unknown",
"period_type": "daily"
}'
HTTP 422 · application/json
{
"error": {
"code": "validation_failed",
"message": "The submitted data is invalid.",
"details": {
"fields": {
"category": [
"Seçilen category geçersiz."
]
}
}
}
}