Skip to main content

Generate an account statement

Reports are generated asynchronously and land as a downloadable file.

1. Queue the report

report_type 19 is Account Statement; report_data_type 3 is PDF (2 is CSV). Scope it to one account (or a group) with account_ids.

curl --request POST \
--url https://api.onlytradeplatform.com/api/v1/reports \
--header "Authorization: Bearer $TOKEN" \
--header "content-type: application/json" \
--data '{
"report_type": 19,
"report_data_type": 3,
"account_ids": [26100003],
"scope_label": "Account 26100003 · 01-06-2026 → 13-06-2026",
"filter": { "fromdate": "01-06-2026", "todate": "13-06-2026" }
}'

The response data carries the new report row, including status and url once it completes.

2. List your reports

curl --request GET \
--url https://api.onlytradeplatform.com/api/v1/reports \
--header "Authorization: Bearer $TOKEN"

Wait for status to become completed, then note the request_id.

3. Download the file

curl --request GET \
--url https://api.onlytradeplatform.com/api/v1/reports/file/<request_id> \
--header "Authorization: Bearer $TOKEN" \
--output statement.pdf

The file streams with the correct Content-Type (PDF or CSV). Delete a report with DELETE /api/v1/reports/{id}.