Pix Payment Integration Guide

Accept Brazil's dominant instant payment method through Stripe

Pix is Brazil's instant payment system developed by the Central Bank of Brazil. Since its 2020 launch, it has become the dominant payment method for Brazilian consumers, processing billions of transactions monthly. For businesses serving the Brazilian market, accepting Pix is essential for meeting customer expectations and maximizing conversion rates.

This guide covers everything you need to integrate Pix payments using Stripe's Payments API, from understanding the fundamentals to implementing production-ready solutions. Whether you're building a new e-commerce platform or adding payment options to an existing system, Stripe provides the tools you need to accept Pix seamlessly alongside other payment methods.

What is Pix?

Pix is Brazil's instant payment system created by the Central Bank of Brazil (Banco Central do Brasil). Launched on November 16, 2020, Pix enables real-time money transfers between bank accounts through a mobile-first approach that prioritizes convenience and speed. The system operates 24 hours a day, 7 days a week, including weekends and holidays.

The name "Pix" comes from the Portuguese word for "click," reflecting the system's instant nature. Unlike traditional bank transfers that can take hours or days to settle, Pix transactions typically complete in under 10 seconds. This immediacy has driven rapid adoption across Brazilian consumers and merchants.

Pix supports multiple payment keys that users can register with their banks:

  • Phone number (celular)
  • Email address
  • CPF or CNPJ (Brazilian tax identification numbers)
  • Randomized payment key (chave aleatória)
  • QR Code (both static and dynamic)

For businesses looking to integrate Pix into their web applications, Stripe provides a unified API that handles the complexity of the Central Bank infrastructure while maintaining full functionality.

How Pix Works

Centralized Infrastructure

Pix operates through the Central Bank's Fast Payment System (SPI), connecting all participating financial institutions in a single network.

Multiple Payment Keys

Users can send payments using phone numbers, email addresses, CPF/CNPJ tax IDs, or randomized payment keys.

QR Code Payments

Both static and dynamic QR codes enable fast, contactless payments at point-of-sale or online checkout.

24/7 Availability

Transactions process instantly at any time, including weekends and holidays, with no cut-off times.

Pix Market Impact

<10s

Transaction Settlement

0%

Consumer Transaction Fee

24/7

Availability

Billions+

Monthly Transactions

Why Accept Pix Payments

For businesses serving Brazilian customers, accepting Pix is now essential. Consumer preference has shifted dramatically toward instant payments, and merchants not offering Pix risk losing sales to competitors who do.

Brazilian consumers have embraced Pix as their preferred payment method for several compelling reasons. The ability to complete payments instantly, without credit card fees or waiting periods, resonates across demographics. Cash usage has declined significantly in Brazil since Pix launch, with consumers now using Pix for everything from coffee to groceries to retail purchases.

From a business perspective, integrating Pix alongside traditional payment methods allows you to offer Brazilian customers their preferred checkout option while maintaining compatibility with international payment preferences.

Business Benefits

Instant Settlement

Funds are available immediately after payment, improving cash flow and eliminating waiting periods.

Lower Costs

Pix transaction fees are typically lower than credit card interchange fees, saving money on every transaction.

Reduced Abandonment

Fast QR code payments reduce cart abandonment compared to lengthy credit card entry flows.

No Chargebacks

Pix payments are final and irrevocable, eliminating chargeback risk and disputes.

Stripe Pix Integration

Stripe provides a straightforward API for accepting Pix payments, abstracting the complexity of the Central Bank infrastructure while maintaining full functionality. The integration leverages Stripe's Payment Intents API, following the same patterns used for other payment methods.

Before implementing Pix payments, ensure your Stripe account is configured appropriately. Your account must have Pix payments enabled, which Stripe typically activates automatically for accounts in supported regions. The integration requires standard Stripe API keys and webhook endpoints for handling asynchronous payment confirmations.

Stripe's unified approach means you can add Pix to your existing payment processing infrastructure without significant architectural changes.

