Download Consolidated Statement
Downloads a consolidated statement file previously generated by the
POST /api/statement/consolidated endpoint (which requires authentication).
The link returned by that endpoint points to this public route, since
access to the file is controlled by a possession token (the token itself, contained in the
URL) — there is no need to resend authentication credentials to download it.
| Method | GET |
| Path | /api/statement/consolidated/files/{token} |
| Authentication | Not required |
URL Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Unique report identifier, generated when the statement is created (POST /api/statement/consolidated) |
Responses
200 OK — returns the file as a download attachment.
- Header
Content-Disposition: attachment; filename=consolidated_statement_AAAAMMDD.json - Header
Content-Type: application/json - Body: consolidated report content (see structure below)
400 Bad Request — token not provided:
{ "message": "token is required" }
404 Not Found — no file found for the given token:
{ "message": "Arquivo nao encontrado" }
410 Gone — the file exists but has expired (see expires_at in the report structure):
{ "message": "Arquivo expirado" }
Report structure (JSON)
{
"start_date": "2025-01-01",
"end_date": "2025-01-31",
"link": "https://.../api/statement/consolidated/files/<token>?file_type=json",
"expires_at": "2025-02-07T00:00:00Z",
"groups": [
{
"status": "PAID",
"total_amount": 1500.50,
"items": [
{ "id": "tx-123", "amount": 500.00, "fee": 1.50 },
{ "id": "tx-456", "amount": 1000.50, "fee": 2.00 }
]
}
]
}
| Field | Description |
|---|---|
start_date / end_date | Period (format YYYY-MM-DD) covered by the statement |
link | Download URL for this same file |
expires_at | Date/time (RFC 3339) when the file expires. After this date, the download returns 410 Gone |
groups | Transactions grouped by status (e.g. PAID, FAILED), with total amount (total_amount) and item list (items) |
groups[].items[].fee | Fee charged on the transaction |
Retention
The generated file remains available for download for a limited period
(default: 7 calendar days from the report's generation). After that period,
the download will return 410 Gone.