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
| Parameter | Type | Required | Description |
|---|---|---|---|
| finAccountId | string | No | The unique identifier of the financial account for which the spending report is generated. |
| from | string (date-time) | No | Start of the reporting date range (ISO 8601 date-time format, e.g., 2024-01-01T00:00:00Z). |
| to | string (date-time) | No | End of the reporting date range (ISO 8601 date-time format, e.g., 2024-12-31T23:59:59Z). |
Response
200 OK
| Field | Type | Description |
|---|---|---|
| name | string | The filename of the generated XLSX report (e.g., spending_report.xlsx). |
| content | string | Base64-encoded content of the XLSX file. |
| contentType | string | MIME 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
| Code | When it happens |
|---|---|
| 400 | Invalid date format for from or to parameters, or malformed finAccountId. |
| 401 | Token missing, expired, or invalid. |
| 403 | Insufficient permissions to access the specified financial account. |
| 404 | Financial account not found for the given finAccountId. |
| 500 | Internal server error. |
Common Mistakes
- Providing
fromandtodates in a format other than ISO 8601 date-time will result in a 400 error — always use the formatYYYY-MM-DDTHH:MM:SSZ. - The
contentfield in the response is Base64-encoded; you must decode it before saving or opening the file as an XLSX document. - Omitting
finAccountIdmay return data for a default account or an empty report — always specify the target account ID for accurate results. - Ensuring the
fromdate is earlier than thetodate; 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"