Receive PIX Transaction
Dynamic QRCode
- A Dynamic QRCode can only be paid once, ensuring the transaction's uniqueness.
- Dynamic QRCodes must have an expiration time, with a maximum allowed duration of 72 hours.
- Once a Dynamic QR Code is paid, it triggers the creation of a new
CREDIT
transaction withQR_CODE
method.
How to Create a Dynamic QRCode
To generate a Dynamic QR Code, you need to call the Create Dynamic QR Code endpoint. The code snippet below demonstrates how to make the request with the necessary headers and payload:
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
}
'
Parameters:
amount.value
is the integer amount in cents.expiresIn
is the duration in seconds before the QR Code expires.
Webhooks
- When a Dynamic QRCode is paid, two webhooks are triggered: QR_CODE_REDEEMED and TRANSACTION_COMPLETED, providing real-time transaction updates.
- The TRANSACTION_COMPLETED webhook contains the
qrCodeId
, allowing businesses to link transactions to the corresponding Dynamic QR Code. - If the QRCode expires without payment, a QR_CODE_EXPIRED webhook is sent, notifying the expiration event.
Static QRCode
- Static QRCode can be paid multiple times, allowing for repeated transactions.
- They are suitable for recurrent payments and local payments where the payment amount is not fixed.
How to Create a Static QRCode
Creating a Static QR Code involves calling the Create Static QR Code endpoint. Below is an example request:
curl --request POST \
--url https://faas.sandbox.tracefinance.io/pix/api/qrCodes/static \
--header 'authorization: Bearer {accessToken}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"amount": {
"value": 5000
}
}
Note: Specifying an amount
locks the value of the QR Code. To accept any amount, send null
for the amount
.
Webhooks
Similar to Dynamic QRCodes, a TRANSACTION_COMPLETED webhook is issued when a Static QRCode is paid, containing the qrCodeId
to facilitate QRCode tracking.
Updated 2 months ago
What’s Next