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 aruleId. - A card limit authorizes spend: it caps an
amount(in centavos), is valid betweenstartDateandendDate, applies to one or morecardIds, and references one or moreruleIds. A transaction is allowed when it falls inside the amount and window and any one of the referenced rules matches (OR).
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.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.
GET .../cards/{cardId}/card-limit
Remove a limit
Delete a limit by itscardLimitId to stop further authorizations against it (for example, to close out a reusable card).
204 confirms removal.
Reference: DELETE .../card-limit/{cardLimitId}
Define a rule
A rule is adescription 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 withAND, this rule allows only grocery-store purchases (MCC 5411) under R$ 500,00:
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).
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.