Get Spending report for the card

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

ParameterTypeRequiredDescription
cardIdstringNoThe unique identifier of the payment card to retrieve the spending report for.
dateFromstring (date-time)NoStart of the reporting period in ISO 8601 date-time format (e.g., 2025-01-01T00:00:00Z).
dateTostring (date-time)NoEnd of the reporting period in ISO 8601 date-time format (e.g., 2025-01-31T23:59:59Z).

Response

200 OK

FieldTypeDescription
totalinteger (int64)Total amount spent across all transactions in the specified period, in the smallest currency unit (e.g., cents).
allCategoriesarray of strings (nullable)List of all spending category names present in the report (e.g., "Food & Dining", "Transportation").
spendByCategoriesobject (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

CodeWhen it happens
400One or more query parameters are malformed (e.g., invalid date-time format).
401Token missing, expired, or invalid.
403Insufficient permissions to access spending data for the specified card.
404The specified cardId does not exist or is not accessible.
500Internal server error.

Common Mistakes

  • Providing dateFrom or dateTo in a non-ISO 8601 format will result in a 400 error. Always use the date-time format: YYYY-MM-DDTHH:mm:ssZ.
  • Omitting cardId may 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 total and spendByCategories are returned in the smallest currency unit (e.g., cents). Divide by 100 to display dollar amounts to end users.
  • Ensure the dateFrom value is earlier than dateTo. 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"
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