Skip to main content
Every card charge is authorized against a card limit — an amount, a validity window, and the spending rules it may use. Rules let you approve or block transactions by merchant category, amount, country, time, and more. This guide covers attaching a limit to an existing card, defining spending rules, removing a limit, and reading how much is still available.

How spending controls fit together

Two objects work together to decide whether a card transaction is approved:
  • A card limit rule describes where and how a card may spend. It’s a named set of conditions — each condition tests one attribute of the transaction (the merchant category, the amount, the country, the time, …). All conditions in a rule must match for the rule to allow a transaction (AND). A rule is reusable: create it once and reference it from many limits. Each rule you create returns a ruleId.
  • A card limit authorizes spend: it caps an amount (in centavos), is valid between startDate and endDate, applies to one or more cardIds, and references one or more ruleIds. A transaction is allowed when it falls inside the amount and window and any one of the referenced rules matches (OR).
In short: conditions inside a rule are AND; rules inside a limit are OR. FLEX_INTERNATIONAL is a permissive default you can pass as a ruleId while you get started, then replace with your own rules (defined below).

Add a limit to an existing card

Use this before each charge on a reusable card, or whenever you want to top up a card’s authorized amount.
A 201 confirms the limit was attached. amount is in centavos; set startDate/endDate to today’s date for a same-day charge. Reference: POST .../card-limit

Check the available amount

Read a card’s active limits to see how much is left to spend. availableAmount decreases as transactions clear; pendingAmount reflects authorized-but-not-cleared spend.
Reference: GET .../cards/{cardId}/card-limit

Remove a limit

Delete a limit by its cardLimitId to stop further authorizations against it (for example, to close out a reusable card).
A 204 confirms removal. Reference: DELETE .../card-limit/{cardLimitId}

Define a rule

A rule is a description plus a rules array of conditions. Each condition tests one transaction property against a comparative value using an operator. All conditions must match for the rule to allow a transaction. The response returns a ruleId (under external.ruleId and as the document _id) you reference from a card limit. This single-condition rule allows everything except merchant category 3001:

Transaction properties

A condition can test any of these properties:

Operators

Each test exposes both the positive and the negated form (EQUALS / NOT_EQUAL, IN / NOT_IN, …), so you don’t need a separate “negate” flag — pick the operator that expresses your intent.

A multi-condition rule

Because conditions are combined with AND, this rule allows only grocery-store purchases (MCC 5411) under R$ 500,00:
To express “grocery or pharmacy”, use the IN operator on a single condition ("comparative": "5411, 5912"), or create two separate rules and reference both ruleIds from one limit (rules in a limit are OR).
When property is mcc with EQUALS/NOT_EQUAL, comparative must be a valid merchant category code. When property is merchantCountry or acquiringCountryCode with EQUALS/NOT_EQUAL, comparative must be a valid ISO country code. Invalid values are rejected.
Update a rule later with the PUT endpoint, referencing its cardLimitRuleId. Reference: POST .../card-limit-rule · PUT .../card-limit-rule/{cardLimitRuleId}

Next steps

Issue virtual cards

Create a card and read its PAN and CVV.

Manage and monitor cards

Block, unblock, and read the transaction history for a card.