Skip to main content
Spending limits in Tracer allow you to control transaction amounts by scope (account, portfolio, segment) and period (daily, monthly, per-transaction). Limits are evaluated in real-time alongside rules, providing comprehensive transaction governance.

Why use spending limits

BenefitDescription
Customer protectionDetect overspending and return DENY decisions for unauthorized large transactions
Risk managementMonitor exposure per account, segment, or portfolio
Flexible scopingApply limits at different granularity levels
Real-time trackingMonitor usage and remaining amounts instantly
Automatic resetsDaily and monthly limits reset automatically
By the end of this guide, you will:
  • Understand limit types and scoping options
  • Create and configure spending limits
  • Monitor limit usage in real-time
  • Manage the limit lifecycle

Core concepts

Limit types

Tracer supports three types of spending limits:
TypeDescriptionReset behavior
DAILYMaximum amount per dayResets at midnight UTC
MONTHLYMaximum amount per monthResets on 1st of month, midnight UTC
PER_TRANSACTIONMaximum amount per single transactionNo tracking; each transaction evaluated independently

Scopes

Scopes define which transactions a limit applies to. A limit matches transactions that fit within its scope definition. Scope fields (all optional, at least one required):
  • segmentId - Apply to transactions from a specific segment
  • portfolioId - Apply to transactions from a specific portfolio
  • accountId - Apply to transactions from a specific account
  • merchantId - Apply to transactions to a specific merchant
  • transactionType - Apply to specific transaction types (CARD, WIRE, PIX, CRYPTO)
Scope hierarchy: More specific scopes take precedence. For example, an account-level limit is more specific than a segment-level limit.

Usage tracking

For DAILY and MONTHLY limits, Tracer tracks:
  • Current usage - Total amount consumed in the current period (in smallest currency unit)
  • Utilization percent - Percentage of limit used
  • Reset time - When the limit will reset to zero

How limits work

Limit check flow

When a transaction is validated, Tracer checks all applicable limits:
  1. Find limits - Query all active limits matching the transaction scope
  2. Calculate projected usage - Add transaction amount to current usage
  3. Compare threshold - Check if projected usage exceeds limit amount
  4. Return result - If any limit is exceeded, Tracer returns a DENY decision (your system should then block the transaction)

Example scenario

A corporate segment has a daily limit of R$ 50,000 (5,000,000 centavos):
{
  "name": "Daily Corporate Limit",
  "limitType": "DAILY",
  "maxAmount": 5000000,
  "currency": "BRL",
  "scopes": [
    {
      "segmentId": "corporate-segment-uuid",
      "transactionType": "CARD"
    }
  ]
}
If current usage is 4,500,000 (R45,000)andanewtransactionof800,000(R 45,000) and a new transaction of 800,000 (R 8,000) arrives:
  • Projected usage: 4,500,000 + 800,000 = 5,300,000 (R$ 53,000)
  • Limit: 5,000,000 (R$ 50,000)
  • Result: Tracer returns DENY decision (your system should block the transaction)
All monetary amounts in Tracer are expressed in the smallest currency unit (e.g., centavos for BRL, cents for USD). R$ 50,000.00 = 5,000,000 centavos.

Create a limit

Request

POST /v1/limits
X-API-Key: {api_key}
Content-Type: application/json
{
  "name": "Daily Corporate Limit",
  "limitType": "DAILY",
  "maxAmount": 5000000,
  "currency": "BRL",
  "scopes": [
    {
      "segmentId": "corporate-segment-uuid",
      "transactionType": "CARD"
    }
  ]
}

Response

{
  "limitId": "limit-uuid-123",
  "name": "Daily Corporate Limit",
  "limitType": "DAILY",
  "maxAmount": 5000000,
  "currency": "BRL",
  "scopes": [
    {
      "segmentId": "corporate-segment-uuid",
      "transactionType": "CARD"
    }
  ],
  "status": "DRAFT",
  "resetAt": "2026-01-31T00:00:00Z",
  "createdAt": "2026-01-30T10:00:00Z",
  "updatedAt": "2026-01-30T10:00:00Z"
}

Limit fields

FieldTypeRequiredDescription
namestringYesDescriptive limit name
limitTypeenumYesDAILY, MONTHLY, or PER_TRANSACTION
maxAmountint64YesMaximum amount in smallest currency unit (e.g., centavos)
currencystringYesISO 4217 currency code (e.g., BRL, USD)
scopesarrayYesAt least one scope required

