- A context is a single reconciliation you care about. For example, “our main bank account vs. our books.” It sets the scope: which systems to compare and which rules apply.
- A source is one of the systems feeding numbers into that comparison: a bank statement, an ERP export, a payment processor’s settlement file, or a ledger.
What is a reconciliation context?
A reconciliation context defines the operational boundaries of a reconciliation process. It specifies:
- Which data sources to compare
- Which matching rules apply
- How to handle exceptions
- Bank Account 1234 vs General Ledger (daily bank reconciliation)
- Payment Gateway vs Revenue System (payment reconciliation)
- Intercompany Entity A vs Entity B (intercompany reconciliation)
Context types
Matcher lets you use different reconciliation cardinalities based on transaction structure.
One-to-one (1:1)
Matcher reconciles each transaction against a single counterpart. Typical use cases:- Bank statements
- Direct payment matching
One-to-many (1:N)
Matcher reconciles one transaction against multiple counterparts. Typical use cases:- Split payments
- Batch deposits
- Consolidated invoices
Many-to-many (N:M)
Matcher reconciles multiple transactions across multiple counterparts. Typical use cases:- Netting arrangements
- Complex payment allocation
- Multi-leg financial flows
Creating a reconciliation context
Once you know what you’re reconciling, create the context. At this stage you’re mainly declaring the cardinality (
type), a required execution label (interval), and any fee tolerance the comparison should allow. The interval value does not schedule runs. Automatic execution requires a separate reconciliation schedule.
Request
cURL
Context fields
string
Descriptive name for the context
string
Matching cardinality:
1:1, 1:N, or N:Mstring
Required execution label (e.g.
daily, weekly). It does not schedule runs.string
default:"0"
Absolute tolerance when Matcher compares an actual fee with the expected fee, as a decimal string (e.g.
"0.01")string
default:"0"
Relative tolerance for the same fee comparison, as a fraction in a decimal string (
"0.02" tolerates 2%)string
Optional fee normalization mode:
NET or GROSS. Omit it to leave fee normalization disabled.boolean
default:"false"
Automatically trigger a match run after a file upload
string
default:"SAME"
How the context’s data carries sign:
SAME or OPPOSITE. With SAME, a payment carries the same sign as what it settles, and a negative amount is a reversal. With OPPOSITE, a payment carries the opposite sign of the invoice it settles. After the context carries a partial balance, Matcher refuses a change with 409. It also refuses a change while a match run is in progress.integer
Optional aging limit for open items, in days (1 or more). In a
COMMIT run, an open-item balance older than this limit raises an AGED_BREAK exception. Omit it to disable aging. On update, 0 disables it.string
Optional business-day calendar for
agedBreakThresholdDays: US_FED or BR_ANBIMA. Omit it to count calendar days.Response
Running reconciliation
A context does not reconcile on its own. You trigger a match run. A run applies the context’s rules to the transactions in its sources, then produces matches and exceptions. You can trigger runs by hand, or let a schedule fire them automatically. Every run works in one of two modes:
Trigger a run for a context:
cURL
"async": true to submit the run and poll its progress instead. When asynchronous submission is unavailable, Matcher rejects "async": true with HTTP 503.
Both modes return HTTP 202 Accepted on success, so read the response
status to tell them apart.A synchronous run returns COMPLETED. When it fails, the request returns a problem response instead. An async run returns QUEUED, and you poll GET /v1/matching/runs/{runId}.While in flight, a run moves through PROCESSING and FINALIZING (treat both as not-yet-done) before reaching COMPLETED or FAILED.GET /v1/matching/contexts/{contextId}/runs.
What is a source?
A source represents a system or data feed that supplies transactions to a reconciliation context. Each context requires at least two sources. Typical sources include:
- Bank statement feeds
- ERP general ledger exports
- Payment processor transaction streams
- Internal accounting systems
Adding sources to a context
A context needs at least two sources, one for each side of the comparison. The
side field (LEFT or RIGHT) declares which side a source feeds. Matcher reconciles the LEFT side against the RIGHT side. Assign one side to each source and keep the assignment consistent.
Create a source with a name, type, side, and a config object. Leave config empty ({}) when the source needs no connection-specific settings, as with a bank feed on the LEFT side. The config object also holds import settings, such as duplicate detection:
cURL
RIGHT side:
cURL
name, type, and side are required (name is 1–50 characters). config is optional and defaults to an empty object when omitted.Source types
Discovery sources
FETCHER identifies a source type. Its config must carry connection_id, the id of a Discovery connection, and each connection backs one FETCHER source. Rows that the extraction engine pulls from that connection land in this source. To pull on a schedule, add a source binding on the query rail with the same connectionId.
cURL
Managing sources
Sources support a full CRUD lifecycle under
/v1/contexts/{contextId}/sources. You can rename or reconfigure a source at any time, and archiving is soft and reversible. An archived source is excluded from context readiness, matching, and the default source listing, but keeps its full history until you restore it. Archiving does not disable its bindings. Disable or delete them separately to stop scheduler dispatch.
Source bindings
Bindings define how the binding scheduler can pull source data without a manual file upload. A source binding ties a source to the rail that supplies its transactions, plus a duration that determines when it is due. Exactly one rail applies to each binding
kind:
file: fetches files via a transport (populatestransportConfig).query: pulls rows through a discovery-engine connection (populatesconnectionId). The rows land in theFETCHERsource whoseconfig.connection_idmatches, whatever source andformatthe binding names. See Discovery.
/v1/contexts/{contextId}/sources/{sourceId}/bindings.
Scheduled pulls run when Lerian enables the binding scheduler. A binding is dispatched only when it is enabled and due. Creating or enabling a binding does not run it immediately.
List returns every binding, enabled and disabled, so a disabled binding stays visible instead of silently vanishing.
Create a query-rail binding
cURL
Fields
string
required
Rail the scheduler pulls the source on:
file or query (required).string (UUID)
Query-rail discovery-engine connection. Required for
query, rejected for file.string
required
Declared format the binding produces (region/family-namespaced descriptor key, e.g.
br/cnab400/febraban-base).string
required
Go duration string the binding scheduler reads, such as
1h or 30m. Cron and @every syntax are invalid.boolean
Whether the scheduler can dispatch the binding when it is due. Defaults to
true. Enabling it does not run it immediately.Managing contexts
You can adjust a context’s settings, pause it, retire it, or copy it. These lifecycle operations preserve history so you never lose an audit trail.
Update a context
cURL
Pause a context
To temporarily keep a context out of reconciliation runs, update its status toPAUSED:
cURL
- Prevents new match runs
- Preserves historical data
- Allows future reactivation by setting status back to
ACTIVE
Archive a context
Archiving is a reversible soft-delete. Instead of permanently removing a context, it moves the context to theARCHIVED status, preserving its full history (sources, rules, match runs, and audit records) while excluding it from the default context listing.
cURL
- Sets the context status to
ARCHIVED - Preserves the complete history and audit trail
- Excludes the context from the default listing
- Is reversible at any time with the restore endpoint
Restore a context
Restoring reverses an archive. It moves the context fromARCHIVED back to DRAFT, so you can review and reconfigure the context before you reactivate it.
cURL
- Sets the context status from
ARCHIVEDback toDRAFT - Does not resume matching automatically. Review and reactivate the context to run reconciliation again
- Returns
409 Conflictif called on a context that is not archived
Clone a context
To duplicate an existing context with its sources, rules, fee rules, and field maps, use the clone endpoint. Use it to create templates. Cloned fee rules keep referencing the same fee schedules as the source context. Matcher does not copy the fee schedules themselves.cURL
ACTIVE status.
Context lifecycle
A reconciliation context follows a lifecycle that controls when matching can run and how data is preserved.
- A context starts in Draft, where you configure sources and settings.
- A context remains Draft until an explicit update sets it to
ACTIVE. Activation validates the required sources on bothLEFTandRIGHTsides, field mappings or CAMT options, match rules, and fee rules when you enable fee normalization. - An active context can be temporarily Paused to stop execution without affecting configuration or historical data.
- When you no longer need a context, move it to Archived with the archive endpoint. Archiving is a reversible soft-delete: it moves the context to
ARCHIVED, preserves the full history and audit records, and excludes it from the default listing. An archived context can be brought back to Draft at any time with the restore endpoint.
Lifecycle of a Matcher context
Best practices
Use descriptive names
Use descriptive names
Use explicit names that reflect accounts, systems, and purpose.
Start with conservative thresholds
Start with conservative thresholds
Favor accuracy over automation initially. Adjust thresholds based on observed results.
Separate concerns
Separate concerns
Use multiple contexts instead of a single broad reconciliation.
Next steps
Field mapping
Define how source fields map to Matcher’s schema.
Match rules
Configure the rules that drive reconciliation.

