Get Spend rules by card

Get Spend Rules by Card

The GET /api/spendRules/byCard endpoint retrieves the spending rules applied to a specific payment card. It returns detailed information on spending limits, merchant category restrictions, country restrictions, and velocity rules associated with the card. This endpoint helps partners and customers review the financial controls in place for individual cards to ensure compliance and efficient card management.

Endpoint

GET /api/spendRules/byCard

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 or audit the current spending rules applied to a customer's payment card. It is useful when building card management dashboards, verifying that the correct restrictions are in place before processing, or when a cardholder wants to review their transaction limits and merchant restrictions.

Note: This endpoint is marked as deprecated. Consider using updated spend rules endpoints if available for new integrations.

Query Parameters

ParameterTypeRequiredDescription
paymentCardIdstringNoThe unique identifier of the payment card for which to retrieve spend rules.

Response

200 OK

The response returns a payment card edge object containing the card details along with all attached spend rules and velocity rules.

Top-level response object (bank.client.graph.edge_paymentcard):

FieldTypeDescription
cursorstringPagination cursor for this edge.
nodeobjectThe payment card object (bank.client.paymentcard.paymentcard).

Payment card node (node):

FieldTypeDescription
idstringUnique identifier of the payment card.
binstringBank Identification Number (first 6 digits) of the card.
last4stringLast 4 digits of the card number.
statusstringCurrent status of the card (e.g., OPEN, SUSPENDED, CLOSED).
formFactorstringCard form factor: PHYSICAL, VIRTUAL, or BURNER.
expirationDatestringFull expiration date of the card.
expirationMonthstringExpiration month of the card.
expirationYearstringExpiration year of the card.
networkstringCard network (e.g., VISA, MASTERCARD).
financialAccountsarrayFinancial accounts linked to this card.
physicalPaymentCardOrdersarrayPhysical card order history (for physical cards only).
attachedSpendRulesobjectPaginated collection of spend rules attached to this card.
attachedVelocityRulesobjectPaginated collection of velocity rules attached to this card.
cardProfileSetobjectCard profile set information.
cardProductobjectCard product details.

Spend rule node (attachedSpendRules.edges[].node) — base spend rule:

FieldTypeDescription
idstringUnique identifier of the spend rule.
namestringHuman-readable name of the spend rule.
versionstringVersion identifier of the spend rule.
createdAtstring (date-time)Timestamp when the rule was created.
updatedAtstringTimestamp when the rule was last updated.
spendRuleTypeintegerType of spend rule: 0 = base, 1 = amount limit, 2 = merchant category.
maximumAmountobjectMaximum allowed transaction amount (value in cents + currencyCode).
merchantCategoryAllowedarrayList of allowed merchant category codes (ISO merchant category strings).
merchantCategoryBlockedarrayList of blocked merchant category codes.
merchantCountryAllowedarrayList of allowed country codes (ISO 3166 alpha-3).
merchantCountryBlockedarrayList of blocked country codes (ISO 3166 alpha-3).

Amount limit spend rule (subtype of spend rule):

FieldTypeDescription
maximumAmountobjectMaximum transaction amount: { value: integer, currencyCode: string }.

Merchant category spend rule (subtype of spend rule):

FieldTypeDescription
allowedarrayMerchant categories explicitly allowed for this rule.
blockedarrayMerchant categories explicitly blocked for this rule.

Merchant country spend rule (subtype of spend rule):

FieldTypeDescription
allowedarrayCountry codes (ISO 3166 alpha-3) explicitly allowed.
blockedarrayCountry codes (ISO 3166 alpha-3) explicitly blocked.

Velocity rule node (attachedVelocityRules.edges[].node):

FieldTypeDescription
idstringUnique identifier of the velocity rule.
namestringHuman-readable name of the velocity rule.
velocityRuleWindowintegerTime window for the velocity rule: 0 = transaction, 1 = daily, 2 = monthly.
cumulativeRuleobjectThe cumulative spend rule applied within the velocity window.
spendRulesarrayIndividual spend rules grouped within this velocity rule.

Pagination (pageInfo) for spend rules and velocity rules:

