Get Spending report for the card

Get Spending Report for Card

The spending report endpoint generates a detailed breakdown of transactions for a specific payment card within a defined date range. Results are organized by merchant category, each showing the total amount spent and its percentage of overall card spending. This makes it straightforward to analyze cardholder behavior, enforce budgets, or surface insights within a partner application.

Endpoint

POST /api/paymentCards/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 when you need to present a cardholder or account manager with a summary of how a payment card has been used over a period of time. It is well-suited for expense dashboards, monthly statements, and spend-control features where category-level aggregation (e.g., dining, travel, groceries) is more actionable than a raw transaction list. Both physical and virtual card IDs are accepted.

Request Body

FieldTypeRequiredDescription
paymentCardIdstringYesUnique identifier of the payment card to report on. Minimum length: 1 character.
dateFromstring (date-time)YesStart of the reporting period in ISO 8601 date-time format (e.g., 2025-01-01T00:00:00Z).
dateTostring (date-time)YesEnd of the reporting period in ISO 8601 date-time format (e.g., 2025-01-31T23:59:59Z).
{
  "paymentCardId": "card_abc123xyz",
  "dateFrom": "2025-01-01T00:00:00Z",
  "dateTo": "2025-01-31T23:59:59Z"
}

Response

200 OK

FieldTypeDescription
categoriesarrayList of spending category objects. May be null if no transactions exist in the period.
categories[].categorystringName of the merchant category (e.g., "Dining", "Travel", "Groceries"). Nullable.
categories[].amountinteger (int64)Total amount spent in this category, expressed in the smallest currency unit (e.g., cents).
categories[].percentagenumber (double)Percentage of the card's total spending attributed to this category.
totalinteger (int64)Total amount spent across all categories for the requested period, in the smallest currency unit.
{
  "categories": [
    {
      "category": "Dining",
      "amount": 15400,
      "percentage": 30.8
    },
    {
      "category": "Travel",
      "amount": 22000,
      "percentage": 44.0
    },
    {
      "category": "Groceries",
      "amount": 12600,
      "percentage": 25.2
    }
  ],
  "total": 50000
}

Error Codes

CodeWhen it happens
400Missing required fields (paymentCardId, dateFrom, or dateTo), invalid date-time format, or dateFrom is after dateTo
401Token missing, expired, or invalid
403Insufficient permissions to access spending data for the specified card
404Payment card not found for the provided paymentCardId
500Internal server error

Common Mistakes

  • Providing dateFrom after dateTo — the date range must be chronologically ordered with dateFrom earlier than dateTo.
  • Sending date strings without timezone information (e.g., 2025-01-01T00:00:00 with no Z or offset) — always include a timezone designator to avoid ambiguous period boundaries.
  • Using a card display number instead of the internal paymentCardId — the field requires the platform-assigned card ID, not the 16-digit PAN.
  • Expecting transaction-level detail in this response — this endpoint returns category aggregates only; use the transaction history endpoint for individual transaction records.

Related Endpoints

  • POST /api/paymentCards — Create a new payment card (physical, virtual, or burner)
  • GET /api/paymentCards/{paymentCardId} — Retrieve details for a specific payment card
  • POST /api/paymentCards/transactions — Retrieve individual transaction records for a card

Example

curl -X POST https://api.banking.netevia.dev/api/paymentCards/spendingReport \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "paymentCardId": "card_abc123xyz",
    "dateFrom": "2025-01-01T00:00:00Z",
    "dateTo": "2025-01-31T23:59:59Z"
  }'
Body Params
string
required
length ≥ 1
date-time
required
date-time
required
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
string
enum
Defaults to application/json

Generated from available request 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