Get card spending

Get Card Spending

The Get Card Spending endpoint retrieves a summary of spending and available balance information associated with a specific payment card. The response includes total spend, available funds, refunds, ATM withdrawals, and any configured spending limits. An optional date range can be applied to scope the results to a specific time period.

Endpoint

GET /api/transaction/spendByCard

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 display a card's spending summary to a cardholder or authorized user, such as in a dashboard or expense tracking view. It is useful for monitoring spend against limits, reviewing recent card activity totals, and identifying refund or ATM activity within a specified period.

Query Parameters

ParameterTypeRequiredDescription
paymentCardIdstringYesThe unique identifier of the payment card whose spending data is being retrieved.
fromstring (date-time)NoStart of the date range filter in ISO 8601 format (e.g., 2024-01-01T00:00:00Z). If omitted, all historical records are included.
tostring (date-time)NoEnd of the date range filter in ISO 8601 format (e.g., 2024-01-31T23:59:59Z). If omitted, records up to the current date are included.

Response

200 OK

FieldTypeDescription
spendinteger (int64)Total amount spent on the card, in the smallest currency unit (e.g., cents).
availableinteger (int64)Total available balance on the card, in the smallest currency unit.
availableWithLimitinteger (int64) | nullAvailable balance factoring in any configured spending limit. Null if no limit is set.
limitinteger (int64) | nullThe configured spending limit on the card, in the smallest currency unit. Null if no limit is set.
hasLimitbooleanIndicates whether a spending limit is configured for this card.
refundsinteger (int64) | nullTotal amount refunded to the card within the queried period, in the smallest currency unit. Null if no refunds exist.
atminteger (int64) | nullTotal amount withdrawn via ATM within the queried period, in the smallest currency unit. Null if no ATM activity exists.
{
  "spend": 45000,
  "available": 155000,
  "availableWithLimit": 55000,
  "limit": 100000,
  "hasLimit": true,
  "refunds": 5000,
  "atm": 20000
}

Error Codes

CodeWhen it happens
400paymentCardId is missing or malformed, or the from/to date values are not valid ISO 8601 date-time strings.
401Token missing, expired, or invalid.
403Insufficient permissions — the authenticated user does not have access to the specified card.
404No card found matching the provided paymentCardId.
500Internal server error.

Common Mistakes

  • Omitting the required paymentCardId query parameter will result in a 400 error — it must always be provided.
  • Providing from and to values in a non-ISO 8601 format (e.g., MM/DD/YYYY) will cause a 400 error; always use the date-time format such as 2024-06-01T00:00:00Z.
  • Monetary values (spend, available, limit, etc.) are returned in the smallest currency unit (cents for USD). Divide by 100 to display as dollar amounts.
  • When hasLimit is false, both limit and availableWithLimit will be null — do not treat null as zero for display purposes.

Related Endpoints

  • GET /api/transaction/spendByAccount — Retrieves spending summary for a financial account rather than a specific card.
  • GET /api/transaction/list — Returns a detailed list of individual transactions for a card or account.
  • GET /api/paymentcard/{paymentCardId} — Retrieves full details of a specific payment card including status and card type.

Example

curl -X GET "https://api.banking.netevia.dev/api/transaction/spendByCard?paymentCardId=card_abc123&from=2024-01-01T00%3A00%3A00Z&to=2024-01-31T23%3A59%3A59Z" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
Query Params
string
required
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