> ## Documentation Index
> Fetch the complete documentation index at: https://developer.transactbridge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PIX

Use the PIX Component to let a customer pay instantly from their Brazilian bank account with PIX.

```js theme={null}
const pix = TBDropin.create("tb_pix", qrOptions);
```

> [!NOTE]
>
> PIX is available for **one-time payments** in **BRL**. Pass a
> `billingSessionId` to `pay()` — subscriptions and mandates are not supported.

The component collects nothing from the customer. The payer's name and email are taken from the billing session's `billDetails`, so make sure they are set when you create the session.

**How the payment completes**

On every device (desktop and mobile), the payment popup shows:

* A **PIX QR code** the customer scans with their banking app.
* A **Copy PIX Code** button below the QR. The customer can paste this "copia e cola" code into their banking app instead of scanning — the usual choice when paying on the same phone.

The popup polls the payment status and switches to the success or failure screen once the customer completes the payment.

**Component Options**

`tb_pix` accepts the same options as `qrOptions` for [UPI QR](https://developer.transactbridge.com/checkout.js/web-sdk/dropin/components/upi.md#upi-qr). They style the QR payment popup, with higher priority than `popupConfig`. Use the `copyButton` key to style the copy-code button:

```js theme={null}
const qrOptions = {
  fonts,
  components: {
    image: { width: "220px", height: "220px" },
    copyButton: {
      fontFamily: fontRoboto,
      backgroundColor: "dimgray",
      color: "white",
      borderRadius: "6px",
    },
    // ...title, timer, instruction, label, value, note, base, closeButton
  },
  frameStyle: {
    width: "360px",
    height: "560px",
    borderRadius: "15px",
    zIndex: "99999999",
  },
};
```

> [card] [Customize Your SDK -> QR payment popup](https://developer.transactbridge.com/checkout.js/web-sdk/dropin/customize-your-sdk.md#9-upi-qr-qr-based-payments)
>
> View every key supported in qrOptions

**Returned Value**

**pix** `PIX Object`

```js theme={null}
{
  element: "tb_pix",
  value: {
    payMethod: "PIX"
  },
  isValid: true,
  ready: true,
  error: null
}
```

| Field | Type |
| - | - |
| **payMethod** | `string` |

**Code Snippet for pix component**

```js theme={null}
const TBDropin = window.TBDropin();

await TBDropin.init({
  mode: "sandbox", // sandbox or production
  publishKey: "", // your publish key goes here
  popupConfig: popupOptions,
});

const pix = TBDropin.create("tb_pix", qrOptions);

pix.mount("#pix");

pix.on("ready", (data) => console.log("pix", data));

const result = await TBDropin.pay({
  billingSessionId: "bs_xxxxx",
  payMethod: pix,
  sessionToken,
});
```

### Using your own button

The component renders a transparent button. To show your own "Pay with PIX" tile, keep the component's iframe out of sight inside it and call `pay()` from the tile's click handler:

```html theme={null}
<div id="pixTile" class="pay-tile">
  <div id="pix" style="width: 1px; height: 1px; overflow: hidden"></div>
  <span>Pay with PIX</span>
</div>
```

```js theme={null}
const pix = TBDropin.create("tb_pix", {
  ...qrOptions,
  disableSkeleton: true,
});

pix.mount("#pix");

document.getElementById("pixTile").addEventListener("click", async () => {
  const result = await TBDropin.pay({
    billingSessionId: "bs_xxxxx",
    payMethod: pix,
    sessionToken,
  });
});
```

> [!WARNING]
>
> For `tb_pix`, the `frameStyle` you pass to `create()` also sizes the payment
> popup. Shrink the component with CSS on its mount node, as shown above, rather
> than with `frameStyle: { width: "1px", height: "1px" }`. A 1 px
> `frameStyle` makes the popup open at its minimum size (320 × 560 px)
> and overrides the popup size you set in `qrOptions` or `popupConfig`.

**Next Steps**

* **Customize component styles**
* **Add multiple payment methods using tabs**
* **Handle payment confirmation on backend**
* **Set up webhooks for payment status**

**Need Help?**

Explore the following sections for more details:

* [**Dropin Overview**](https://developer.transactbridge.com/checkout.js/web-sdk/dropin/overview.md)
* [**Quickstart**](https://developer.transactbridge.com/checkout.js/web-sdk/dropin/quickstart.md)
* [**Customization**](https://developer.transactbridge.com/checkout.js/web-sdk/dropin/customize-your-sdk.md)

If you need assistance, our support team is here to help 🚀


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.