Before you start
- Tracer running and reachable, with an API key — see Getting started
- The id of the account, portfolio, or segment the cap applies to
- The currency of the transactions you want capped
- Familiarity with limit types, time windows, and custom periods — see Spending limits
X-API-Key and run against http://localhost:4020.
Step 1: Decide what the cap is addressed to
A limit carries a list of scope objects, and each object names what the limit applies to. These fields are available inside one object:
Fields inside one object combine with AND. A field you leave out is a wildcard. Across objects the list combines with OR, so a limit with two objects applies when either one matches.
The choice that decides the answer to “R$ 20,000 per account” is which id you name:
- One account, its own budget
- Narrowed to one rail
A limit also carries a
currency, and Tracer checks a limit against a transaction only when the two match. A limit created in BRL is not checked against a USD transaction, so a book that settles in two currencies needs a limit for each.Step 2: Choose the period
limitType decides both the size of the ceiling’s window and when a new count starts. Tracer offers five:
“per month” is
MONTHLY.
CUSTOM takes customStartDate and customEndDate and is the shape for a campaign or a promotion. Those two fields belong to CUSTOM and are rejected on the other four types. To restrict a cap to certain hours of the day instead, see time windows.
Step 3: Create the limit
POST /v1/limits stores the definition. It is created in DRAFT, which means it is stored but not yet checked.
201. The body is the stored limit; two fields matter now:
Names are unique across limits, and the character set is narrow.
name accepts ASCII letters and digits, spaces, and -, _, ., (, ). An accent or a dash typed as an em dash is rejected with 0371. A name another live limit already holds is rejected with 0442; deleting a limit frees its name again.Step 4: Activate it
A
DRAFT limit is not checked. Activation is what puts it in the path:
status set to ACTIVE. From here, every POST /v1/validations whose transaction matches the scope and the currency is measured against it.
Activating mid-month does not import the month’s history. Tracer counts a transaction against a limit at the moment it decides on it, so spending that happened while the limit was
DRAFT is not in the count. A cap activated on the 20th governs what happens from the 20th onward.Step 5: Read how much is left
Every
POST /v1/validations response carries limitUsageDetails, with one entry per limit Tracer checked:
In the entry above, a R$ 1,500 purchase took an 18,500 month to exactly 20,000 — the cap is now spent, and the next transaction on that account is denied until August.
When a limit is exceeded, the decision is
DENY and reason is limit_exceeded; the amount that would have crossed the ceiling is not added to the count. A limit produces a denial, not a flag for review. To go from such a denial back to the limit that caused it, see Reviewing a denied transaction.
The other reading
GET /v1/limits/{limitId}/usage answers with a total for the limit rather than for one period: it adds up the usage counters recorded against it, across the periods and scopes it has accumulated. Use it to review how much a limit has absorbed overall — not to answer how much a customer has left this month.
A counter is deleted 90 days after its period ends, so on a long-running limit this total covers only the periods still retained, not the limit’s full lifetime. See Usage tracking.
See Retrieve a limit usage snapshot.
Step 6: Change it, pause it, remove it
1
Raise or lower the ceiling
name, description, maxAmount, and scopes are editable, and so are the time-window and custom-period fields. limitType and currency are not — a request that sends either is rejected with 0380, and a different period or currency means a new limit. A body with nothing in it is rejected with 0183. See Update a limit.Changing the ceiling does not clear the running count. Lower it below what the current period already consumed and the account is denied until the next period starts.2
Stop enforcing it
INACTIVE and stops being checked. It keeps its definition and its place in the , and POST /v1/limits/{limitId}/activate puts it back in the path. See Deactivate a limit.3
Take it back to draft
INACTIVE limit back to DRAFT. See Return a limit to draft.4
Remove it
204. A limit that is currently ACTIVE has to be deactivated first — Tracer rejects the deletion with 0363, which is what keeps a live ceiling from disappearing by accident. See Delete a limit.Find the limits you already have
GET /v1/limits lists them, and filters by the same scope fields you set in Step 1:
name, status, limit_type, account_id, segment_id, portfolio_id, merchant_id, transaction_type, and sub_type all filter; results are cursor-paginated. See List limits, and Retrieve a limit for one by id.
What goes wrong
Error codes
The complete list is in the Tracer error list.

