Skip to main content
Matcher lets you reconcile transactions in different currencies by converting amounts to a common base currency before comparison. This enables matching across international transactions, treasury operations, and multi-entity reconciliations.

Overview


Multi-currency matching converts both transaction amounts to a base currency using the appropriate FX rate, then applies standard matching rules. If the converted amounts fall within tolerance, Matcher creates a match. Otherwise, it creates an exception for review.
Multi-currency matching flow.

How it works


Multi-currency support is built into the existing context types (1:1, 1:N, N:M) and match rules — there is no separate “multi-currency” context type. When transactions have different currencies, Matcher uses the amountBase and currencyBase fields on each transaction to compare converted amounts. The FX conversion happens at ingestion time or through an external FX source.

Key components

ComponentWhere it livesPurpose
amountBase / currencyBaseTransaction fieldsPre-converted amounts for comparison
matchBaseAmount / matchBaseCurrencyRule configTell a rule to compare base amounts instead of originals
rateIdContextReference to the FX rate used for conversion
FXSource interfaceIntegration portPluggable interface for fetching exchange rates

Configuring rules for multi-currency


Enable multi-currency comparison by setting matchBaseAmount and matchBaseCurrency to true in the rule config.

Exact rule with base amount matching

cURL
curl -X POST "https://api.matcher.example.com/v1/config/contexts/{contextId}/rules" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
   "type": "EXACT",
   "priority": 1,
   "config": {
     "matchBaseAmount": true,
     "matchBaseCurrency": true,
     "matchDate": true,
     "matchReference": false,
     "matchScore": 100,
     "matchBaseScore": 90
   }
 }'
When matchBaseAmount is true, the rule compares amountBase fields instead of amount. When matchBaseCurrency is true, it compares currencyBase instead of currency.

Tolerance rule with base amount matching

cURL
curl -X POST "https://api.matcher.example.com/v1/config/contexts/{contextId}/rules" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
   "type": "TOLERANCE",
   "priority": 2,
   "config": {
     "matchBaseAmount": true,
     "matchBaseCurrency": true,
     "percentTolerance": 0.02,
     "absTolerance": 10.0,
     "matchScore": 85,
     "matchBaseScore": 80
   }
 }'

Confidence scoring

When a rule matches on base amounts, the confidence score uses matchBaseScore instead of matchScore. This allows you to assign lower confidence to FX-converted matches to reflect the additional uncertainty.
Match typeDefault score
Original amount matchmatchScore (e.g. 100 for EXACT)
Base amount matchmatchBaseScore (e.g. 90 for EXACT)

FX source integration


Matcher defines an FXSource port interface for fetching exchange rates at runtime. You can implement this interface to connect any FX rate provider to Matcher.
// FXSource port interface (internal/matching/ports/fx_source.go)
type FXSource interface {
    GetRate(ctx context.Context, from, to string, date time.Time) (Rate, error)
}

Using the FX source

  1. Implement the FXSource interface with your preferred rate provider.
  2. Register the implementation at application startup.
  3. Set rateId on the context to reference the rate configuration.
The FX source integration is optional. If not configured, multi-currency matching relies on pre-converted amountBase and currencyBase fields provided at ingestion time.

Transaction fields


For multi-currency matching, transactions should include both original and base currency fields:
FieldTypeDescription
amountDecimalOriginal transaction amount
currencyStringOriginal ISO 4217 currency code
amountBaseDecimalAmount converted to base currency
currencyBaseStringBase currency ISO 4217 code

Example transaction

{
  "transaction_id": "txn_001",
  "amount": 1000.00,
  "currency": "EUR",
  "amountBase": 1085.00,
  "currencyBase": "USD",
  "date": "2024-01-15",
  "reference": "PAY-2024-001"
}

Example: cross-currency reconciliation


Source (EUR account):
IDAmountCurrencyBase AmountBase Currency
txn_0011,000.00EUR1,085.00USD
Target (USD account):
IDAmountCurrencyBase AmountBase Currency
txn_0021,095.00USD1,095.00USD
With a TOLERANCE rule (matchBaseAmount: true, percentTolerance: 0.02):
  • Base amounts: 1,085.00vs1,085.00 vs 1,095.00
  • Variance: $10.00 (0.92%)
  • Tolerance: 2%
  • Result: Match (0.92% < 2%)

Best practices


Populate amountBase and currencyBase during file upload or ingestion. This avoids runtime FX lookups and ensures reproducible results.
Set matchBaseScore lower than matchScore so that FX-converted matches receive lower confidence, flagging them for review when appropriate.
FX conversions introduce small variances. Use TOLERANCE rules with matchBaseAmount to allow for rounding and rate timing differences.
Use a consistent base currency across all contexts. USD is common for international operations; use your reporting currency for domestic + international.

Next steps