This flow is a suggested reading of the BACEN manuals for Pix. The manuals prevail over this page. Your institution, as the participant, validates the flow and implements it on the Lerian APIs. See how to read the diagrams.
Participants
- Your institution. The Pix participant. It calls the Pix Lerian API and receives its events.
- Pix Lerian. Connects Midaz to Lerian SPI. It posts the Pix in Midaz and hands the payment to Lerian SPI.
- Midaz. The ledger that holds the accounts of your customers.
- Lerian SPI. Exchanges the Pix messages with SPI.
- SPI. The BACEN instant payment system. It settles each Pix.
Before you start
- The account that sends or receives the Pix exists in Midaz, is active, and has a holder.
- Your systems receive the Pix Lerian events. See Pix Lerian events.
- The Pix ledger in Midaz has
overrides.allowFeeSkipon. A received Pix never pays a fee.
Diagram
Send a Pix
Receive a Pix
Rules
Send a Pix
- The initiation stays open for 5 minutes. After that, step 5 answers
422withPIX-0321. - A static QR code with an amount sets the amount of the transfer. At step 5, leave out the amount, or send the same amount.
- The debit in Midaz is not the settlement. The transfer is final only at the event of step 13.
Receive a Pix
- Pix Lerian refuses a Pix to an account that it does not find or that is not active. It also refuses a Pix when the holder does not match. Midaz records nothing for a refused Pix.
- Pix Lerian credits the account only after SPI confirms the settlement.
- A credit that Midaz does not confirm is parked, not dropped. Pix Lerian publishes
inbound_transfer.credit_parked, and your back office credits the Pix withPOST /transfers/{id}/credit. - When Pix Lerian does not answer within the SPI time limit, Lerian SPI refuses the Pix.
How you know it finished
- Send a Pix. Pix Lerian publishes
outbound_transfer.completedoroutbound_transfer.rejected.GET /transfers/{id}shows the same status. - Receive a Pix. Pix Lerian publishes
inbound_transfer.completed. For a parked credit, it publishesinbound_transfer.credit_parkedfirst, andinbound_transfer.completedafter the credit call completes.
What can go wrong
The Pix Lerian error list describes each code.

