Overview
Matcher supports four matching patterns:
| Pattern | Description | Example |
|---|---|---|
| 1:1 | One source to one target | Single invoice payment |
| 1:N | One source to many targets | Bulk payment covering invoices |
| N:1 | Many sources to one target | Deposits consolidated at bank |
| N:M | Many sources to many targets | Complex netting |
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
| Context type | Allowed patterns |
|---|---|
1:1 | One source to one target only |
1:N | One source to many targets (split), or many sources to one target (aggregate) |
N:M | Any combination of sources and targets |
Rule allocation settings
All rule types accept allocation flags in theirconfig:
| Field | Type | Description |
|---|---|---|
allowPartial | Boolean | Allow partial allocation of transaction amounts |
allocationDirection | String | Allocation order: LEFT_TO_RIGHT or RIGHT_TO_LEFT |
allocationToleranceMode | String | How tolerance is measured: ABS (absolute) or PERCENT |
allocationToleranceValue | Decimal | Tolerance threshold for allocation residuals |
allocationUseBaseAmount | Boolean | Use base (converted) amount for allocation |
Example: tolerance rule with allocation
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 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):| ID | Amount | Reference |
|---|---|---|
| bank_001 | $15,000.00 | BULK-PAY-2024-001 |
| ID | Amount | Invoice |
|---|---|---|
| inv_001 | $5,000.00 | INV-2024-001 |
| inv_002 | $7,500.00 | INV-2024-002 |
| inv_003 | $2,500.00 | INV-2024-003 |
N:1 aggregate matching
Multiple source transactions match one target transaction.
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):| ID | Amount | Register |
|---|---|---|
| pos_001 | $1,250.00 | REG-01 |
| pos_002 | $980.00 | REG-02 |
| pos_003 | $1,770.00 | REG-03 |
| ID | Amount | Reference |
|---|---|---|
| bank_002 | $4,000.00 | DEPOSIT-20240120 |
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):| ID | Amount | Reference |
|---|---|---|
| pay_001 | $10,000.00 | IC-PAY-001 |
| pay_002 | $8,000.00 | IC-PAY-002 |
| ID | Amount | Reference |
|---|---|---|
| rec_001 | $12,000.00 | IC-REC-001 |
| rec_002 | $6,000.00 | IC-REC-002 |
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 match groups
cURL
View group details
cURL
Confirm a match group
cURL
Reject a match group
cURL
Revoke a confirmed match group
cURL
Matching algorithm
For N:M scenarios, Matcher uses deterministic sequential allocation to pair transactions.
How it works
- 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, partial matches are created; otherwise, unallocated transactions become exceptions.
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.

