This page suggests one way to read the BACEN manuals for Pix. The partner’s documentation and 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.
Pix through JD
Participants
- Your institution. Calls the Pix JD API and reads the result of each payment.
- Pix JD. Posts each Pix in Midaz and exchanges the orders with JD.
- Midaz. The ledger that holds the accounts of your customers.
- SPI. The BACEN instant payment system. It settles each Pix.
- JD. The partner that exchanges the Pix messages with SPI.
Before you start
- Pix JD is set up for your institution. See Setting up the rail.
- The account that sends, receives or returns the Pix exists in Midaz and has a holder.
Send a Pix through JD
Receive a Pix through JD
Return a received Pix through JD
Rules for JD
Send a Pix
- The
X-Idempotencyheader is required. A new key is a new payment. - When the payee has an account at your institution, the payment does not go to SPI, and step 7 can answer
EXECUTED. - The reservation in Midaz is not the settlement. The payment is final only when it is
EXECUTEDorERROR.
Receive a Pix
- When JD sends the same notice again, Pix JD does not credit the Pix again.
Return a received Pix
- The holder of
accountIdmust be the payee of the Pix. - The return
codeisBE08,FR01,MD06orSL02. - You can return parts of a Pix more than once. Together, the returns cannot pass the amount of the Pix.
- A return is a new transaction with its own
id. The received Pix staysEXECUTED.
How you know it finished with JD
- Send a Pix.
GET /v1/transactions/{transactionId}showsEXECUTEDorERROR. - Receive a Pix.
GET /v1/transactionsshows the received Pix inEXECUTED. - Return a received Pix.
GET /v1/transactions/{transactionId}with theidof the return showsEXECUTEDorERROR.
transaction.executed, transaction.refunded or transaction.failed. See Pix Direct via JD events.
What can go wrong with JD
The Pix JD error list describes each code.
Pix through BTG
Participants
- Your institution. Calls the Pix BTG API and receives its webhooks.
- Pix BTG. Posts each Pix in Midaz and sends the payments to BTG.
- Midaz. The ledger that holds the accounts of your customers.
- SPI. The BACEN instant payment system. It settles each Pix.
- BTG. The partner that exchanges the Pix messages with SPI.
Before you start
- The account that sends, receives or returns the Pix exists in Midaz, is active, and has a holder.
- Lerian sets your endpoint for the transfer and refund webhooks of Pix BTG. See Webhooks.
Send a Pix through BTG
Receive a Pix through BTG
Return a received Pix through BTG
Rules for BTG
Send a Pix
- Send the
X-Idempotencyheader at steps 1 and 5. - The initiation stays open for 5 minutes. After that, step 5 answers
422withPIX-0411. - When you process the same initiation again, Pix BTG returns the transfer that it created. It moves no money again.
- The debit in Midaz is not the settlement.
- When the receiver returns a Pix that you sent, Pix BTG credits the amount in Midaz. Then it sends the webhook
refund.cashin.
Receive a Pix
- Pix BTG refuses a Pix when it does not find the account, or when the account cannot receive the amount. Midaz records nothing for a refused Pix.
Return a received Pix
- You can return only a received Pix. Together, the returns cannot pass the amount of the Pix.
- The return code in
X-ReasonisBE08,FR01,MD06orSL02. - The debit of step 2 is not the settlement.
How you know it finished with BTG
- Send a Pix. The webhook
transfer.cashoutgives the final status.GET /v1/transfers/{transfer_id}shows the same status. - Receive a Pix. Pix BTG sends the webhook
transfer.cashinwithCOMPLETED. - Return a received Pix. The webhook
refund.cashoutgives the final status.GET /v1/refunds/{refund_id}shows the same status.
What can go wrong with BTG
The Pix BTG error list describes each code.
Related
- Send and receive Pix: the same journeys on the native Lerian SPI.
- Return a received Pix: the return on the native Lerian SPI.
- Pix via JD
- Transfers and cash-out
- Refund operations
- Webhooks