Query limit usage

Monitor how much of a limit has been consumed in the current period.

Request

GET /v1/limits/{limitId}/usage
X-API-Key: {api_key}

Response

{
  "limitId": "limit-uuid-123",
  "limitAmount": 5000000,
  "currentUsage": 1500000,
  "utilizationPercent": 30.0,
  "nearLimit": false,
  "resetAt": "2026-01-31T00:00:00Z"
}

Usage fields

FieldDescription
limitAmountTotal limit configured (in smallest currency unit)
currentUsageAmount consumed in current period (in smallest currency unit)
utilizationPercentPercentage of limit used
nearLimitTrue when usage exceeds 80% of limit
resetAtWhen the limit resets (DAILY/MONTHLY only)
The nearLimit flag activates at 80% utilization, allowing proactive management before limits are exceeded.

Update a limit

Modify limit configuration. The limitType and currency fields are immutable and cannot be changed after creation.

Request

PATCH /v1/limits/{limitId}
X-API-Key: {api_key}
Content-Type: application/json
{
  "name": "Updated Daily Corporate Limit",
  "maxAmount": 7500000
}
Changing the limit amount does not reset current usage. If you reduce a limit below current usage, subsequent transactions will be denied until the period resets.

Limit lifecycle

Limits follow the same lifecycle as rules:

States

StateDescription
DRAFTLimit created but not active; can be modified freely
ACTIVELimit is checked during validations
INACTIVELimit is not checked; preserved for audit trail; can be reactivated
DELETEDPermanently removed; does not appear in listings

Transitions

OperationFromToDescription
Create-DRAFTLimits are created in DRAFT status by default
ActivateDRAFT, INACTIVEACTIVEStart checking this limit
DeactivateACTIVEINACTIVEStop checking this limit
DeleteDRAFT, INACTIVEDELETEDPermanently remove (cannot delete ACTIVE limits)

Best practices

Naming

  • Be descriptive - Include the scope and type in the name
  • Use consistent patterns - e.g., “Daily Limit”
Less clearMore clear
Limit 1Daily Corporate Card Limit
VIP limitMonthly VIP PIX Limit

Scope design

  • Start broad, refine as needed - Begin with segment-level limits, add account-level for exceptions
  • Avoid overlapping scopes - Multiple limits on the same scope can cause confusion
  • Use transaction types - Different payment methods may need different limits

Monitoring

  • Watch nearLimit flags - Proactively contact customers nearing limits
  • Review denied transactions - High denial rates may indicate limits are too restrictive
  • Adjust seasonally - Consider temporary limit increases during high-spending periods

Common errors

Limit creation

CodeMessageResolution
400Invalid limit configurationCheck amount is positive and scope is valid
400At least one scope field requiredInclude at least one scope field
400Invalid currency codeUse valid ISO 4217 code (BRL, USD, etc.)

Limit usage

CodeMessageResolution
404Limit not foundVerify the limit ID exists

Validation denials

When a transaction is denied due to limit exceeded:
{
  "decision": "DENY",
  "reason": "limit_exceeded",
  "limitUsageDetails": [
    {
      "limitId": "limit-uuid-123",
      "limitAmount": 5000000,
      "currentUsage": 4900000,
      "exceeded": true
    }
  ]
}

Quick reference

Endpoints

OperationMethodEndpoint
Create limitPOST/v1/limits
List limitsGET/v1/limits
Get limitGET/v1/limits/{limitId}
Update limitPATCH/v1/limits/{limitId}
Activate limitPOST/v1/limits/{limitId}/activate
Deactivate limitPOST/v1/limits/{limitId}/deactivate
Delete limitDELETE/v1/limits/{limitId}
Get usageGET/v1/limits/{limitId}/usage

Limit types

TypeResetUse case
DAILYMidnight UTCDaily spending caps
MONTHLY1st of monthMonthly budgets
PER_TRANSACTIONNoneSingle transaction limits

Scope fields

FieldTypeDescription
segmentIdUUIDFilter by segment
portfolioIdUUIDFilter by portfolio
accountIdUUIDFilter by account
merchantIdUUIDFilter by merchant
transactionTypeenumCARD, WIRE, PIX, CRYPTO