Get Spending Report for Financial Account Grouped by Merchant Category
Deprecated: This endpoint has been marked deprecated. It may be removed in a future API version. Review available UserReport endpoints for current alternatives.
This endpoint returns a spending report for a specific financial account, aggregating transaction amounts by merchant category. The response includes each category's total spend and its percentage of overall spending, as well as the grand total across all categories. Use optional date range parameters to scope the report to a specific time window.
Endpoint
GET /api/userReport/spendingReportByAccountGroupByCategory
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 you need to present a category-level spending summary to a customer for a given financial account. It is useful for dashboards and analytics screens where customers want to understand where their money is being spent across merchant categories. Providing from and to parameters allows filtering to a specific billing period or custom date range.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| finAccountId | string | Yes | The unique identifier of the financial account to report on. |
| from | string (date-time) | No | Start of the date range (ISO 8601 format). If omitted, no lower bound is applied. |
| to | string (date-time) | No | End of the date range (ISO 8601 format). If omitted, no upper bound is applied. |
Response
200 OK
Top-level response object (spendingreportbycategory):
| Field | Type | Description |
|---|---|---|
| categories | array | List of spending amounts broken down by merchant category. |
| total | integer (int64) | Grand total spending amount across all categories, in the smallest currency unit (e.g., cents). |
Each item in categories (spendingamountbycategory):
| Field | Type | Description |
|---|---|---|
| category | string | Merchant category name (e.g., "Groceries", "Travel"). May be null if uncategorized. |
| amount | integer (int64) | Total spending amount for this category, in the smallest currency unit (e.g., cents). |
| percentage | number (double) | Percentage of total spending that this category represents. |
{
"categories": [
{
"category": "Groceries",
"amount": 45230,
"percentage": 32.5
},
{
"category": "Travel",
"amount": 28900,
"percentage": 20.8
},
{
"category": "Restaurants",
"amount": 21500,
"percentage": 15.5
},
{
"category": null,
"amount": 43370,
"percentage": 31.2
}
],
"total": 139000
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing or invalid finAccountId, or malformed from/to date-time values. |
| 401 | Token missing, expired, or invalid. |
| 403 | Insufficient permissions to access the specified financial account. |
| 404 | Financial account not found for the provided finAccountId. |
| 500 | Internal server error. |
Common Mistakes
- Omitting the required
finAccountIdquery parameter will result in a 400 error. - Providing
fromortoin a format other than ISO 8601 date-time (e.g.,2024-01-01T00:00:00Z) will cause a parse error. - Amount values are returned in the smallest currency unit (cents). Divide by 100 to display dollar amounts.
- This endpoint is deprecated — plan migration to a current alternative to avoid breakage when it is removed.
Related Endpoints
GET /api/userReport/spendingReportByAccount— Retrieve overall spending report for a financial account without category grouping.GET /api/userReport/spendingReportByAccountGroupByMerchant— Retrieve spending report for a financial account grouped by merchant.
Example
curl -X GET "https://api.banking.netevia.dev/api/userReport/spendingReportByAccountGroupByCategory?finAccountId=XXXXXXXXXX&from=2024-01-01T00%3A00%3A00Z&to=2024-01-31T23%3A59%3A59Z" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"