Total Spend Amount by Category
This endpoint retrieves spending data distributed across different categories for a specified time period. For each category, it returns the total amount spent along with that category's percentage share of overall spending. It is useful for analyzing customer spending behavior and tracking trends across business accounts.
Endpoint
GET /api/Widget/SpendsByCategory
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 a breakdown of spending by category for a given reporting period. It is well suited for partner dashboards that display spending analytics, and for business customers seeking to understand how their cardholders are spending across categories such as groceries, utilities, or travel. Optional filters allow narrowing results to a specific ISO or agent.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| period | string (date-time) | No | The time period for which spending data should be retrieved (ISO 8601 date-time format). |
| isoId | integer (int32) | No | Filter spending data by ISO (Independent Sales Organization) ID. |
| agentId | integer (int32) | No | Filter spending data by agent ID. |
Response
200 OK
Returns an array of spending category objects.
| Field | Type | Description |
|---|---|---|
| category | string | The name of the spending category (e.g., "Groceries", "Utilities"). Nullable. |
| amount | integer (int64) | Total amount spent in this category, expressed in the smallest currency unit (e.g., cents). |
| percentage | number (double) | Percentage share of this category relative to total spending for the period. |
[
{
"category": "Groceries",
"amount": 154200,
"percentage": 32.5
},
{
"category": "Utilities",
"amount": 87500,
"percentage": 18.4
},
{
"category": "Dining",
"amount": 63000,
"percentage": 13.3
},
{
"category": "Travel",
"amount": 41800,
"percentage": 8.8
},
{
"category": "Other",
"amount": 127500,
"percentage": 27.0
}
]Error Codes
| Code | When it happens |
|---|---|
| 400 | Invalid query parameter format (e.g., malformed date-time value for period) |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to access spending report data |
| 404 | No spending data found for the specified period or filter combination |
| 500 | Internal server error |
Common Mistakes
- Providing
periodin an incorrect format — use ISO 8601 date-time (e.g.,2025-01-01T00:00:00Z) rather than a plain date string. - Omitting the
periodparameter when a specific reporting window is intended — without it, the API may return data for a default or undefined period. - Expecting
amountin whole currency units — the field is expressed in the smallest currency unit (cents), so154200represents $1,542.00. - Using
isoIdoragentIdvalues that do not belong to the authenticated partner, which will result in empty or unauthorized responses.
Related Endpoints
GET /api/Widget/SpendsByMerchant— Retrieves total spend amount broken down by merchantGET /api/Widget/SpendsByTime— Retrieves spending data distributed across time intervalsGET /api/Widget/TransactionSummary— Returns an aggregated summary of transactions for a period
Example
curl -X GET "https://api.banking.netevia.dev/api/Widget/SpendsByCategory?period=2025-01-01T00%3A00%3A00Z&isoId=101&agentId=55" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"