Skip to main content
Send, receive and return Pix when a partner connects your institution to SPI.
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

Pix through a partner: Send a Pix through JD

Receive a Pix through JD

Pix through a partner: Receive a Pix through JD

Return a received Pix through JD

Pix through a partner: Return a received Pix through JD

Rules for JD

Send a Pix

  • The X-Idempotency header 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 EXECUTED or ERROR.

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 accountId must be the payee of the Pix.
  • The return code is BE08, FR01, MD06 or SL02.
  • 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 stays EXECUTED.

How you know it finished with JD

Where event delivery is on for your deployment, Pix JD also publishes the result as an event: 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

Pix through a partner: Send a Pix through BTG

Receive a Pix through BTG

Pix through a partner: Receive a Pix through BTG

Return a received Pix through BTG

Pix through a partner: Return a received Pix through BTG

Rules for BTG

Send a Pix

  • Send the X-Idempotency header at steps 1 and 5.
  • The initiation stays open for 5 minutes. After that, step 5 answers 422 with PIX-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-Reason is BE08, FR01, MD06 or SL02.
  • The debit of step 2 is not the settlement.

How you know it finished with BTG

  • Send a Pix. The webhook transfer.cashout gives the final status. GET /v1/transfers/{transfer_id} shows the same status.
  • Receive a Pix. Pix BTG sends the webhook transfer.cashin with COMPLETED.
  • Return a received Pix. The webhook refund.cashout gives 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.