Paying a QR Code
This document provides a detailed walkthrough on how to pay a QR Code
1. Create a QR Code Transaction by calling the Create QR Code Transaction endpoint:
curl --request POST \
--url https://faas.sandbox.tracefinance.io/pix/api/transactions/qrCode \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"qrCodeValue": "00020101021126400014br.gov.bcb.spi0118SPI AUTBANK.COM.BR520400005303986540899999.995802BR5934AUTBANK PROJETO E CONSULTORIA LTDA6009SAO PAULO62230519202006081729285751b6304F316",
"idempotentId": "24b2ae17-5a58-4465-acbb-45e11fdc2496",
"bankAccountId": "9008369c-8837-43c7-b5f2-0229622bd21c",
"amount": {
"value": 1500000
},
"validations": [
{
"key": "TAX_ID_MUST_MATCH",
"value": "83317882069"
},
{
"key": "TAX_ID_MUST_BE_ACTIVE",
"value": true
}
]
}
'
Parameters:
qrCodeValue
: is the full string representation of the PIX QR Code. (required)amount.value
: is the transaction amount in cents, following TraceFinance's Data Conventions. The currency is automatically set to BRL by the server. (conditionally 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)idempotentId
: is a unique ID to prevent duplicate transactions. (required)validations
is the list of validations that the credit transaction originating from this QR code must be submitted. Transaction Validations (optional)
What Happens Next
-
A Transaction Requested webhook is triggered.
-
The QR code value is validated, and if the validation fails, the Transaction Failed webhook is triggered, delivering detailed information about the failure and the specific error encountered. If the validation is successful, the Transaction Createdwebhook is triggered.
-
If the transaction includes validations, they will be executed. In the event of a validation failure, the Transaction Failed webhook is triggered.
-
If all validations pass, the transaction moves to the processing stage, and a Transaction Processing webhook is triggered to notify that the transaction is now being processed.
-
If the transaction is completed, a Transaction Completed webhook is triggered, confirming the successful completion of the transaction.
-
If an error occurs at any point during the processing, a Transaction Failed webhook is triggered, providing details about the failure and the specific error that occurred.
Note: Monitoring these webhooks is crucial for keeping track of the transaction status and handling any necessary actions based on the transaction's outcome.
Updated 3 months ago