> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Reconciliation

> Match your own records against banks, PSPs, and ERPs without spreadsheets, and close the month with an audit trail.

Every financial institution compares its own records against bank statements, payment processors, and ERPs. Most teams do that work in spreadsheets.

A Lerian reconciliation is one engine plus the pieces you choose around it. Matcher compares two independent datasets and reports what agrees, what does not, and why. It reconciles Midaz data, another ledger's data, or two external feeds with no ledger at all. Data reaches Matcher through file uploads, scheduled pulls, and aggregator webhooks. You send what does not match to the ticketing tools your team already runs.

## What you get

***

<Columns cols={2}>
  <Card title="Matcher" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/matcher-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=7fae0f09ee6ed8638a2175a2e84e0711" href="/en/matcher/what-is-matcher" width="270" height="270" data-path="images/icons/matcher-yellow.png">
    Matcher applies exact or tolerance rules, scores every match from 0 to 100, and turns what it cannot pair into an exception. Matcher's embedded extraction engine pulls transactions from external systems, so nobody moves a file by hand.
  </Card>

  <Card title="Streaming Hub" icon="tower-broadcast" href="/en/streaming-hub/what-is-streaming-hub">
    Streaming Hub delivers Matcher facts, such as a completed match run, to a webhook, a queue, or a cursor you pull. It can also deliver platform events into Matcher through a signed webhook you turn on.
  </Card>

  <Card title="Midaz" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/midaz-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=66030808cf88e9836f58b228bdb04718" href="/en/midaz/what-is-midaz" width="270" height="270" data-path="images/icons/midaz-yellow.png">
    Midaz is the ledger whose exports become one side of a reconciliation. The two products stay separate services, and no connector runs between them.
  </Card>

  <Card title="Lender" icon="https://mintcdn.com/lerian-49cb71fc/47c4N7ZVIXfTkwUf/images/icons/core-banking-yellow.png?fit=max&auto=format&n=47c4N7ZVIXfTkwUf&q=85&s=05a04a8e503c01720a0d7e20fdd752ef" href="/en/lender/what-is-lender" width="1250" height="1250" data-path="images/icons/core-banking-yellow.png">
    Lender consumes the verdict of a completed match run and translates it into a loan servicing action.
  </Card>
</Columns>

## How the pieces fit together

***

Matcher sits between the data you feed it and the systems that act on the result.

```mermaid theme={null}
flowchart LR
  Bank["Bank statements<br/>CSV, OFX, CNAB, camt.053"]
  PSP["Gateways and ERPs<br/>Stripe, Adyen, SAP"]
  Agg["Open Finance aggregators<br/>Pluggy, Belvo"]
  Midaz["Midaz ledger<br/>your system of record"]
  Matcher["Matcher<br/>rules, scores, exceptions"]
  Tools["JIRA, ServiceNow,<br/>your own endpoint"]
  AI["Your AI client<br/>over MCP"]
  Hub["Streaming Hub<br/>the delivery edge"]
  Lender["Lender<br/>loan servicing"]
  Sink["Your webhook or queue"]
  Bank -.->|"upload or transport fetch"| Matcher
  PSP -->|"the extraction engine pulls"| Matcher
  Agg -.->|"webhook signals new data"| Matcher
  Midaz -.->|"export, then import as a LEDGER source"| Matcher
  AI -->|"MCP tools"| Matcher
  Matcher -->|"you dispatch an exception"| Tools
  Matcher -.->|"facts on lerian.streaming.matcher"| Hub
  Matcher -.->|"match_run.completed"| Lender
  Hub -.->|"webhook, queue, or pull"| Sink
  Hub -.->|"signed webhook, off by default"| Matcher
  classDef lerian fill:#fff8e1,stroke:#f4b400,color:#333;
  classDef yours fill:#e8f0fe,stroke:#4285f4,color:#333;
  classDef ext fill:#f1f3f4,stroke:#9aa0a6,color:#333;
  class Matcher,Midaz,Hub,Lender lerian;
  class AI,Tools,Sink yours;
  class Bank,PSP,Agg ext;
```

1. You define two sources, one on each matching side. A file you upload, a transport Matcher fetches, an engine extraction, or an aggregator webhook all feed a source.
2. Ledger data arrives the same way. You export the period from Midaz and import it as a source of type `LEDGER`. No live connector exists.
3. Matcher applies your rules and scores every candidate from 0 to 100. It confirms an exact or tolerance match that scores 90 or above.
4. A fuzzy match or a date-lag match always waits for a person. Items with no counterpart become exceptions, classified by amount, age, and source signals.
5. You dispatch an exception to JIRA, ServiceNow, or an HTTP endpoint you configure. Each request names its own target, so Matcher escalates nothing on its own.
6. Matcher publishes its facts on `lerian.streaming.matcher`. Streaming Hub delivers them to your webhook, your queue, or your pull cursor.
7. Matcher records each audited change in an append-only audit log. Nobody can edit or remove an entry.

Streaming Hub can also deliver platform events into Matcher. Those deliveries land on one signed endpoint that deduplicates by event id and stays off until you turn it on. Matcher consumes no Kafka events.

