Get Spending Report for Card
The spending report endpoint returns a detailed breakdown of card spending activity over a specified period. It includes total expenditure, a list of all spending categories, and per-category spend amounts — enabling partners and their customers to analyze card usage and manage finances effectively.
Endpoint
GET /api/transaction/spendingReport
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 to display a spending summary to customers on a dashboard or in a financial insights view. It is suitable for any integration that needs to present categorized transaction data — such as "Food & Dining" or "Transportation" — for a given card over a custom date range. This endpoint is also useful for internal reporting or expense management features built on top of the Netevia BaaS platform.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cardId | string | No | The unique identifier of the payment card to retrieve the spending report for. |
| dateFrom | string (date-time) | No | Start of the reporting period in ISO 8601 date-time format (e.g., 2025-01-01T00:00:00Z). |
| dateTo | string (date-time) | No | End of the reporting period in ISO 8601 date-time format (e.g., 2025-01-31T23:59:59Z). |
Response
200 OK
| Field | Type | Description |
|---|---|---|
| total | integer (int64) | Total amount spent across all transactions in the specified period, in the smallest currency unit (e.g., cents). |
| allCategories | array of strings (nullable) | List of all spending category names present in the report (e.g., "Food & Dining", "Transportation"). |
| spendByCategories | object (nullable) | Key-value map where each key is a category name (string) and the value is the total amount spent in that category (integer, int64, nullable). |
{
"total": 158400,
"allCategories": [
"Food & Dining",
"Transportation",
"Shopping",
"Entertainment"
],
"spendByCategories": {
"Food & Dining": 52300,
"Transportation": 21100,
"Shopping": 67500,
"Entertainment": 17500
}
}Error Codes
| Code | When it happens |
|---|---|
| 400 | One or more query parameters are malformed (e.g., invalid date-time format). |
| 401 | Token missing, expired, or invalid. |
| 403 | Insufficient permissions to access spending data for the specified card. |
| 404 | The specified cardId does not exist or is not accessible. |
| 500 | Internal server error. |
Common Mistakes
- Providing
dateFromordateToin a non-ISO 8601 format will result in a 400 error. Always use thedate-timeformat:YYYY-MM-DDTHH:mm:ssZ. - Omitting
cardIdmay return an empty or unexpected report if the account has multiple cards. Always pass the specific card identifier to scope results correctly. - Monetary values in
totalandspendByCategoriesare returned in the smallest currency unit (e.g., cents). Divide by 100 to display dollar amounts to end users. - Ensure the
dateFromvalue is earlier thandateTo. Reversed date ranges may return empty results without an error.
Related Endpoints
GET /api/transaction— Retrieve a list of individual transactions for a card or account.GET /api/paymentcard— List payment cards associated with a customer profile.GET /api/paymentcard/{cardId}— Retrieve details for a specific payment card.
Example
curl -X GET "https://api.banking.netevia.dev/api/transaction/spendingReport?cardId=card_abc123&dateFrom=2025-01-01T00%3A00%3A00Z&dateTo=2025-01-31T23%3A59%3A59Z" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"