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
| Parameter | Type | Required | Description |
|---|---|---|---|
| paymentCardId | string | Yes | The unique identifier of the payment card whose spending data is being retrieved. |
| from | string (date-time) | No | Start of the date range filter in ISO 8601 format (e.g., 2024-01-01T00:00:00Z). If omitted, all historical records are included. |
| to | string (date-time) | No | End 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
| Field | Type | Description |
|---|---|---|
| spend | integer (int64) | Total amount spent on the card, in the smallest currency unit (e.g., cents). |
| available | integer (int64) | Total available balance on the card, in the smallest currency unit. |
| availableWithLimit | integer (int64) | null | Available balance factoring in any configured spending limit. Null if no limit is set. |
| limit | integer (int64) | null | The configured spending limit on the card, in the smallest currency unit. Null if no limit is set. |
| hasLimit | boolean | Indicates whether a spending limit is configured for this card. |
| refunds | integer (int64) | null | Total amount refunded to the card within the queried period, in the smallest currency unit. Null if no refunds exist. |
| atm | integer (int64) | null | Total 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
| Code | When it happens |
|---|---|
| 400 | paymentCardId is missing or malformed, or the from/to date values are not valid ISO 8601 date-time strings. |
| 401 | Token missing, expired, or invalid. |
| 403 | Insufficient permissions — the authenticated user does not have access to the specified card. |
| 404 | No card found matching the provided paymentCardId. |
| 500 | Internal server error. |
Common Mistakes
- Omitting the required
paymentCardIdquery parameter will result in a 400 error — it must always be provided. - Providing
fromandtovalues in a non-ISO 8601 format (e.g.,MM/DD/YYYY) will cause a 400 error; always use thedate-timeformat such as2024-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
hasLimitisfalse, bothlimitandavailableWithLimitwill 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"