Overview / Finance / Download a built report

Download a built report

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

Takes the reports/run body plus format (xlsx, pdf or csv) and an optional title; returns the file, not JSON. An empty result is a 409.

Required scope reports.read
Success status200

Request body

FieldTypeDescription
dimensions * array Row axis, in order. A third would make the table unreadable, so two is the limit. payment_method cannot be combined with another breakdown: one line cannot be split across two methods.
metrics * array —
range string —
from string With range=custom. Read in the brand timezone.
to string —
region string —
branches array —
channels array —
sort string A metric key. Defaults to the first metric.
direction string —

Examples

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

curl -X POST 'https://api.flactrum.com/v1/reports/run/export' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "dimensions": [
        "branch"
    ],
    "metrics": [
        "orders",
        "revenue"
    ],
    "range": "last_30",
    "format": "xlsx",
    "title": "Şube cirosu"
}'

HTTP 200 · application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

(file download — the body is the report itself, not JSON)