Creating a static QR Code

Static QR Codes function similarly to a payment link. They only expire if you set an expiration date and can receive as many payments as you want.

This is the ideal case to display in a restaurant, for example, to receive payments via Pix and identify where they came from.

Receiving payments via static QR Codes

You can create a static QR Code with a predefined value for your Pix key. The first step is to have the Pix key you will receive this payment with; in this example, we'll use a random Pix key. Then, just call the endpoint to generate a static QR Code.

POST /v3/pix/qrCodes/static
Check the complete reference of this endpoint

{
  "addressKey": "b6295ee1-f054-47d1-9e90-ee57b74f60d9",
  "description": "Barbecue",
  "value": 50.00,
  "format": "ALL",
  "expirationDate": "2023-05-05 14:20:50",
  "expirationSeconds": null
}

In the return, you will have access to the id of this QR Code and also to the payload where you will have the QR Code image encoded in Base64.

When using a static QR Code, it is not necessary for you to create a payment or define which customer, as when paid by someone, it will automatically import the customer's data and create a payment.

To know that a static QR Code was paid, you need to monitor the events of the Webhook for payments. When you receive a payment received event, the pixQrCodeId field will have the ID of your QR Code.

Checking payments generated by a static QR Code

With the pixQrCodeId, you call the endpoint to list payments to get more data on the payments created from this QR Code.

GET /v3/payments?pixQrCodeId=9bea9bcd226b45c7980065f598be54d5
Check the complete reference of this endpoint