Charge with Dynamic QR Code (Immediate Payment)
Requisition
POST 'https://apisandbox.delbank.com.br/baas/api/v2/pix/qrcode/dynamic
curl --location 'https://apisandbox.delbank.com.br/baas/api/v1/charges' \
--header 'Content-Type: application/json' \
--header 'x-delbank-api-key: ${apiKey}' \
--data '{
"correlationId": "8a1ce36a-886c-431a-9f83-38e7d7a3f012",
"type": "PIX_DYNAMIC",
"expiresIn": 3600,
"amount": 9.00,
"city": {
"zipCode": "49000000",
"name": "ARACAJU"
},
"payer": {
"document": "86173851547",
"name": "payer name"
}
}'
Headers
Name | Description |
---|---|
x-delbank-api-key | Required. API key |
Request Body
Only the correlationId
and the amount
are required
Nome | Tipo | Descrição |
---|---|---|
correlationId | string | Required. Correlation IDs are for conciliation with the client system . This value will be returned to the integration through a webhook and can be used to consult on charges and payments. |
description | string | Internal charge description. |
amount | number | Required. Charge value. |
formatResponse | enum | ONLY_PAYLOAD is the default value if not directly attributed the PAYLOAD_AND_QRCODE which contains an image with 250x250px resolution. |
expiresIn | number | Limit for QR Code expiration, with a granularity of seconds, so that payment of the charge can be made, from the date-time of creation or expiration, if applicable. If not informed, the default value is 86400 . |
payer | object | Info about the payer client |
payer.name | string | Name of the payer client |
payer.document | string | Payer client document (CPF or CNPJ). |
payer.validate | boolean | Flag indicating that the payer must be validated during the cash process. With this flag enabled, the QR Code can only be paid by this payer. |
city | object | Information about the city where the transaction occurs. |
city.name | string | City name where the transaction occurs. |
city.zipCode | string | Zip code of the location where the transaction occurs (CEP in Brazil). |
Basic example
The easiest way of creating a Dynamic QR Code is the following:
{
"correlationId": "{{$guid}}",// This value must be a GUID
"amount": 0.10
}
Beyond the informations above, it's possible to send a expiration time (If not attributed the default value is 86400
).
{
"correlationId": "{{$guid}}",
"amount": 0.10,
"expiresIn": 1800,
"formatResponse": "ONLY_PAYLOAD"
}
Following are some valid payload examples with optional additional information
{
"correlationId": "{{$guid}}",
"amount": 0.10,
"expiresIn": 1800,
"formatResponse": "ONLY_PAYLOAD",
"city": {
"zipcode": "49000000",
"name": "SAO PAULO"
}
}
{
"correlationId": "{{$guid}}",
"amount": 0.10,
"expiresIn": 1800,
"formatResponse": "ONLY_PAYLOAD",
"city": {
"zipcode": "49000000",
"name": "SAO PAULO"
},
"payer": {
"document": "47779921018",
"name": "PAYER NAME"
}
}
{
"correlationId": "{{$guid}}",
"amount": 0.10,
"expiresIn": 1800,
"formatResponse": "ONLY_PAYLOAD",
"city": {
"zipcode": "49000000",
"name": "SAO PAULO"
},
"payer": {
"document": "47779921018",
"name": "PAYER NAME",
"validate": true
},
"additionalInfos": [
{
"name": "INFO 01",
"value": "INFO VALUE 01"
}
]
}
Response
The status code 200
indicates success in the transaction
Being succeeded, the return will have the following fields in Json format:
Name | Type | Description |
---|---|---|
correlationId | string | Correlation Id used for conciliation in the client system |
description | string | Internal Charge Description |
amount | number | Charge value |
expiresIn | number | Limit for QR Code expiration, with a granularity of seconds, so that payment of the charge can be made, from the date-time of creation or expiration, if applicable. If not informed, the default value is 86400. |
payer | object | Info about the payer client |
payer.name | string | Name of the payer client |
payer.document | string | Payer client document number (CPF or CNPJ). |
payer.validate | boolean | Flag indicating that the payer must be validated during the cash process. With this flag enabled, the QR Code can only be paid by this payer. |
city | object | Info about the city where the transaction occurs. |
city.name | string | Zip code of the location where the transaction occurs. |
city.zipCode | string | Copy & Paste Pix |
qrCodePayload | string | Pix copia e cola |
qrCodeImageBase64 | string | 250x250 image in base 64 (Verify QR_Code readability) |
{
"correlationId": "85355975-8aea-4397-b40a-223086319404",
"amount": 0.10,
"status": "PENDING",
"expiresIn": 1800,
"createdAt": "2024-02-08T11:58:28.827Z",
"updatedAt": "2024-02-08T11:58:28.827Z",
"expiresAt": "2024-02-08T12:28:28.827Z",
"qrCodePayload": "00020101021226850014br.gov.bcb.pix2563pix-h.delbank.com.br/v1/qrcode/vcharge7f9b6b4ff88241338afcf96a15204000053039865802BR5907DELBANK6007ARACAJU62070503***6304AC1E",
"payer": {
"name": "PAYER NAME",
"document": "47779921018",
"validate": true
}
}
Another field will be returned with the body resquest insertion, otherwise, if the city field was informed, it will be returned.