Charge with Dynamic QR Code (Immediate Payment)
Request
POST 'https://apisandbox.delbank.com.br/baas/api/v2/pix/qrcode/dynamic
curl --location 'https://apisandbox.delbank.com.br/baas/api/v2/pix/qrcode/dynamic/' \
--header 'x-delbank-api-key: PJPyJ2xGmyB9oDHyNIUwNOt1dgpgolBwcE16ybaKD5rYEc8ujLtarBP0nNw2FKdgK+5YJFciFwTdORlZsdaTzjEbKN5ut+Ag4xGy69bbtXJmzkzRDHry9ubYbMW4xFMb' \
--header 'Content-Type: application/json' \
--data '{
"correlationId": "{{guid}}",
"amount": 0.10
}'
Headers
Name | Description |
---|---|
x-delbank-api-key | Required. API key |
Request Body
Only the correlationId
and the amount
are required
Name | Type | Description |
---|---|---|
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. |
address | object | Information about the address where the transaction occurs. |
address.cityName | string | City name where the transaction occurs. |
address.zipCode | string | Zip code of the location where the transaction occurs (CEP in Brazil). |
address.state | string | State UF code of the location where the transaction occurs |
address.street | string | Street name where the transaction occurs |
address.complement | string | Address complement if needed |
additionalInfos | object | Object containing additional information visible to the payer |
additionalInfos.name | string | Name of the additional info or description you want to add |
additionalInfos.value | string | The additional info or description you want to add |
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",
"address": {
"zipcode": "49000000",
"cityName": "SAO PAULO",
"state": "SP"
}
}
{
"correlationId": "{{$guid}}",
"amount": 0.10,
"expiresIn": 1800,
"formatResponse": "ONLY_PAYLOAD",
"address": {
"zipcode": "49000000",
"cityName": "SAO PAULO",
"state": "SP"
},
"payer": {
"document": "47779921018",
"name": "PAYER NAME",
"validate": true
}
}
{
"correlationId": "{{$guid}}",
"amount": 0.10,
"pixKey": "+5511999975734",
"expiresIn": 1800,
"formatResponse": "PAYLOAD_AND_QRCODE",
"address": {
"zipcode": "49000000",
"cityName": "SAO PAULO",
"state": "SP"
},
"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 |
transactionId | string | The Id of the QR code |
amount | number | Charged value |
allowChangeAmount | boolean | Let the payer change the amount to be paid |
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. |
address | object | Info about the city where the transaction occurs. |
createdAt | datetime | Date and time of creation |
updatedAt | datetime | Date and time of last update |
expiresAt | datetime | Date and time of expirantion |
payloadPix | string | Pix copia e cola, or, the payload that will be used to pay the QR code |
qrCodeImageBase64 | string | 250x250 image in base 64 (Verify QR_Code readability) |
additionalInfos | object | Object containing additional information visible to the payer |
additionalInfos.name | string | Name of the additional info |
additionalInfos.value | string | Message that should be displayed |
{
"correlationId": "40ede975-031d-4517-bdd4-31472d3f00a4",
"transactionId": "vchargeffab8b4c963344c283e491f5e",
"amount": 0.10,
"allowChangeAmount": false,
"expiresIn": 1800,
"status": "ACTIVE",
"payer": {
"name": "PAYER NAME",
"document": "***799210**",
"validate": true
},
"address": {
"cityName": "SAO PAULO",
"zipCode": "49000000",
"uf": "SP",
"state": "SP",
"street": "LOGRADOURO"
},
"createdAt": "2024-12-10T13:19:26.501Z",
"updatedAt": "2024-12-10T13:19:26.501Z",
"expiresAt": "2024-12-10T13:49:26.501Z",
"payloadPix": "00020101021226820014br.gov.bcb.pix2560pix-h.delbank.com.br/v2/cob/vchargeffab8b4c963344c283e491f5e5204000053039865802BR5907DELBANK6009SAO PAULO62070503***6304CB42",
"qrCodeImageBase64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAZfElEQVR4Xu3SwY4jORJEwcH+/z/",
"additionalInfos": [
{
"name": "INFO 01",
"value": "INFO VALUE 01"
}
]
}
Charge with Dynamic QR code with Due Date
A Dynamic QR code with Due Date enables the use of information such as interest, fines and discounts, in addition to the amount to be paid.
Request
POST 'https://apisandbox.delbank.com.br/baas/api/v2/pix/qrcode/due-date
curl --location 'https://apisandbox.delbank.com.br/baas/api/v2/pix/qrcode/due-date' \
--header 'x-delbank-api-key: PJPyJ2xGmyB9oDHyNIUwNOt1dgpgolBwcE16ybaKD5rYEc8ujLtarBP0nNw2FKdgK+5YJFciFwTdORlZsdaTzjEbKN5ut+Ag4xGy69bbtXJmzkzRDHry9ubYbMW4xFMb' \
--header 'Content-Type: application/json' \
--data '{
"correlationId": "{{$guid}}",
"amount": 80,
"dueDate": "2025-12-30",
"formatResponse": "PAYLOAD_AND_QRCODE",
"payer": {
"name": "João Alves",
"document": "07034346593"
},
"address": {
"cityName": "ARACAJU",
"zipCode": "49000000",
"uf": "SE",
"state": "SE",
"street": "LOGRADOURO"
},
"taxes": {
"rebateType": "FIXED_AMOUNT",
"rebateAmount": 1,
"discountType": "FIXED_AMOUNT",
"discountAmount": 1,
"interestType": "FIXED_AMOUNT",
"interestAmount": 1,
"fineType": "PERCENTAGE",
"fineAmount": 10
}
}'
Request Body
Note that the discounts/fines should have one of the following types:
Name | Description |
---|---|
FIXED_AMOUNT | Fixed discount/fine value, therefore every day overdue will incur this interest fee |
PERCENTAGE | Percentage based discount/fine value set per day, therefore every day overdue will incur this interest fee |
FIXED_AMOUNT_CALENDAR_DAY | Only for interest. Same as FIXED_AMOUNT |
PERCENTAGE_PER_DAY_CALENDAR_DAY | Only for interest. Same as PERCENTAGE |
PERCENTAGE_PER_MONTH_CALENDAR_DAY | Only for interest. Percentage set per month, therefore a payment made 15 days overdue on a 100% interest fee will have 50% interest fee |
PERCENTAGE_PER_YEAR_CALENDAR_DAY | Only for interest. Percentage set per year, therefore a payment made 6 months overdue on a 100% interest fee will have 50% interest fee |
Here are the attributes that can be passed for Due Date QR code:
Name | Type | Description |
---|---|---|
dueDate | datetime | Required. Date where the QR code is due to be paid |
maxDaysOverdue | number | Amount of days the QR code will still be payable |
taxes | object | Object used to configure the discounts/fines |
taxes.rebateType | enum | FIXED_AMOUNT or PERCENTAGE |
taxes.rebateAmount | number | This amount will be taken off the full value |
taxes.discountType | enum | FIXED_AMOUNT or PERCENTAGE |
taxes.discountAmount | number | Cannot be used with discountsDueDate. This amount will be taken off the full value only if paid before overdue |
taxes.discountsDueDate | object | Cannot be used with discountAmount. Object containing up to 3 different discount dates, if you want to add early payment incentives. |
taxes.discountsDueDate.dueDate | datetime | Cannot be used with discountAmount. The due date of up to 3 different discounts that can be offered |
taxes.discountsDueDate.amount | number | Cannot be used with discountAmount. The amount of up to 3 different discounts that can be offered |
taxes.interestType | enum | FIXED_AMOUNT_CALENDAR_DAY , PERCENTAGE_PER_DAY_CALENDAR_DAY , PERCENTAGE_PER_MONTH_CALENDAR_DAY or PERCENTAGE_PER_YEAR_CALENDAR_DAY |
taxes.interestAmount | number | Amount to be added after overdue, depending on set type |
taxes.fineType | enum | FIXED_AMOUNT or PERCENTAGE |
taxes.fineAmount | number | Amount to be added after overdue |
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 | Required. 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. |
address | object | Required. Information about the city where the transaction occurs. |
address.cityName | string | City name where the transaction occurs. |
address.zipCode | string | Zip code of the location where the transaction occurs (CEP in Brazil). |
address.uf | string | State UF code of the location where the transaction occurs |
address.state | string | State UF code of the location where the transaction occurs |
address.street | string | Street name where the transaction occurs. |
additionalInfos | object | Object containing additional information visible to the payer |
additionalInfos.name | string | Name of the additional info or description you want to add |
additionalInfos.value | string | The additional info or description you want to add |
A simple way to create a QR code with due date with all the discounts/fines goes as follows:
{
"correlationId": "{{$guid}}",
"amount": 80,
"dueDate": "2025-12-30",
"formatResponse": "PAYLOAD_AND_QRCODE",
"payer": {
"name": "João Alves",
"document": "07034346593"
},
"address": {
"cityName": "ARACAJU",
"zipCode": "49000000",
"uf": "SE",
"state": "SE",
"street": "LOGRADOURO"
},
"taxes": {
"rebateType": "FIXED_AMOUNT",
"rebateAmount": 1,
"discountType": "FIXED_AMOUNT",
"discountAmount": 1,
"interestType": "PERCENTAGE_PER_DAY_CALENDAR_DAY",
"interestAmount": 1,
"fineType": "PERCENTAGE",
"fineAmount": 10
}
}
Here's another way, here you can add up to 3 discount dates:
{
"correlationId": "{{$guid}}",
"amount": 80,
"dueDate": "2025-12-30",
"payer": {
"name": "João Alves",
"document": "07034346593"
},
"address": {
"cityName": "ARACAJU",
"zipCode": "49000000",
"uf": "SE",
"state": "SE",
"street": "LOGRADOURO"
},
"taxes": {
"rebateType": "FIXED_AMOUNT",
"rebateAmount": 1,
"discountType": "FIXED_AMOUNT",
"discountsDueDate": [
{
"dueDate": "2025-05-16",
"amount": 20
},
{
"dueDate": "2025-06-16",
"amount": 10
}
],
"interestType": "PERCENTAGE_PER_DAY_CALENDAR_DAY",
"interestAmount": 1,
"fineType": "PERCENTAGE",
"fineAmount": 10
},
"additionalInfos": [
{
"name": "INFO 01",
"value": "INFO VALUE 01"
}
]
}
Response
The status code 200
indicates success in the transaction
{
"correlationId": "ac7a235a-1a91-47b0-8da5-0eb75abf3617",
"transactionId": "wcharge0aac4378c3cf4c37b0ec16c7c",
"amount": 59.00,
"originalAmount": 80,
"dueDate": "2025-12-30",
"maxDaysOverdue": 30,
"taxes": {
"rebateType": "FIXED_AMOUNT",
"rebateAmount": 1,
"discountType": "FIXED_AMOUNT",
"discountsDueDate": [
{
"dueDate": "2025-05-16",
"amount": 20.00
},
{
"dueDate": "2025-06-16",
"amount": 10.00
}
],
"interestType": "PERCENTAGE_PER_DAY_CALENDAR_DAY",
"interestAmount": 1,
"fineType": "PERCENTAGE",
"fineAmount": 10
},
"status": "ACTIVE",
"revision": 0,
"payer": {
"name": "JOAO ALVES",
"document": "***343465**"
},
"address": {
"cityName": "ARACAJU",
"zipCode": "49000000",
"uf": "SE",
"state": "SE",
"street": "LOGRADOURO"
},
"createdAt": "2024-12-17T12:22:02.757Z",
"updatedAt": "2024-12-17T12:22:02.757Z",
"expiresAt": "2026-01-29T23:59:59.000Z",
"payloadPix": "00020101021226830014br.gov.bcb.pix2561pix-h.delbank.com.br/v2/cobv/wcharge0aac4378c3cf4c37b0ec16c7c5204000053039865802BR5907DELBANK6007ARACAJU62070503***63040F7B",
"additionalInfos": [
{
"name": "INFO 01",
"value": "INFO VALUE 01"
}
]
}