Download statements in CSV

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

ParameterTypeRequiredDescription
financialAccountIdstringNoThe unique identifier of the financial account whose statement should be downloaded.
periodstring (date-time)NoThe 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.
fileFormatstring (enum)NoThe desired file format for the statement. Accepted values: PDF, CSV, QBO, OFX. Defaults to CSV if omitted.

Response

200 OK

FieldTypeDescription
namestring (nullable)The filename of the generated statement (e.g., statement_2024-01.csv).
contentstring (nullable)The Base64-encoded file content of the statement.
contentTypestring (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

CodeWhen it happens
400Invalid period format or unrecognized fileFormat value supplied.
401Token missing, expired, or invalid.
403Insufficient permissions to access the specified financial account.
404No statement found for the specified financialAccountId and period combination.
500Internal server error.

Common Mistakes

  • Passing a period value that does not correspond to a completed billing cycle will result in a 404 or an empty statement.
  • The content field in the response is Base64-encoded — decode it before saving or displaying the file to the end user.
  • Omitting financialAccountId when the authenticated user has multiple financial accounts may return a statement for an unexpected account; always pass the explicit account ID.
  • The fileFormat enum 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"
Query Params
string
date-time
string
enum
Allowed:
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json