Guides
Pagamentos em Lote webhook
Get notified of each payment made at the contract's URL, with BB's format and retries.
When a Pagamentos em Lote payment becomes PAGO, BB sends a POST to the URL registered for the payment contract. Today the notice exists only for the Pago state, and only for transfers (account credit, savings, TED, judicial deposit), Pix, boletos and barcode slips. GRU, DARF and GPS send no webhook.
Register the URL
At BB the URL is registered in the Developers Portal, per application, with the contract number as identifier; there is no API for it. In Mimicr, register it through the control API (or the console's Webhooks tab):
curl --request PUT \
--url https://api.mimicr.dev/v1/bb/webhooks \
--header 'Authorization: Bearer mk_…' \
--header 'Content-Type: application/json' \
--data '{ "lote": "https://your-app.example.com/webhooks/bb-lote" }'Send {"lote": null} to remove it. The same route stores the Cobrança URL (cobranca); the Pix one is per key, in Configure a webhook.
The payload
The body is a JSON array of events:
[
{
"numeroRequisicaoPagamento": 346625,
"codigoIdentificadorPagamento": "90346625218725001",
"nomeDoFavorecido": "NOME DO FAVORECIDO",
"numeroCPFouCNPJ": 99391916180,
"dataPagamento": "2026-10-23",
"valorPagamento": 400.75,
"codigoTextoEstado": 1,
"textoEstado": "Pago",
"codigoIdentificadorInformadoCliente": "Fornecedor",
"codigoDescricaoTipoPagamento": 1281,
"descricaoTipoPagamento": "Pagamentos Diversos Crédito em Conta"
}
]Watch the types, which differ from the rest of the API:
codigoIdentificadorPagamentois a string (the 17 digits);numeroCPFouCNPJis a number;dataPagamentois ISOyyyy-mm-dd, notddmmaaaa;textoEstadoisPago, capitalized;codigoIdentificadorInformadoClienteis the description you gave the entry.
codigoDescricaoTipoPagamento joins the product and the modality:
| Code | Description |
|---|---|
1261 / 1281 | Supplier / Miscellaneous payments, account credit |
1263 / 1283 | Supplier / Miscellaneous payments, TED |
12613 / 12813 | Barcode slip |
12630 / 12830 | BB boletos |
12631 / 12831 | Other banks' boletos |
12645 / 12845 | Pix transfer |
Answering and retries
Answer HTTP 200. The webhook has no signature or HMAC; in production BB authenticates with its own mTLS certificate. In Mimicr, any non-2xx answer or a 10 s timeout counts as a failure, and up to 3 attempts are made, 10 s apart. Requests carry Content-Type: application/json and User-Agent: BB-Webhook/1.0.
Testing
Fire the webhook of an existing payment, like the "Disparar evento" button of BB's Portal:
curl --request POST \
--url https://api.mimicr.dev/v1/bb/actions/lote.webhook_test \
--header 'Authorization: Bearer mk_…' \
--header 'Content-Type: application/json' \
--data '{ "id": "90346625218725001" }'And wait for the delivery of a real payment after releasing the batch:
npx mimicr wait bb delivery kind=lote ref=90346625218725001
Deliveries, with status, attempts and your app's answer, are at GET https://api.mimicr.dev/v1/bb/deliveries?kind=lote; resend with POST /v1/bb/deliveries/{id}/resend. Webhook chaos (first attempt failing, duplicates) is configured with PUT /v1/bb/chaos/lote; see Sandbox control.