Skip to main content

Generate Consolidated Statement

Generates a consolidated statement of transactions for the given period and provides a link to download the file (JSON or OFX). The generated file is downloaded via the public endpoint GET /api/statement/consolidated/files/{token}. Once the file is ready, an asynchronous notification is sent to the channel (Channel-Id) informing the download link.

MethodPOST
Path/api/statement/consolidated
AuthenticationAuthorization (****** + Channel-Id

Authentication

Requires the Authorization header with a valid, non-expired token, previously issued for the integrator. If missing, malformed, or the token is invalid/expired, the API returns 401 Unauthorized:

{ "error": "Token ausente ou inválido" }

or

{ "error": "Token inválido" }

Also requires the Channel-Id: <channel_id> header. If missing, it returns 400 Bad Request:

{ "message": "Channel-Id header is required" }

Request body

{
"start_date": "2025-01-01",
"end_date": "2025-01-31",
"file_type": "json"
}
FieldTypeRequiredDescription
start_datestringYesPeriod start date, format YYYY-MM-DD
end_datestringYesPeriod end date, format YYYY-MM-DD
file_typestringNoFile format: json or ofx. Any value other than json is treated as ofx (default when omitted)

Period validation rules

  • start_date and end_date must be in the YYYY-MM-DD format.
  • end_date cannot be earlier than start_date.
  • The maximum allowed range is 31 days.

Responses

200 OK — statement generated successfully:

{
"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 }
]
}
]
}

400 Bad Request — invalid body, missing Channel-Id, invalid date format, invalid date range, or no transactions found in the period:

{ "message": "Formato de data invalido. Use YYYY-MM-DD" }
{ "message": "Range maximo permitido e de 31 dias" }
{ "message": "Channel-Id header is required" }

Retention

The generated file remains available for download for a limited period (default: 7 calendar days), as described in Download Consolidated Statement.