Send PIX Transaction

Sending a PIX transaction can be done through one of three methods: via a DICT key, by providing specific bank instructions, or by scanning and paying a PIX QR Code. Detailed instructions for each method are provided below.

How to Send by DICT Key

To initiate a transaction via a DICT key, you have to call the Create DICT Key Transaction endpoint, as the code example below:

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",
  "amount": {
    "value": 25000
  },
  "idempotentId": "some-random-unique-value"
}
'
  • dictKeyValue: The beneficiary's PIX key, which can be an email, phone number, CPF, CNPJ, or a random value.
  • amount.value: The transaction amount in cents, following TraceFinance's Data Conventions.
  • idempotentId: A unique ID to prevent duplicate transactions.

How to Send by Bank Instruction

To send a PIX transaction with bank instructions, you need call the Create Bank Instruction Transaction endpoint:

curl --request POST \
  --url https://faas.sandbox.tracefinance.io/pix/api/transactions/bankInstruction \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '
{
  "amount": {
    "value": 0
  },
  "destination": {
    "taxId": "37041494000162",
    "legalName": "TRACE CORRESPONDENTE CAMBIAL LTDA",
    "accountNumber": "7140025418",
    "accountType": "CHECKING",
    "ispbCode": "54403563",
    "branchCode": "0001"
  },
  "idempotentId": "24b2ae17-5a58-4465-acbb-45e11fdc2496"
}
'

Parameters:

  • destination: The beneficiary's bank account details, which include:
    • taxId: The tax identification number of the account holder.
    • legalName: The legal name of the account holder.
    • accountNumber: The account number.
    • accountType: The type of account (e.g., CHECKING, SAVINGS).
    • ispbCode: The Institution’s Unique Identifier.
    • branchCode: The branch code of the bank.
  • amount.value: The transaction amount in cents, as per TraceFinance's conventions.
  • idempotentId: A unique ID to prevent duplicate transactions.

How to Pay a PIX QRCode

To pay using a PIX QR Code, you have to use the Create QRCode 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": "00020101021226860014BR.GOV.BCB.PIX2564qrcode-h.bc.gov.br/gi/v2/545c1963e7104a928ac845186e8442dd5204000053039865802BR5925INOVATEC SOLUCOES EMPRESA6006SANTOS61081102033062070503***6304FB23",
  "idempotentId": "24b2ae17-5a58-4465-acbb-45e11fdc2496",
  "amount": {
    "value": 0
  }
}
'

Parameters:

  • qrCodeValue: The full string representation of the PIX QR Code.
  • idempotentId: A unique identifier to ensure this transaction is not accidentally replicated.
  • amount: This field is optional when initiating a QR Code transaction. If an amount is specified and differs from the amount in the QR Code, an error is reported.

Webhooks

Following a PIX transaction, TraceFinance dispatches webhooks to communicate the transaction status: