Overview
Matching cardinality is controlled by the context type. Matcher supports three context types:
There is no separate
N:1 context type. Aggregate matching (many sources to one target) is simply the 1:N context type applied in the aggregate direction — the same context type covers both split and aggregate.How it works
Split and aggregate behavior is controlled by two mechanisms:
- Context type — determines the matching cardinality (
1:1,1:N, orN:M). - Rule allocation flags — control how amounts are distributed within a match group.
Context type mapping
Rule allocation settings
All rule types accept allocation flags in theirconfig:
Example: tolerance rule with allocation
cURL
matchScore and matchBaseScore are accepted and validated but reserved/inert — they do not change the calculated confidence score. Confidence is always computed from the fixed internal component weights (amount 40, currency 30, date 20, reference 10). See Confidence scoring.Creating a 1:N context
To enable split or aggregate matching, create a context with type
1:N:
cURL
1:N split matching
One source transaction matches multiple target 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
Source (Bank Statement):
Targets (Ledger Entries):
Result: 1:3 match with full allocation
Aggregate matching (many-to-one)
Multiple source transactions match one target transaction. This is the aggregate direction of the
1:N context type — it is not a 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
Sources (Point of Sale):
Target (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
View match run history
cURL
View a run’s match groups
ThecontextId query parameter is required. 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. This rejects the group with a reason and reverts all of its transactions toUNMATCHED. The contextId query parameter is required, and a reason is sent 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: Transactions are sorted deterministically to ensure reproducible results across runs.
- Iterate: The engine walks through candidates in priority order.
- Allocate: Amounts are distributed according to the
allocationDirectionsetting (LEFT_TO_RIGHTorRIGHT_TO_LEFT). - Track residuals: Any remaining unallocated amounts are tracked. If
allowPartialistrue, an overshooting leg is capped 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: candidates are bucketed by the rule’s match identity, and the solver searches for a subset of left transactions and a subset of right transactions that reconcile against each other, with cardinality capped per side. Selection is deterministic over the sorted input, each proposed group must clear the fixed confidence gate (minimum score 60), and 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 cannot be fully reconciled surface as typed exceptions:SPLIT_INCOMPLETE— allocations exist but do not fully cover the target amount, regardless ofallowPartial.OVER_SETTLED— a leg over-shot what it was settling; the over-settled remainder is surfaced 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
Only set allowPartial to true when partial matches are expected. 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 to verify allocation results.
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.

