First, it's required to start the payment initialization, for consolidating the payment. Once the payment initialization has been carried out, the payment must be made using the information returned in the payment initialization process.
Payment Initialization
This endpoint will provide the basic data related to the payload/qrcode consulted. Beyond that, it will provide the "endToEndId" attribute which will be required in the transfer endpoint.
Below is the request and response example. For more details on this endpoint, click here.
POST 'https://apisandbox.delbank.com.br/baas/api/v2/pix/qrcode/payment-initialization'
curl --request POST \
--url https://apisandbox.delbank.com.br/baas/api/v2/pix/qrcode/payment-initialization \
--header 'IdempotencyKey: 9d16ea35-8a85-49ea-a41e-bcf56c677129' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-delbank-api-key: {{apiKey}}' \
--data '
{
"payload": "00020126890014br.gov.bcb.pix01365b0ac9a4-fad6-43f9-be70-6d7c9a2fad260227Informacao do PSP Recebedor5204000053039865802BR5920HOMOLOGACAO INTEGRAC6007ARACAJU62290525charge000000000000008342263048919"
}
'
// response qr-code-static
{
"key": "4004901d-bd85-4769-8e52-cb4c42c506dc",
"endToEndId": "E3822485720230801135023201713368",
"transactionId": "15c3f2d4a28e4c47b0a21a0f2",
"allowChangeAmount": false,
"categoryCode": "0000",
"type": "QR_CODE_STATIC",
"initiationType": "QR_CODE_STATIC",
"amount": 675.94,
"originalAmount": 675.94,
"beneficiary": {
"number": "12345678",
"branch": "0001",
"type": "CURRENT",
"participant": {
"name": "BACEN TESTER",
"ispb": "99999008"
},
"holder": {
"name": "QRTESTER",
"document": "11111111000191",
"type": "LEGAL"
}
},
"additionalInfos": [
{
"name": "info",
"value": "Jornada pagador 12843"
}
]
}
Below is the relation between the payment initialization throw Static QR Code
:
Name | Description |
---|---|
key | Key related to the beneficiary client . |
endToEndId | Unique payment transaction identifier |
type | QR Code type. Domain: - QR_CODE_STATIC - Static QR Code- DYNAMIC_IMMEDIATE_PAYMENT - Dynamic QR Code with immediate payment- DYNAMIC_PAYMENT_WITH_EXPIRATION - Dynamic QR Code with expiration time |
initiationType | [Helper Variable] Initialization type that must be utilized while carrying out the payment. Domain: - QR_CODE_STATIC - QR_CODE_DYNAMIC |
status | Charge situation. Domain: - ACTIVE (The QR code can be used)- CONCLUDED (The QR code has been paid)- REMOVED_BY_THE_RECEIVER (The QR code has been removed by the creator)- REMOVED_BY_PSP (The QR code has been removed by the PSP) |
transactionId | Beneficiary conciliation Id |
categoryCode | Beneficiary client category code. Default "0000" |
allowChangeAmount | Indicates which if the amount value can be changed |
Carrying out the payment
Utilizes the endToEndId while carrying out the payment initialization
. Remembering that the "endToEndId" expires and it will only be utilized once.
The payment is like the payment with key, adding a few information as follows:
Field | Description | About |
---|---|---|
transactionId | Transaction Id used to generate the QR-Code by the receiving customer in order to enable its reconciliation process | This value will be returned after the qr code payment initialization . |
initiationType | Type of initialization utilized by the payment | This will be filled in according to the type of QR-Code/Payload returned by the payment inicialization consulting. Below are the possible values: - QR_CODE_STATIC - QR_CODE_DYNAMIC |
In summary, the
transactionId
value of thepayment initiation
response will be used as thetransactionId
in making the payment, and the type of value of thepayment initiation
response will be used as theinitiationType
in making the payment.In the case which the type being QR_CODE_STATIC, utilize the
initiationType
as QR_CODE_STATIC, otherwise, send theinitiationType
as QR_CODE_DYNAMIC
- QR_CODE_STATIC -> QR_CODE_STATIC
- DYNAMIC_IMMEDIATE_PAYMENT -> QR_CODE_DYNAMIC
- DYNAMIC_PAYMENT_WITH_EXPIRATION -> QR_CODE_DYNAMIC
Segue abaixo um exemplo de request e response. Para mais detalhes deste endpoint, clique aqui.
// request
{
"amount": 9.99,
"description": "description",
"endToEndId": "E3822485720230707145006337041738",
"transactionId": "charge0000000000000083422",
"initiationType": "QR_CODE_STATIC"
}
// response
{
"id": "6742e640-f795-420a-8763-38e139eb1af7",
"endToEndId": "E3822485720230801135023201713368",
"transactionNsu": 721962,
"status": "PIX_PROCESSING",
"type": "PIX_QR_CODE_STATIC",
"amount": 675.94,
"createdAt": "2023-08-01T13:51:18.225Z",
"description": "description",
"payer": {
"number": "31712",
"branch": "0001",
"type": "CURRENT",
"holder": {
"document": "32752023000149",
"name": "bxxdbde",
"type": "LEGAL"
},
"participant": {
"name": "DELBANK",
"ispb": "38224857"
}
},
"beneficiary": {
"number": "12345678",
"branch": "0001",
"type": "CURRENT",
"holder": {
"document": "11111111000191",
"name": "QRTESTER",
"type": "LEGAL"
},
"participant": {
"name": "BACEN TESTER",
"ispb": "99999008"
}
}
}