Skip to main content
Fee rules define how Matcher calculates and applies fees during the reconciliation process. Use fee rules to model transaction fees, service charges, and expected deductions that affect matching outcomes.

What fee rules solve


Reconciliation fails when one side of a transaction includes fees or charges that the other side doesn’t record. A payment gateway deducts a processing fee before settling. A bank charges a wire transfer fee. An acquirer nets fees against payouts. Without fee rules, Matcher treats these differences as amount mismatches and generates exceptions — even when the difference is expected and documented. Fee rules tell Matcher what fees to anticipate, so it can match correctly despite the amount difference.

How fee rules work


Fee rules are attached to a reconciliation context. When Matcher runs, it evaluates applicable fee rules and adjusts expected amounts before comparing transactions across sources. This adjustment happens before match rule evaluation. A transaction that would otherwise fall outside tolerance can match cleanly once the known fee is accounted for. Fee rules reduce false exceptions caused by predictable, recurring charges. Instead of manually resolving hundreds of expected fee differences each day, your team focuses on real discrepancies.

Fee rule structure


FieldDescription
NameDescriptive label for the fee rule. Use names that identify the fee origin (e.g., “Gateway processing fee”).
TypeThe category of fee: processing, service_charge, wire_fee, acquirer_fee, or custom.
Calculation methodHow the fee is computed: flat (fixed amount) or percentage (percentage of transaction amount).
Amount / RateThe fee value. For flat fees, the fixed amount. For percentage fees, the rate (e.g., 2.5 for 2.5%).
Applied toWhich side of the match to adjust: the source transaction, the target transaction, or both.
ConditionsOptional filters that restrict when the rule applies — by source, amount range, currency, or transaction type.
ActiveWhether the rule is currently in use. Inactive rules are retained but not evaluated.

Creating a fee rule


This example creates a fee rule for a payment gateway that deducts a 2.5% processing fee from settlements before crediting the merchant account.
curl -X POST "https://api.matcher.example.com/v1/config/contexts/{contextId}/fee-rules" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Gateway processing fee — 2.5%",
    "type": "processing",
    "calculationMethod": "percentage",
    "rate": 2.5,
    "appliedTo": "target",
    "conditions": {
      "sourceId": "src_gateway_001",
      "currencyCode": "BRL"
    },
    "active": true
  }'
API Reference: Create fee rule

Managing fee rules


OperationDescription
List fee rulesRetrieve all fee rules for a context, with optional filters.
Retrieve a fee ruleGet the full configuration of a specific fee rule by ID.
Update a fee ruleModify rate, conditions, or status without recreating the rule.
Delete a fee ruleRemove a fee rule permanently. Consider deactivating instead to preserve audit history.

Best practices


Identify the fee types that generate the most exceptions today. Model those first. A single well-configured fee rule covering a common charge eliminates more manual work than five rules covering edge cases.
Names like “Gateway processing fee — 2.5%” are more useful than “Fee rule 1”. When reviewing exceptions or auditing matches, a clear name tells the story without opening the configuration.
Fee rates change when payment contracts are renegotiated. A fee rule with an outdated rate generates exceptions instead of preventing them. Schedule a quarterly review — or trigger one whenever a payment partner contract is renewed.
A fee rule without conditions applies to all transactions in the context. Narrow rules with source filters, currency codes, or amount ranges prevent unintended adjustments. Broad rules are harder to audit.
Before activating a new fee rule in production, run it against a sample of recent transactions. Confirm it resolves the expected exceptions without creating new ones. Deactivate rather than delete rules you’re not sure about — you can reactivate without reconfiguring.

Next steps


Match rules

Confidence scoring accounts for fee adjustments when evaluating match quality.

Exception routing

Route the exceptions that fee rules don’t cover to the right teams.

Fee rules API reference

Full API reference for fee rule endpoints.