Skip to main content
Pix QR codes are the fastest way to collect a payment: the payer scans the code or pastes the BR code (the Pix copy-and-paste code) into their banking application. The API offers three types; this guide explains when to use each and how to generate a dynamic QR code, the type most online merchants and payment service providers rely on. For the full cash-in picture, see the Receivables overview.

Static QR code

A static QR code carries fixed payment information that does not change between transactions. Use it for recurring or standardized charges where the amount and payment details stay the same:
  • Fixed and reusable payment information.
  • Suitable for recurring collections.
  • Can be permanently displayed or printed.
Create one with POST /v2/in/pix/qrcodes/static. Send amount: 0 for an open-amount code, where the payer chooses the amount.

Dynamic QR code

A dynamic QR code is generated for one transaction and carries that transaction’s information. Use it for e-commerce platforms, payment service providers and automated payment flows:
  • Unique transaction information for each payment.
  • Supports your own identifiers and metadata.
  • Enables automated reconciliation and tracking.
Create one with POST /v2/in/pix/qrcodes, as shown below. After creation, PUT /v2/in/pix/qrcodes/{id} updates the amount, expiration_datetime or fee of an existing dynamic QR code and returns 204 No Content.

Dynamic QR code with due date

A dynamic QR code with due date is a dynamic QR code that carries a due date and the payment rules attached to it: fine, interest, rebate and discount. Use it when the charge behaves like an invoice. Create one with POST /v2/in/pix/qrcodes/with_due.

Which type to use

Generate a dynamic QR code

All examples use the sandbox base URL https://api.sandbox.trio.com.br.
The default expiration time is 1 day, and the minimum allowed expiration time is 5 minutes. Example request:

Response

On success the API returns 201 Created with the QR code:
The payer is the nested counterparty object and the creator is the nested origin object. counterparty.bank_accounts lists the bank accounts the payment must come from and is empty when any account is accepted. image is returned only when options.show_qrcode_image is true.
Coming from V1? The response no longer carries virtual_account_id, entity_id, pix_key_id or timestamp. Timestamps are inserted_at and updated_at, and allow_change_the_amount_on_payment lives inside options.

Deliver the code to the payer

  • BR code: send the hash so the payer pastes it into their banking application.
  • QR code image: render the hash as a QR code image for the payer to scan. You can also ask the API for the image, either with options.show_qrcode_image: true on creation or later with GET /v2/in/pix/qrcodes/{id}/image, which returns it in Base64.

Follow the payment

The QR code itself has a status of created, settled or deleted. Once paid, the deposit becomes an in document that you list with GET /v2/documents/in and follow through webhook events. Each transaction progresses through the following stages:
  • created: transaction received and queued for processing.
  • registering: transaction is being processed.
  • settled: transaction successfully processed and settled (final state).
  • failed: transaction refused due to validation or compliance rules (final state for cash out).
Transaction flow
See the Document lifecycle guide for the full list of V2 statuses.

Next steps