Using QR code
Last updated
Was this helpful?
Last updated
Was this helpful?
The use of QR codes is one way to facilitate and expedite transactions. There are two main categories of QR codes in Pix: Dynamic QR code and Static QR code. Let's understand the difference between them:
Static QR Code: The static QR code contains fixed information that does not change over time or transactions. It is useful for receiving payments for a specific amount and/or standardized information. For example, a merchant can generate a static QR code to receive payments for a fixed amount for a product or service. This QR code will maintain the same payment information, such as the Pix key and the amount, regardless of how many times it is scanned.
Dynamic QR Code: The dynamic QR code contains variable information that can be updated for each transaction. It is especially useful for transactions of different amounts or when specific information needs to be included for each payment. For instance: when making a purchase at an online store, the dynamic QR code can include the amount to be paid and other relevant details for that specific transaction. Each time the dynamic QR code is scanned, it can display a different value and unique details for that transaction.
Since most of our customers are online merchants and PSPs, this guide will focus on the use of Dynamic QR code.
When generate a new dynamic QR code, there are some important parameters that you need to pay attention:
Virtual Account ID: virtual account that will receive and hold the money.
External ID: reference of your transaction in our system.
Amount: amount of the transaction, always represented in cents.
Counterparty: tax_number and name of the user that wants to pay the QR code.
Expiration Date time: date when do you want the QR code to expire in the . The default value is 1 day.
To generate the QR code, send a using this payload:
POST: https://api.sandbox.trio.com.br/banking/cashin/pix/qrcodes
If everything is OK, you will receive a 201
response with a payload like this:
You can offer to your users two payment methods for a QR Code:
Using the "Copy and Paste": send the generated hash to the user. They will be able to paste the hash in their bank app to complete de payment.
QR Code image: generate a QR code with the hash parameter and show to the user. They will be able to scan the QR code with their bank app to complete the payment.
Each document that is processed by Trio generates and sequence of stages that represent the evolution of the transaction in our system:
Created - we receive the transaction and enqueue for processing
Registering - we start to process the settlement
Settled - transaction was successfully processed and settled, the balance is available in your account, this is a final stage
Failed - transaction was refused by Trio due to compliance rules, this is a final stage Follow a diagram that represents the flow:
To avoid overcommunication, we only send asynchronous communication using webhooks for the final stages.
This event will be triggered only if the user pays the QR code. We'll create a collecting document that represents the pay-in transaction and notify you through webhooks with the category collecting_document
and type settled
.
Failed
This event will be triggered only if the user pays the QR code, but the transaction was refused. We'll create a collecting document that represents pay-in transaction and notify you through webhooks with the category collecting_document
and type failed
.
To achieve both Settled and Failed transaction states, please refer to the next guides: Simulating Deposit Success and Simulating Deposit Failures.