Introduction
Callbacks, or webhooks, are mechanisms that allows a function to be executed in response to a specific event. In the context of the BMP APIs, a callback is sent automatically whenever specific events occur in the system. This allows efficient communication between different parts of an application. This mechanism is used to notify updates to the status of proposals, eliminating the need for constant checks. In this context, information is received automatically and in real time, without the need for the partner to execute a command to update itself with a response. In this document, we present how this procedure works, its importance in integrations and how to use it in the development of your application when using BMP APIs.Settings
Partner Configuration
Partners can configure how they want to receive the callback notifications, defining the following characteristics:
URL
The partner must specify the URL of the callback that will be called to send the information.Example:
Environments
The callback for monitoring the status of proposals must be sent to both the approval environment and the production environment. It is recommended that different URLs be used for each environment.
Authentication
To ensure the security of the callback sent, we recommend that the partner define an authentication method.The following are the available authentication methods:Available options include:
Accepted authentication methods
| Authentication | Key | Example Token |
|---|---|---|
| Bearer Token | Authorization | Bearer eyJhbGciOiJIUzI1CI6IkpXVCJ9 |
| API Key | API-Key | 1234567890abcdef1234567890abcdef |
| Basic Authentication | Authorization | Basic dXNlcm5hbWU6cGFzc3dvcmQ |
| X-API-Key | X-API-Key | 0987654321fedcba0987654321fedcba |
| JWT (JSON Web Token) | Authorization | Bearer eyJhbGciOiJIUzI1NiIs |
| HMAC (Hash-based Message Authentication Code) | Authorization | HMAC 5d41402abc4b19d911017c592 |
Proposal callback example
Here is an example of a URL and how we parameterize it for reception:
Proposal callback parameters table
| Parameter | Parameter description |
|---|---|
| Proposal | Unique GUID generated in the response during proposal inclusion. |
| Status | Proposal status ID in our system. |
| Identifier | If sent, this field represents the operation code sent when the proposal was included. |
Proposal status identification table
| ID | Description | Purpose |
|---|---|---|
| 2 | Approved | Proposal was created and is awaiting signature. |
| 4 | Canceled | Proposal was canceled automatically or by the integrator. |
| 5 | Pending | Proposal was marked as pending and requires intervention by the integrator to request endorsement again. |
| 6 | Completed | Endorsement was requested at CEF (Caixa Econômica Federal). |
| 8 | Released | Proposal successfully endorsed and released for disbursement. |
| 9 | Paid | Proposal disbursement was made. |
| 10 | Assigned | Proposal was added to an assignment shipment and assigned to the fund. |
| 11 | Pending Payment | The proposal is pending payment due to inconsistent bank details, requiring the integrator to correct them and return it to the payment queue. |
If the callback is sent with the
POST method, in addition to the data sent in the Query, the partner will receive in the body of the request:- Status 9:
00 - Credit or debit made; - Status 10:
AB - Description of the occurrence.
This callback is used to communicate the creation of an installment schedule, detailing information about installments, amounts, and relevant dates.
{
"QtdeParcelas": 8,
"VlrTotalDivida": 11.2,
"DtFinanciado": "06-09-2024",
"Credito": {
"DtCredito": null,
"Conta": {
"CodigoBanco": null,
"NomeBanco": null,
"Agencia": null,
"Conta": null,
"ContaDigito": null
}
},
"Parcelas": [
{
"NroParcela": 1,
"VlrParcela": 1.4,
"VlrPrincipal": 1.25,
"VlrDespesas": 0.15,
"VlrSaldoDevedor": 9.8,
"DtVencimento": "16-09-2024"
},
{
"NroParcela": 2,
"VlrParcela": 1.4,
"VlrPrincipal": 1.25,
"VlrDespesas": 0.15,
"VlrSaldoDevedor": 8.4,
"DtVencimento": "16-10-2024"
}
]
}
Callback used to notify the cancellation of a previously created schedule, including event details and the associated proposal number.
{
"TipoEvento": 1,
"NomeEvento": "Cancelamento de Agenda",
"NroProposta": 3543743,
"DtEvento": "2024-09-05",
"AcrescimoAbatimento": null,
"LancamentoParcela": null,
"ProrrogacaoVencimento": null,
"GeracaoBoleto": null,
"CancelamentoBoleto": null
}
Callback that informs financial changes in proposal installments, whether due to increases or reductions applied.
{
"TipoEvento": 2,
"NomeEvento": "Acréscimo/Abatimento",
"NroProposta": 3543753,
"DtEvento": "2024-09-05",
"AcrescimoAbatimento": {
"NroParcela": 2,
"VlrSaldo": 0,
"VlrAcrescimo": 10,
"VlrAbatimento": 0,
"VlrSaldoAtual": 10
},
"LancamentoParcela": null,
"ProrrogacaoVencimento": null,
"GeracaoBoleto": null,
"CancelamentoBoleto": null
}
Callback that communicates events related to installment entries, such as payment, reductions, charges, or settlement.
{
"TipoEvento": 3,
"NomeEvento": "Lançamento na Parcela",
"NroProposta": 3543603,
"DtEvento": "2024-09-05",
"AcrescimoAbatimento": null,
"LancamentoParcela": {
"NroParcela": 1,
"VlrOriginalParcela": 72.24,
"VlrSaldo": 0,
"ParcelaLiquidada": true,
"VlrEncargos": 0,
"VlrAbatimento": 0,
"VlrPagamento": 72.24,
"VlrDesconto": 0,
"VlrSaldoAtual": 0,
"VlrExcedente": 0,
"DtVencimento": "2024-09-15",
"DtVencimentoAtual": "2024-10-30",
"Boleto": {
"NroBoleto": null,
"Liquidacao": null
}
},
"ProrrogacaoVencimento": null,
"GeracaoBoleto": null,
"CancelamentoBoleto": null
}
Callback used to notify extensions of installment due dates, providing the new date and the reasons for the change.
{
"TipoEvento": 4,
"NomeEvento": "Prorrogação de Vencimento",
"NroProposta": 3543603,
"DtEvento": "2024-09-05",
"AcrescimoAbatimento": null,
"LancamentoParcela": null,
"ProrrogacaoVencimento": {
"NroParcela": 1,
"DtVencimentoAnterior": "2024-09-15",
"DtVencimentoAtual": "2024-10-30"
},
"GeracaoBoleto": null,
"CancelamentoBoleto": null
}
Callback that informs the generation of an invoice related to a proposal, including the amount, number, and due date.
{
"TipoEvento": 5,
"NomeEvento": "Geração de Boleto",
"NroProposta": 3544197,
"DtEvento": "2024-09-06",
"AcrescimoAbatimento": null,
"LancamentoParcela": null,
"ProrrogacaoVencimento": null,
"GeracaoBoleto": {
"CodigoBoleto": "8a72e6a3-cf73-46cb-99ee-b698335f1e12",
"NroBoleto": 48924,
"VlrBoleto": 1.4,
"DtVencimento": "2024-09-25",
"Liquidacao": true
},
"CancelamentoBoleto": null
}
Callback used to notify the cancellation of an invoice, including the canceled invoice code and the associated installments.
{
"TipoEvento": 6,
"NomeEvento": "Cancelamento de Boleto",
"NroProposta": 3541909,
"DtEvento": "2024-08-30",
"AcrescimoAbatimento": //Object
"LancamentoParcela": //Object
"ProrrogacaoVencimento": null, //Datetime
"GeracaoBoleto": null, //Object
"CancelamentoBoleto": {
"CodigoBoleto": "8f3898e2-c99b-40f2-9d13-6a23e5b7e082",
"NroBoleto": 48681,
"Parcelas": [
3
]
}
}

