From a Dynamic QR Code
This document provides a detailed walkthrough on how to receive money using a dynamic QR Code
1. Create the Dynamic QR Code
Generate the Dynamic QR Code by calling the Create Dynamic QR Code endpoint
curl --request POST \
--url https://faas.sandbox.tracefinance.io/pix/api/qrCodes/dynamic \
--header 'authorization: Bearer {accessToken}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"amount": {
"value": 2500
},
"expiresIn": 3600,
"bankAccountId": "9008369c-8837-43c7-b5f2-0229622bd21c",
"payer": {
"name": "Payer",
"taxType": "CPF",
"taxId": "83317882069"
},
"validations": [
{
"key": "TAX_ID_MUST_MATCH",
"value": "83317882069"
},
{
"key": "TAX_ID_MUST_BE_ACTIVE",
"value": true
}
]
}
'
Parameters:
amount.value
is the integer amount in cents. (required)expiresIn
is the duration in seconds before the QR Code expires. (required)bankAccountId
is the bank account designated to receive the PIX transaction. This information is required only if you have more than one bank account. (conditionally required)payer
is the intended payer of the QR code. No validation or blocking logic is applied based on the payer data. (optional)validations
is the list of validations that the credit transaction originating from this QR code must be submitted. QR Code Validations (optional)
Note: Once the Dynamic QR Code is created, a QR Code Created webhook is triggered to notify you of its creation.
2. Pay the Dynamic QR Code
Once the QR Code is generated, share it with the payer. The payer will scan the QR Code and make the payment.
What Happens Next
After the QR Code is paid, several webhooks are triggered by the system to notify you about the status of the transaction:
Transaction Created: When the QR Code is paid, a Transaction Created webhook is triggered.
Transaction Completed or Failed:
-
If validations were specified during the QR Code creation, their validations will be executed. If the validation is successful, the transaction is completed, and a Transaction Completed webhook is triggered.
-
If the validation fails, the transaction fails, and a Transaction Failed webhook is triggered with error details. After that, the transaction is refunded, followed by a Transaction Refunded webhook.
-
If no validations were specified during the QR Code creation, the transaction is completed, and a Transaction Completed webhook is triggered.
QR Code Redeemed: After payment, the QR Code is marked as redeemed, triggering a QR Code Redeemed webhook.
QR Code Expired: If the QR Code expires without payment, a QR Code Expired webhook is sent, notifying you of the expiration.
Updated about 1 month ago