Pix transaction flows
Understanding how Pix transactions flow through the system is essential for configuring reconciliation correctly. The two flows below show what Matcher needs to reconcile on each side.
Pix sent (cash-out)
Cash-out flow: from client initiation through SPI settlement to reconciliation in Matcher.
- Client initiates Pix — The end user triggers a Pix payment via the app or API.
- Plugin creates initiation — The Pix plugin creates an initiation record and resolves the destination account via DICT lookup.
- Plugin processes payment — The plugin debits the client account in Midaz (transaction in
pendingstatus) and sends the payment instruction to SPI. - Settlement confirmed — SPI sends a webhook confirming settlement. The Midaz transaction is committed.
- Matcher reconciles — Matcher compares the committed Midaz transaction against the corresponding entry in the BACEN SPI settlement extract.
Pix received (cash-in)
Cash-in flow: from inbound SPI notification through Midaz credit to reconciliation in Matcher.
- Inbound Pix arrives — SPI sends a synchronous webhook containing the inbound Pix data.
- Plugin validates — The Pix plugin validates the payload and approves the transaction.
- Credit transaction created — The plugin creates a CREDIT transaction in Midaz for the recipient account.
- Settlement confirmed — The settlement webhook confirms the transaction is final.
- Matcher reconciles — Matcher compares the Midaz credit transaction against the corresponding entry in the BACEN SPI settlement extract.
Configuration step-by-step
Create the context
1:1 because each Pix transaction has exactly one corresponding BACEN settlement entry."0".Setting autoMatchOnUpload to false gives you control over when matching runs, which is important when you need both sources ingested before executing.Create the sources
LEDGER):LEDGER is Matcher’s category for internal ledger data — it is not a live Midaz connector. You export the day’s Pix transactions from Midaz (including the endToEndId metadata as a flat column) and upload the export to this source, manually or via an automated pipeline. See Matcher and Midaz for the export/import flow.Source B — BACEN SPI extract (type CUSTOM):CUSTOM because the SPI settlement file is uploaded manually or via an automated pipeline each day.Each source must declare a side (LEFT or RIGHT). A context reconciles its LEFT source against its RIGHT source, so assign one side to Midaz and the other to BACEN and keep the assignment consistent across both sources.Create field maps
{ "<canonicalKey>": "<sourceColumn>" }. The keys come from Matcher’s closed canonical vocabulary (external_id, amount, currency, date, and optional description, fee_amount, fee_currency); the values are the raw column names in each source. Lookups are flat — a mapping value must name a top-level column in the row, so the Midaz export must carry endToEndId as its own flat column (see Matcher and Midaz — custom field mapping).The following table shows how each canonical field maps to the column in each source:Create match rules
endToEndId is unique per Pix transaction across the entire ecosystem. When the reference, amount, currency, and date all match, it is a confirmed reconciliation with maximum confidence. Note that caseInsensitive is set to false because endToEndId values are case-sensitive, and referenceMustSet is true to ensure both sides carry the endToEndId before comparing — this prevents false positives on amount and date alone.Rule 2 — Date tolerance fallback (priority 51):endToEndId comparison is handled by Rule 1.Activate and schedule
Daily operation
Once configured, the daily reconciliation workflow follows five steps.
Upload BACEN extract
Upload the Midaz export
endToEndId metadata as a flat column — and upload the export to the Midaz source the same way. This step is usually automated by the same pipeline. See Matcher and Midaz for the export/import flow.Matcher runs at 07:00 (or manually)
DRY_RUN first to preview results without committing them. When satisfied, run again with COMMIT:Review results
Resolve exceptions
Practical example — one day of data
The following example illustrates a complete reconciliation run for March 17, 2026.
Midaz transactions (Source A)
BACEN SPI extract (Source B)
Match results
Analysis
- txn-001 and txn-002: Exact match on endToEndId, amount, currency, and date. Rule 1 resolved these with confidence score 100.
- txn-003: Pix initiated at 23:58, settled in BACEN on 2026-03-18. Rule 2 (DATE_LAG with 1-day window) paired this with confidence score 85. Date-lag matches never auto-confirm — the pair lands in the review queue for a human to confirm.
- txn-004: Present in Midaz but absent from BACEN. Possible settlement failure or SPI timeout. Investigate the transaction status via the Pix plugin.
- liq-8804: Present in BACEN but absent from Midaz. An inbound Pix that was not processed. Check webhook delivery or reprocess the message.
Handling Pix exceptions
The following table covers the most common Pix exception scenarios and recommended actions.
Force match
When you have confirmed that two records represent the same Pix transaction but Matcher could not match them automatically, use force match.Ignore transaction
When a transaction should be excluded from reconciliation (for example, a duplicate entry or an already-reversed Pix), mark it as ignored.Pix refunds (devoluções)
Pix refunds generate reverse transactions that also need reconciliation. When a refund is processed, the Pix plugin creates a new transaction in Midaz with:
- The
originalEndToEndIdlinking back to the original Pix transaction - A new
returnIdentification(rtrId) that uniquely identifies the refund in SPI
POST /v1/transfers/{id}/refunds is a Pix plugin endpoint, not a Matcher endpoint. Matcher does not initiate transfers or refunds — it only reconciles the resulting transactions. Each refund carries the originalEndToEndId and a new returnIdentification for end-to-end tracking, which Matcher then uses to match the refund against BACEN’s settlement extract. For refund initiation, see the Pix plugin documentation.Best practices
Use endToEndId as the primary reference
Use endToEndId as the primary reference
endToEndId is the unique Pix identifier across the entire ecosystem — from the initiating institution through SPI to the receiving institution. Ensure it is stored in Midaz transaction metadata and present in the BACEN extract. Without it, reconciliation falls back to amount and date matching, which is far less reliable.Run reconciliation the following day
Run reconciliation the following day
Separate Pix IN and Pix OUT for high volume
Separate Pix IN and Pix OUT for high volume
Monitor match rate
Monitor match rate
Zero tolerance is the default
Zero tolerance is the default
feeToleranceAbs and feeTolerancePct at zero.Preview before committing
Preview before committing
DRY_RUN before COMMIT, especially after rule or field map changes. This lets you review match results and catch configuration errors before they affect production data.Key metrics
Track these metrics to monitor the health of your Pix reconciliation process.