FieldTypeDescription
startCursorstringCursor pointing to the first item in the page.
endCursorstringCursor pointing to the last item in the page.
hasNextPagebooleanIndicates whether more pages follow.
hasPreviousPagebooleanIndicates whether previous pages exist.
{
  "cursor": "eyJpZCI6ImNhcmRfMTIzNDU2In0=",
  "node": {
    "id": "pc_9a8b7c6d5e4f3a2b1c0d",
    "bin": "411111",
    "last4": "1234",
    "status": "OPEN",
    "formFactor": "VIRTUAL",
    "expirationDate": "2027-06",
    "expirationMonth": "06",
    "expirationYear": "2027",
    "network": "VISA",
    "financialAccounts": [
      {
        "id": "fa_abc123def456",
        "last4": "7890",
        "name": "Primary Checking"
      }
    ],
    "attachedSpendRules": {
      "pageInfo": {
        "startCursor": "eyJpZCI6InNyXzAwMSJ9",
        "endCursor": "eyJpZCI6InNyXzAwMyJ9",
        "hasNextPage": false,
        "hasPreviousPage": false
      },
      "edges": [
        {
          "cursor": "eyJpZCI6InNyXzAwMSJ9",
          "node": {
            "id": "sr_001aabbcc",
            "name": "Daily Transaction Limit",
            "version": "1",
            "spendRuleType": 1,
            "maximumAmount": {
              "value": 50000,
              "currencyCode": "USD"
            },
            "createdAt": "2025-01-15T10:00:00Z",
            "updatedAt": "2025-03-20T08:30:00Z"
          }
        },
        {
          "cursor": "eyJpZCI6InNyXzAwMiJ9",
          "node": {
            "id": "sr_002ddeeff",
            "name": "Blocked Merchant Categories",
            "version": "1",
            "spendRuleType": 2,
            "allowed": [],
            "blocked": [
              "BETTING_CASINO_GAMBLING",
              "PAWN_SHOPS"
            ],
            "createdAt": "2025-01-15T10:00:00Z",
            "updatedAt": null
          }
        }
      ]
    },
    "attachedVelocityRules": {
      "pageInfo": {
        "startCursor": "eyJpZCI6InZyXzAwMSJ9",
        "endCursor": "eyJpZCI6InZyXzAwMSJ9",
        "hasNextPage": false,
        "hasPreviousPage": false
      },
      "edges": [
        {
          "cursor": "eyJpZCI6InZyXzAwMSJ9",
          "node": {
            "id": "vr_001aabbcc",
            "name": "Monthly Spend Limit",
            "velocityRuleWindow": 2,
            "cumulativeRule": {
              "id": "sr_003ccddeef",
              "name": "Monthly Max",
              "spendRuleType": 1,
              "maximumAmount": {
                "value": 200000,
                "currencyCode": "USD"
              }
            },
            "spendRules": []
          }
        }
      ]
    }
  }
}

Error Codes

CodeWhen it happens
400The paymentCardId query parameter is malformed or references an invalid card format.
401Token missing, expired, or invalid.
403Insufficient permissions — the caller does not have access to the specified card's spend rules.
404No card found matching the provided paymentCardId.
500Internal server error.

Common Mistakes

  • Omitting the paymentCardId query parameter — the API may return an empty or unfiltered result rather than an explicit error.
  • Using an expired Bearer token. Tokens expire after 10 minutes; refresh via POST /api/auth/refresh before making the request.
  • Expecting monetary values in dollars — all value fields in amount objects are expressed in cents (e.g., 50000 = $500.00 USD).
  • This endpoint is marked deprecated. Avoid building new features against it; check for updated spend rule endpoints in the Netevia API catalog.

Related Endpoints

  • GET /api/spendRules — List all spend rules available for a partner or profile.
  • POST /api/spendRules — Create a new spend rule.
  • POST /api/spendRules/attach — Attach a spend rule to a payment card.
  • DELETE /api/spendRules/detach — Remove a spend rule from a payment card.

Example

curl -X GET "https://api.banking.netevia.dev/api/spendRules/byCard?paymentCardId=pc_9a8b7c6d5e4f3a2b1c0d" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
Query Params
string
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