API Reference

Dynamic QR Code creation (Immediate Payment)

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

NameDescription
x-delbank-api-keyRequired. API key

Request Body

Only the correlationId and the amount are required

NomeTipoDescrição
correlationIdstringRequired. 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.
descriptionstringInternal charge description.
amountnumberRequired. Charge value.
formatResponseenumONLY_PAYLOAD is the default value if not directly attributed the PAYLOAD_AND_QRCODE which contains an image with 250x250px resolution.
expiresInnumberLimit 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.
payerobjectInfo about the payer client
payer.namestringName of the payer client
payer.documentstringPayer client document (CPF or CNPJ).
payer.validatebooleanFlag 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.
cityobjectInformation about the city where the transaction occurs.
city.namestringCity name where the transaction occurs.
city.zipCodestringZip 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:

NameTypeDescription
correlationIdstringCorrelation Id used for conciliation in the client system
descriptionstringInternal Charge Description
amountnumberCharge value
expiresInnumberLimit 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.
payerobjectInfo about the payer client
payer.namestringName of the payer client
payer.documentstringPayer client document number (CPF or CNPJ).
payer.validatebooleanFlag 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.
cityobjectInfo about the city where the transaction occurs.
city.namestringZip code of the location where the transaction occurs.
city.zipCodestringCopy & Paste Pix
qrCodePayloadstringPix copia e cola
qrCodeImageBase64string250x250 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.