Guides
Webhooks

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):

bash
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:

json
[
  {
    "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:

  • codigoIdentificadorPagamento is a string (the 17 digits);
  • numeroCPFouCNPJ is a number;
  • dataPagamento is ISO yyyy-mm-dd, not ddmmaaaa;
  • textoEstado is Pago, capitalized;
  • codigoIdentificadorInformadoCliente is the description you gave the entry.

codigoDescricaoTipoPagamento joins the product and the modality:

CodeDescription
1261 / 1281Supplier / Miscellaneous payments, account credit
1263 / 1283Supplier / Miscellaneous payments, TED
12613 / 12813Barcode slip
12630 / 12830BB boletos
12631 / 12831Other banks' boletos
12645 / 12845Pix 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:

bash
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:

bash
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.