create-pix-payment.ts
1import Stripe from 'stripe';2 3const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);4 5async function createPixPayment(amount: number, orderId: string) {6 const paymentIntent = await stripe.paymentIntents.create({7 amount: amount * 100, // Convert to cents8 currency: 'brl',9 payment_method_types: ['pix'],10 payment_method_options: {11 pix: {12 expires_in_seconds: 3600,13 },14 },15 description: `Order #${orderId}`,16 metadata: {17 order_id: orderId,18 },19 });20 21 return {22 clientSecret: paymentIntent.client_secret,23 pixQrCode: paymentIntent.next_action?.pix_display_qr_code?.qr_code,24 };25}
PixCheckout.tsx
1'use client';2 3import { loadStripe } from '@stripe/stripe-js';4 5const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_KEY!);6 7export function PixCheckout({ clientSecret, qrCode }: PixCheckoutProps) {8 const stripe = useStripe();9 10 const checkPaymentStatus = async () => {11 const { paymentIntent, error } = await stripe!.retrievePaymentIntent(clientSecret);12 13 if (error) {14 console.error(error);15 return;16 }17 18 switch (paymentIntent.status) {19 case 'succeeded':20 window.location.href = '/success';21 break;22 case 'processing':23 console.log('Payment processing...');24 break;25 case 'requires_payment_method':26 console.log('Payment failed, try again');27 break;28 }29 };30 31 return (32 <div className="pix-checkout">33 <h3>Scan to Pay with Pix</h3>34 <img src={`data:image/png;base64,${qrCode}`} alt="Pix QR Code" />35 <p>Open your banking app and scan this QR code</p>36 <button onClick={checkPaymentStatus}>37 I've completed the payment38 </button>39 </div>40 );41}

Best Practices for Pix Integration

Implementing Pix payments correctly requires attention to several best practices that ensure reliable operation and good customer experience. Following these guidelines will help you build a robust payment integration that serves your Brazilian customers effectively.

When building your payment infrastructure, consider how Pix fits into your overall payment processing strategy. A well-designed integration handles webhooks, QR code expiration, refunds, and graceful error handling.

Common Integration Scenarios

Different business models require different approaches to Pix integration. Here are the most common scenarios and how to implement them for your e-commerce platform.

For physical retail locations, display static QR codes at checkout counters. Customers scan the code and enter the purchase amount in their banking app. ```typescript const paymentLink = await stripe.paymentLinks.create({ line_items: [{ price_data: { currency: 'brl', product_data: { name: 'In-store Purchase' }, unit_amount: 0, }, quantity: 1 }], payment_method_types: ['pix'], }); ```

Pix vs Other Payment Methods

Understanding how Pix compares to other options helps in making informed integration decisions for your payment processing setup.

AspectPixCredit CardsBank Transfer
Transaction TimeInstant1-3 daysHours
Settlement CostLowHigherMedium
Chargeback RiskNoneYesLow
PCI RequiredNoYesNo
24/7 ProcessingYesYesNo

Pix offers significant advantages for Brazilian merchants, including lower costs, instant settlement, and no chargebacks. However, credit cards remain important for customers needing financing and international transactions. Bank transfers still have relevance for very large amounts exceeding Pix limits.

Pix vs Credit Cards:

  • Lower transaction costs
  • Instant settlement
  • No chargeback risk (payments are final and irrevocable)
  • No PCI compliance requirements

However, credit cards remain important for customers needing credit or financing, international customers without Brazilian bank accounts, and recurring payments where customers want card benefits.

Pix vs Bank Transfers: Traditional TED/TEF bank transfers required manual entry of recipient banking details and could take hours to settle. Pix simplifies this to scanning a QR code or entering a payment key, with instant confirmation. Pix has largely replaced bank transfers for consumer-to-merchant payments, though TED transfers remain relevant for very large amounts where Pix limits may apply.

Frequently Asked Questions

Related Resources

Related Guides

Ready to Accept Pix Payments?

Digital Thrive specializes in payment integration for the Brazilian market. Contact us to discuss your Pix integration needs and start accepting instant payments today.

Sources

  1. Stripe Pix Documentation - Official Stripe integration guide
  2. Central Bank of Brazil Pix Information - Official Pix specifications
  3. Stripe Pix Resource Guide - Market adoption and implementation