Through DICT Key
This document provides a detailed walkthrough on how to send money using a DICT Key
1. Create a DICT Key Transaction by calling the Create DICT Key Transaction endpoint:
curl --request POST \
--url https://faas.sandbox.tracefinance.io/pix/api/transactions/dictKey \
--header 'authorization: Bearer {accessToken}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"dictKeyValue": "9fa37a18-734f-4382-bb1a-4c86ffb097f5",
"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
}
],
"idempotentId": "0ebd0830-08ff-4f7f-ae23-962d06adb9fa"
}
'
Parameters:
dictKeyValue
: The beneficiary's PIX key, which can be an email, phone number, CPF, CNPJ, or a random value. (required)amount.value
: The transaction amount in cents, following TraceFinance's Data Conventions. The currency is automatically set to BRL by the server. (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
: 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 DICT Key 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 about 1 month ago