## What each piece owns

***

| Piece                                 | Source of truth for                                               | Talks to                                                                    | You keep                                                    |
| ------------------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------- |
| Matcher                               | match rules, runs, exceptions, disputes, the audit log            | your sources over HTTP, and the tool you dispatch to                        | your ledger untouched. Matcher opens no connection to Midaz |
| The extraction engine, inside Matcher | its connections to external systems, and every extraction you run | databases, gateways, and aggregators                                        | your credentials to those systems                           |
| Midaz                                 | balances, accounts, transactions                                  | nothing inside Matcher. Data moves by export and import                     | your ledger in your own database                            |
| Streaming Hub                         | which Matcher facts reach which destination                       | the Matcher topic, your sinks, and the optional signed ingress into Matcher | your sinks and your signing secrets                         |
| Lender                                | the servicing action taken on a verdict                           | consumes `match_run.completed` from Matcher's topic                         | your credit decisions                                       |

## Adopt it one piece at a time

***

<Steps>
  <Step title="Start with any two sources">
    Reconcile a bank file against an ERP export. Matcher runs as a stand-alone product, with no ledger and no other Lerian product beside it.
  </Step>

  <Step title="Add your ledger">
    Export the period you want to reconcile and import it as a source of type `LEDGER`. Midaz or another ledger both arrive this way, because Matcher depends on neither. See [Matcher and Midaz](/en/matcher/integrations/matcher-midaz-integration) for the export and import flow.
  </Step>

  <Step title="Automate the pulls">
    Register a connection with the extraction engine, then create extractions instead of uploading files by hand. For Open Finance data, connect a Pluggy or Belvo account and mint a webhook token for it.
  </Step>

  <Step title="Route the exceptions">
    Point Matcher at JIRA, ServiceNow, or your own endpoint. Configure the dispatch target first, because dispatch fails without it. Verify the HMAC signature on every delivery you receive.
  </Step>

  <Step title="Close the loop">
    Subscribe to Matcher facts in Streaming Hub. When you also run credit, Lender consumes `match_run.completed` and moves the loan's servicing stage. See the [loan management solution](/en/solutions/loan-management-system).
  </Step>
</Steps>

## Bring your own

***

* **Any ledger.** Matcher works with Midaz or with another ledger, and it depends on neither.
* **Any source format.** CSV, JSON, XML, ISO 20022 camt.053, plus regional layouts such as CNAB, OFX, and acquirer EDI files.
* **Your ticketing tools.** Dispatch targets are JIRA, ServiceNow, and your own HTTP webhook.
* **Your AI client.** The [Matcher MCP server](/en/matcher/mcp/matcher-mcp-overview) speaks Streamable HTTP and relays your bearer token without logging or storing it.
* **Your reconciliation screens.** The [Matcher UI](/en/matcher/ui/matcher-module) ships as its own web application beside the Matcher API.

## A worked example

***

This example reconciles one day of Pix against the BACEN settlement extract. The full walkthrough lives in [Pix reconciliation](/en/matcher/use-case-guides/matcher-pix-reconciliation).

1. Source A holds the day's committed Pix transactions, exported from Midaz. Source B holds the BACEN SPI settlement extract.
2. Both field maps point `external_id` at the `endToEndId`. That value links a Midaz transaction to its BACEN settlement record.
3. The first rule compares reference, amount, currency, and date, and scores 100.
4. A Pix started at 23:58 settles at BACEN the next day. The date-lag rule pairs it at 85, and that pair always goes to the review queue.
5. A Midaz transaction with no BACEN entry becomes an exception. So does a BACEN entry with no Midaz transaction.
6. A refund carries the original end-to-end id and a new return identification. Matcher pairs it against the BACEN extract on those identifiers.

## Start here

***

<Columns cols={3}>
  <Card title="What is Matcher?" icon="https://mintcdn.com/lerian-49cb71fc/fChpL6UWCA02zfZr/images/icons/matcher-yellow.png?fit=max&auto=format&n=fChpL6UWCA02zfZr&q=85&s=7fae0f09ee6ed8638a2175a2e84e0711" href="/en/matcher/what-is-matcher" width="270" height="270" data-path="images/icons/matcher-yellow.png">
    The reconciliation engine: rules, confidence scores, exceptions, and audit trails.
  </Card>

  <Card title="Matcher quick start" icon="https://mintcdn.com/lerian-49cb71fc/E8ayMkxDRO5pydGF/images/icons/code-yellow.png?fit=max&auto=format&n=E8ayMkxDRO5pydGF&q=85&s=5ff68ec60f9a6219649dc6d0457b5fa6" href="/en/matcher/getting-started/matcher-quick-start" width="1249" height="1249" data-path="images/icons/code-yellow.png">
    Run a first reconciliation, then review the matches and the exceptions it produces.
  </Card>

  <Card title="Matcher concepts" icon="diagram-project" href="/en/matcher/matcher-concepts">
    Contexts, sources, field maps, rules, and matches, the five things you configure.
  </Card>
</Columns>
