Download Account Statement
The GET /api/statements/v2 endpoint allows authenticated users to download account statements for a specified financial account and billing period. The response returns the statement as a file object containing the encoded content and content type, supporting multiple export formats including CSV, PDF, QBO, and OFX.
This endpoint is essential for partners and their customers who need to export transaction history and account activity for analysis, record-keeping, or integration with third-party financial tools.
Endpoint
GET /api/statements/v2
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a customer needs to download a record of their account activity for a given period. This is useful for bookkeeping, tax preparation, or importing transaction data into accounting software. All four supported formats (CSV, PDF, QBO, OFX) can be requested depending on the customer's downstream tooling.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| financialAccountId | string | No | The unique identifier of the financial account whose statement should be downloaded. |
| period | string (date-time) | No | The billing period for which the statement is requested, in ISO 8601 date-time format (e.g., 2024-01-01T00:00:00Z). Defaults to the latest available period if omitted. |
| fileFormat | string (enum) | No | The desired file format for the statement. Accepted values: PDF, CSV, QBO, OFX. Defaults to CSV if omitted. |
Response
200 OK
| Field | Type | Description |
|---|---|---|
| name | string (nullable) | The filename of the generated statement (e.g., statement_2024-01.csv). |
| content | string (nullable) | The Base64-encoded file content of the statement. |
| contentType | string (nullable) | The MIME type of the returned file (e.g., text/csv, application/pdf). |
{
"name": "statement_2024-01.csv",
"content": "base64EncodedFileContentHere...",
"contentType": "text/csv"
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Invalid period format or unrecognized fileFormat value supplied. |
| 401 | Token missing, expired, or invalid. |
| 403 | Insufficient permissions to access the specified financial account. |
| 404 | No statement found for the specified financialAccountId and period combination. |
| 500 | Internal server error. |
Common Mistakes
- Passing a
periodvalue that does not correspond to a completed billing cycle will result in a 404 or an empty statement. - The
contentfield in the response is Base64-encoded — decode it before saving or displaying the file to the end user. - Omitting
financialAccountIdwhen the authenticated user has multiple financial accounts may return a statement for an unexpected account; always pass the explicit account ID. - The
fileFormatenum values are case-sensitive — use uppercase (CSV,PDF,QBO,OFX); lowercase variants will be rejected with a 400 error.
Related Endpoints
GET /api/statements— Retrieve a list of available statement periods for a financial account.GET /api/financialaccounts— List financial accounts associated with the authenticated customer.GET /api/transactions/v2— Retrieve individual transaction records for a financial account.
Example
curl -X GET "https://api.banking.netevia.dev/api/statements/v2?financialAccountId=fa_XXXXXXXXXX&period=2024-01-01T00%3A00%3A00Z&fileFormat=CSV" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"