How To: Implement Pix Payments
Developers can learn how to implement pix pay-ins.
Overview
Merchants can accept payments via Brazilian PIX accounts. With PIX pay-ins merchants can display the purchase amount in Brazilian Real, and end-users can complete their payments directly with their PIX account. This reduces any currency conversion confusion, and gives end-users more transparency and trust in how much the total cost of a purchase will be. Upon a successful payment, Merchants receive USDC to their settlement location.
Demo
👍 Try making a purchase with PIX yourself on our demo app!
How It Works
- Merchant defines their revenue settlement location.
- Merchant fetches a quote for how much a purchase will be including all fees associated with the transaction.
- Merchant displays purchase amount in BRL to end-user.
- Merchant calls Pix Payment Order endpoint and displays QR code to end-user.
- End-user scans QR with mobile device to complete purchase.
- End-user receives push notification or email that their payment has been completed.
- Merchant sees BRL payment in merchant dashboard.
- Merchant receives USDC in defined settlement location.
API Implementation
- Note: Ensure the subtotal passed here is the purchase value in USD.
- Pass the
brCodereturned from Step 1 into a QR code scanner and display the QR code to the end-user.
- Note: You may use any qr code generating library. For example purposes, we are using
[react-qr-code](https://www.npmjs.com/package/react-qr-code).
- Listen for
Settledpurchase events.

- See payment record on merchant dashboard.
- Note: Purchase amount will display in USD on the merchant dashboard.

🚧 In sandbox, the payment autocompletes itself after 5 seconds and the webhook gets sent.
There currently is no way to mock sandbox payments in the PIX system.
📘 Pix Payment Window
Once a QR code is generated, customers have 5 minutes to complete the payment. This time limit ensures that foreign exchange (FX) rates remain accurate, preventing potential discrepancies that could arise if the payment is made days or weeks after the quote is issued. If the QR code has expired, the purchase status will display as
Expired.

