- Pix QR Code: Customers scan a dynamic QR code with their banking app.
- Pix Copy and Paste (Copia e Cola): Customers copy a Pix code and paste it into their banking or digital wallet app to initiate the transfer.
Before You Begin
Ensure you have:- Valid API credentials (access token).
Step 1. Create Pix Payment
To generate a Pix payment for collection in Brazil, send aPOST request to the Create Payin endpoint with Pix-specific parameters.
Key Request Parameters
The request requires several key objects specific to QR payments:
See all available parameters in the request.
Same endpoint for both methods: This single API request is used to generate a payment for both Pix QR Code and Pix Copy and Paste (Copia e Cola). The method used by the customer is determined by how you present the payment details returned in the response.
Example Request
Below is an example usingcurl:
curl
Step 2. Handle the Response
Successful Response
A successful Pix payment creation includes the Pix code data and payment details:Key Response Fields
Error Response
When Pix generation fails for Brazil, you’ll receive specific error information:Step 3. Present the Pix Payment
You can present the Pix payment to your customer in one of two ways. The API response provides the necessary data for both.Option A: Display as a QR Code
- Render the QR Code: Use the string from the
qr.codefield in the API response to generate a scannable QR code image using any QR library. - Customer Scans: The customer scans the QR code with their banking app.
- Authorize: The customer confirms the payment details and authorizes the transfer within their app.
- Real-time Confirmation: Localpayment receives instant payment notification.
- Status Update: Your system receives webhook with payment confirmation.

Best Practices for QR Display
- Minimum display size: 250x250 pixels for mobile scanning.
- Maintain 1:1 aspect ratio without distortion.
- Ensure high contrast (dark on light background).
- Add quiet zone (white border) around QR code.
- Include alt text (e.g. “QR Code Payment”).
- Show Clear Payment Instructions.
- Handle Time-to-Live (TTL) and Expiration.
Option B: Display as a Copy-and-Paste Code (Copia e Cola)
- Present the Code: Display the full string from the
qr.codefield to your customer as selectable text. - Customer Copies and Pastes: The customer copies the entire code and opens their banking or digital wallet app.
- Paste and Pay: The customer pastes the code into the app’s “Pay with Pix Code” or similar field to load the payment details.
- Authorize: The customer reviews and authorizes the transfer.
- Real-time Confirmation: Localpayment receives instant payment notification.
- Status Update: Your system receives webhook with payment confirmation.

Step 4. Track Transaction Status
Monitor Pix payment progress through these methods:Webhooks (Recommended)
Receive real-time notifications when transaction status changes. Most efficient for production environments.
Status API Endpoint
Query transaction status programmatically. Useful for polling or recovering lost webhook notifications.
Business Portal View
Visual interface for monitoring transactions. Great for manual oversight and detailed transaction analysis.
Common Status Codes
The Localpayment API provides various status codes to indicate the progress and outcome of the payment in the response.Complete ReferenceView all status codes in our Transaction Status Documentation.
Testing Your Integration
Sandbox Environment
Use the staging environment for testing:Test QR Scenarios
Verify your integration handles these scenarios:- Successful Payment: Complete Pix payment with instant settlement.
- QR Expiration: Handle expired Pix payments gracefully.
- Multiple Payment Attempts: Same QR scanned multiple times.
- Status Updates: Webhook handling and status polling.
Next Steps
After implementing Pix payments, consider these additional capabilities:Refund the transaction
If necessary, you can refund the payment to the customer. Refer to the documentation for details.
Review transaction details
You can retrieve transaction information using the Localpayment API for detailed insights.

