This topic has an objective of describing and few endpoints to execute the payment conciliation.
The payment verification can be received throw a charge, can be made in the following ways:
- Payment Conciliation/Query
- Webhook configuration
Charge payment query
QR Code Charge payment, depending on its type and/or parametrization, takes effect more than once. It is provided and API for consulting batch payments on a specific charge.
IMPORTANT: Remember to always use the
correlationId
, because this key provides the conciliation between theclient system
and theDelbank's Charge system
.
The payment query response will always be in decreasing order by the payment date a will return the following information:
Name | Description | Observations |
---|---|---|
nsu | Unique Sequential Number | Can be utilized in the charge's payment and use it as a reference for the pagination to facilitate the conciliation process. |
correlationId | Correlation | Id used by the conciliation with the client's system . |
referenceId | Payment Reference | This field contains the payment identification according to its origin. For payments via Pix, it will always be an endToEndId , for payments via bank slip, it will be the PCR write-off identification . |
source | Payment origin | For payments via Pix, it will be informed the SPI (Instant Payment System) |
createdAt | Payment date | |
payer | Informations about the payer | |
proof | Proof of payment | This field is a generic value that will be returned with its payment origin. Below is the proof model. |
Proof
The charge generation can be of the Pix type (Static QR Code or Dynamic QR Code), bank slip or bank slip Pix, therefore, it is possible to have more than one payment source.
For example, when making a bank slip payment, there is information about the payer, receiving bank, receiving agency, etc., whereas payment via Pix has the payer's account, Pix key, etc.
To allow the same reconciliation flow for both types of charges, the proof
field will contain information regarding the respective payment origin and thus allow the client system
to use the information as needed.
Segue abaixo o modelo de comprovante de um pagamento via Pix
{
"endToEndId":"E3822485720230705211537850921369",
"key":"5b0ac9a4-fad6-43f9-be70-6d7c9a2fad26",
"amount":12.12,
"payer":{
"number":"10065",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"Fulano da Silva",
"document":"10126227039"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
},
// legacy object
"payee":{
"number":"29823",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"HOMOLOGACAO INTEGRACAO API",
"document":"30287697789"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
},
"beneficiary":{
"number":"29823",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"HOMOLOGACAO INTEGRACAO API",
"document":"30287697789"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
}
}
Consultation examples
The payment consultation can be made in a generic way, meaning that, consulting every received payment or consulting a specific charge payment.
As the explanation about the pagination use querying the information on the API, below is an example:
// request cURL
curl --location 'http://.../api/v1/charges/217c34be-b374-4e33-9ae2-1b46f14b7116/payments?page=1&limit=10' \
--header 'x-delbank-api-key: PJPyJ2xGmyB9oDHyNIUwNOt1dgpgolBwcE16ybaKD5q5eXIoHXNudlu+EaCcwXyLnryGdeBNfqofzLQe9f7s/iMVnsMZrbAPO/cYn6pTQEHVErYL080/hmZYV8faI89D'
[
{
"nsu":513,
"correlationId":"217c34be-b374-4e33-9ae2-1b46f14b7116",
"referenceId":"E3822485720230705211537850921369",
"source":"SPI",
"amount":12.12,
"createdAt":"2023-07-05T17:52:33Z",
"payer":{
"name":"MARCONI DO NASCIMENTO OLIVEIRA",
"document":"***999999**"
},
"proof":{
"endToEndId":"E3822485720230705211537850921369",
"transactionId":"chargeCqkFlaENmal5NrPK58J",
"key":"5b0ac9a4-fad6-43f9-be70-6d7c9a2fad26",
"amount":12.12,
"payer":{
"number":"10065",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"Fulano da Silva",
"document":"10126227039"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
},
// legacy object
"payee":{
"number":"29823",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"HOMOLOGACAO INTEGRACAO API",
"document":"30287697789"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
},
"beneficiary":{
"number":"29823",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"HOMOLOGACAO INTEGRACAO API",
"document":"30287697789"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
}
}
},
{
"nsu":512,
"correlationId":"217c34be-b374-4e33-9ae2-1b46f14b7116",
"referenceId":"E3822485720230705211537850921369",
"source":"SPI",
"amount":12.12,
"createdAt":"2023-07-05T17:52:33Z",
"payer":{
"name":"MARCONI DO NASCIMENTO OLIVEIRA",
"document":"***999999**"
},
"proof":{
"endToEndId":"E3822485720230705211537850921369",
"transactionId":"chargeCqkFlaENmal5NrPK58J",
"key":"5b0ac9a4-fad6-43f9-be70-6d7c9a2fad26",
"amount":12.12,
"payer":{
"number":"10065",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"Fulano da Silva",
"document":"10126227039"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
},
// legacy object
"payee":{
"number":"29823",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"HOMOLOGACAO INTEGRACAO API",
"document":"30287697789"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
},
"beneficiary":{
"number":"29823",
"branch":"0001",
"type":"CURRENT",
"holder":{
"name":"HOMOLOGACAO INTEGRACAO API",
"document":"30287697789"
},
"participant":{
"ispb":"38224857",
"name":"DELCRED SCD S.A."
}
}
}
}
]
For more examples like this, click here.
Polling Algorithm
To make things easier, Delbank recommends that you utilize the NSU field as a reference. Following below are examples:
- To query every payment utilize the following endpoint GET
charges/payments?page=1&limit=10
- Process every payment and save the bigger NSU returned (will always be the first, because it's in decreasing order). For example, the
NSU 115
.- Note that the
correlation id
will be returned and with this, you can process the information on theclient system
.
- Note that the
- During the following consults, use the NSU as a reference, like
charges/payments?page=1&limit=10&afterNsu=115
- Back to
passo 2
For more details of this endpoint, click here.
Webhook
Event list
Webhook return
{
"nsu":513,
"correlationId":"217c34be-b374-4e33-9ae2-1b46f14b7116",
"referenceId":"E3822485720230705211537850921369",
"source":"SPI",
"amount":12.12,
"createdAt":"2023-07-05T17:52:33Z",
"payer":{
"name":"FULANO DA SILVA DO NASCIMENTO OLIVEIRA",
"document":"***999999**"
},
"proof":{
"endToEndId":"E3822485720230705211537850921369",
"transactionId":"chargeCqkFlaENmal5NrPK58J",
"key":"5b0ac9a4-fad6-43f9-be70-6d7c9a2fad26",
"amount":12.12,
...
}
}