Get Spending report for the financial account group by Merchant Category as xlsx file

Get Spending Report by Account Group by Category (XLSX)

The GET /api/userReport/spendingReportByAccountGroupByCategoryXl endpoint retrieves a spending report for a specified financial account, aggregated by merchant category, and returns the result as a downloadable XLSX file. This is ideal for customers who want to analyze their spending habits using spreadsheet software, enabling features such as graphs, charts, and pivot tables. Date range filters allow focused reporting on specific time periods.

Endpoint

GET /api/userReport/spendingReportByAccountGroupByCategoryXl

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 wants to download a summary of their spending broken down by merchant category for a specific financial account. This is particularly useful for business customers performing expense analysis or personal customers reviewing their spending habits. The XLSX format makes the data immediately compatible with tools like Microsoft Excel or Google Sheets.

Query Parameters

ParameterTypeRequiredDescription
finAccountIdstringNoThe unique identifier of the financial account for which the spending report is generated.
fromstring (date-time)NoStart of the reporting date range (ISO 8601 date-time format, e.g., 2024-01-01T00:00:00Z).
tostring (date-time)NoEnd of the reporting date range (ISO 8601 date-time format, e.g., 2024-12-31T23:59:59Z).

Response

200 OK

FieldTypeDescription
namestringThe filename of the generated XLSX report (e.g., spending_report.xlsx).
contentstringBase64-encoded content of the XLSX file.
contentTypestringMIME type of the file (e.g., application/vnd.openxmlformats-officedocument.spreadsheetml.sheet).
{
  "name": "spending_report_2024.xlsx",
  "content": "UEsDBBQABgAIAAAAIQB...",
  "contentType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}

Error Codes

CodeWhen it happens
400Invalid date format for from or to parameters, or malformed finAccountId.
401Token missing, expired, or invalid.
403Insufficient permissions to access the specified financial account.
404Financial account not found for the given finAccountId.
500Internal server error.

Common Mistakes

  • Providing from and to dates in a format other than ISO 8601 date-time will result in a 400 error — always use the format YYYY-MM-DDTHH:MM:SSZ.
  • The content field in the response is Base64-encoded; you must decode it before saving or opening the file as an XLSX document.
  • Omitting finAccountId may return data for a default account or an empty report — always specify the target account ID for accurate results.
  • Ensuring the from date is earlier than the to date; reversed date ranges may return an empty or unexpected report.

Related Endpoints

  • GET /api/userReport/spendingReportByAccountGroupByCategory — Retrieve the same spending report grouped by merchant category as JSON instead of XLSX.
  • GET /api/userReport/spendingReportByAccount — Retrieve a general spending report for a financial account.
  • GET /api/finAccount — List financial accounts available to the authenticated customer.

Example

curl -X GET "https://api.banking.netevia.dev/api/userReport/spendingReportByAccountGroupByCategoryXl?finAccountId=XXXXXXXXXX&from=2024-01-01T00%3A00%3A00Z&to=2024-12-31T23%3A59%3A59Z" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
Query Params
string
date-time
date-time
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