Overview
The context type controls matching cardinality. Matcher supports three context types:
There is no separate
N:1 context type. The single transaction is always on the left side. For an aggregate, put the source that carries the consolidated entry on the left side.How it works
Two mechanisms control split and aggregate behavior:
- Context type: determines the matching cardinality (
1:1,1:N, orN:M). - Rule allocation flags: control how Matcher distributes amounts within a match group.
Context type mapping
Rule allocation settings
All rule types accept allocation flags in theirconfig. Matcher applies them in 1:N contexts:
Example: split rule with allocation
In a1:N context, each right-side transaction must pass the rule’s checks against the left-side transaction. A rule that compares amounts matches only legs equal to the whole, so a split rule turns matchAmount off and lets allocation check the total. TOLERANCE rules always compare amounts.
cURL
Creating a 1:N context
To enable split or aggregate matching, create a context with type
1:N:
cURL
1:N split matching
One left-side transaction matches many right-side transactions.
Common use cases
- Bulk payment: Single wire covering multiple invoices
- Payroll: One bank debit for multiple salary payments
- Settlement: One gateway payout for multiple orders
Example: bulk invoice payment
Left side (Bank Statement):
Right side (Ledger Entries):
Result: 1:3 match with full allocation
Aggregate matching (many-to-one)
Many transactions match one consolidated transaction. This uses the
1:N context type with the consolidated source on the left side. There is no separate N:1 type.
Common use cases
- Bank deposits: Multiple checks deposited as one credit
- Card settlements: Daily batch of transactions as one deposit
- Cash consolidation: Multiple register receipts to one deposit
Example: consolidated deposit
Right side (Point of Sale):
Left side (Bank Statement):
Result: 3:1 match with full allocation
N:M many-to-many matching
Multiple source transactions match multiple target transactions. This is the most complex pattern.
Common use cases
- Intercompany netting: Multiple invoices netted against multiple payments
- Trade settlements: Complex clearing with partial fills
- Revenue recognition: Multiple deliveries against multiple advances
Example: intercompany netting
Sources (Company A Payables):
Targets (Company A Receivables):
Result: 2:2 match, $18,000 total matched
To enable N:M matching, create a context with type
N:M:
cURL
Running and reviewing matches
After configuring the context and rules, trigger a matching run and review the resulting groups.
Run matching
cURL
DRY_RUN run reports its statistics but stores no match groups. To list match groups, run with COMMIT.
View match run history
cURL
View a run’s match groups
You must send thecontextId query parameter. The response is a cursor-paginated list of match groups, each containing its matched transactions (across all cardinalities) and confidence scores.
cURL
Break (unmatch) a match group
To reverse an incorrect group, unmatch it. Matcher rejects aPROPOSED group and revokes a CONFIRMED group. In both cases, its transactions return to UNMATCHED. Revoking a CONFIRMED group also withdraws its open-item residuals, voids its fee variances, and withdraws the exceptions it raised, in the same transaction. You must send the contextId query parameter and a reason in the body.
cURL
Matching algorithm
The algorithm depends on the context type.
1:N deterministic sequential allocation
For split and aggregate (1:N) scenarios, Matcher uses deterministic sequential allocation:
- Sort: Matcher sorts transactions deterministically to ensure reproducible results across runs.
- Collect: For each left-side transaction, Matcher collects the right-side transactions that pass the rule’s checks against it.
- Allocate: Matcher allocates the collected transactions in sort order and stops when the remaining amount is within the allocation tolerance. It skips a transaction in another currency. It allocates only transactions with the settling sign of the context’s
signConvention: the sign of the left-side transaction underSAME(the default), the opposite sign underOPPOSITE. - Track residuals: Matcher tracks any remaining unallocated amounts. If
allowPartialistrue, Matcher caps an overshooting leg to the remaining amount. An under-covered split still surfaces a diagnostic exception.
N:M set-matching solver
ForN:M scenarios, Matcher does not allocate sequentially. It uses a bounded subset-selection solver. The solver buckets candidates by the rule’s match identity. It then searches for a subset of left transactions and a subset of right transactions that reconcile against each other.
A group holds at most 4 transactions per side. Matcher skips a bucket that holds more than 40 transactions on either side. Only EXACT and TOLERANCE rules run in N:M contexts.
Selection remains deterministic over the sorted input. Each proposed group must clear the fixed confidence gate (minimum score 60). No transaction lands in two proposed groups within a run. On TOLERANCE rules, the nmDeductionBand key lets the solver admit a payment subset that under-pays an invoice subset within the band.
Exception reasons
Transactions that Matcher cannot fully reconcile surface as typed exceptions:SPLIT_INCOMPLETE: allocations exist but do not fully cover the target amount, regardless ofallowPartial.OVER_SETTLED: a transaction over-settled an obligation that an earlier run carried open. Matcher surfaces the over-settled remainder as a typed break.
reason values.
Best practices
Start with 1:N before N:M
Start with 1:N before N:M
Many-to-many matching is complex. Start with simpler patterns and enable N:M only when necessary.
Use allocation tolerance for rounding
Use allocation tolerance for rounding
Small rounding differences are common in split payments. Set allocationToleranceValue to a few cents to avoid false exceptions.
Enable partial allocation deliberately
Enable partial allocation deliberately
Set allowPartial to true only when you expect partial matches. This prevents false matches from incomplete data.
Dry-run before committing
Dry-run before committing
Always test split and aggregate matching in DRY_RUN mode first, and read the run statistics. A dry run stores no match groups.
Monitor residuals
Monitor residuals
Track residual amounts over time. Growing residuals may indicate systematic matching issues.
Next steps
Match Rules
Configure rules and allocation settings.
Security
Security and access control.

