Guides
Cobranças (boletos)

Boleto with Pix

Issue hybrid boletos with a Pix QR Code, link or cancel the Pix later and see how a Pix payment settles the boleto.

The hybrid boleto carries a dynamic Pix QR Code besides the barcode. The payer chooses: paying with either one settles the boleto.

Register with Pix

Send "indicadorPix": "S" on registration. The response carries the qrCode:

json
{
  "qrCode": {
    "url": "qrcodepix.bb.mimicr.dev/pix/v2/cobv/69bd55c0-bf68-4ed8-b0a0-fe4450b03ae7",
    "txId": "BOLETO31285570031443497DATA23102026",
    "emv": "00020101021226940014br.gov.bcb.pix2572qrcodepix.bb.mimicr.dev/pix/v2/cobv/69bd55c0-…6304FB60"
  }
}
  • emv is the Pix copy-and-paste code; build the QR from it.
  • url comes without https://, as at BB.
  • txId follows BB's pattern: BOLETO + nosso número without the 3 leading zeros + DATA + registration date (ddmmaaaa).

Without Pix, qrCode comes with the three fields empty. In Mimicr, the Pix Automático modes of indicadorPix (A, B, C) are not simulated and register the boleto without Pix.

The QR is a charge with due date (cobv) of the same account's API Pix. You can query it with Get a charge with due date or with Get an immediate charge (BB's GET /cob/{txid} also returns the charges integrated with the API Cobranças) using the txId, and the received Pix shows up in List received Pix.

An open boleto registered without Pix can get a QR once:

bash
curl --request POST \
  --url 'https://bb.mimicr.dev/cobrancas/v2/boletos/00031285570031443499/gerar-pix?gw-dev-app-key=<app-key>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "numeroConvenio": 3128557 }'
json
{
  "pix": { "chave": "e488511c-2025-4005-97ac-ff01ff2b5686" },
  "qrCode": {
    "url": "qrcodepix.bb.mimicr.dev/pix/v2/cobv/c58ff2bc-c518-4e43-aa91-37cd35fa03b1",
    "txId": "BOLETO31285570031443499DATA23102026",
    "emv": "00020101021226940014br.gov.bcb.pix2572qrcodepix.bb.mimicr.dev/pix/v2/cobv/c58ff2bc-…63048AAD"
  }
}

A boleto that already had a Pix, even cancelled, answers 400 4010074 "Alteração não permitida para o boleto". Reference: Generate the boleto's Pix.

Cancel the Pix

bash
curl --request POST \
  --url 'https://bb.mimicr.dev/cobrancas/v2/boletos/00031285570031443499/cancelar-pix?gw-dev-app-key=<app-key>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "numeroConvenio": 3128557 }'

The response has the same shape, with the cancelled QR's data. The boleto can still be paid by barcode. Reference: Cancel the boleto's Pix.

Query the Pix

bash
curl --request GET \
  --url 'https://bb.mimicr.dev/cobrancas/v2/boletos/00031285570031443497/pix?gw-dev-app-key=<app-key>&numeroConvenio=3128557' \
  --header 'Authorization: Bearer <token>'
json
{
  "id": "00031285570031443497",
  "dataRegistroTituloCobranca": "23.10.2026",
  "agenciaBeneficiario": 3301,
  "contaBeneficiario": 86319,
  "valorOriginalTituloCobranca": 150,
  "validadeTituloCobranca": "07.11.2027",
  "pix": { "valorRecebido": 0, "timestamp": "", "chave": "", "textoRetorno": "", "idInstituicaoPagador": "", "agenciaPagador": 0, "contaPagador": 0, "tipoPessoaPagador": 1, "idPagador": "" },
  "qrCode": { "url": "qrcodepix.bb.mimicr.dev/pix/v2/cobv/69bd55c0-…", "txId": "BOLETO31285570031443497DATA23102026", "emv": "…", "tipo": 2 }
}

The pix block is filled once the QR is paid (valorRecebido, timestamp, idPagador). Boleto without Pix: 404 4010673. Reference: Get the boleto's Pix.

Pay by Pix in tests

Use BB's Pix payment simulator with the boleto's copy-and-paste code:

bash
curl --request POST \
  --url 'https://bb.mimicr.dev/testes-portal-desenvolvedor/v1/boletos-pix/pagar?gw-app-key=95cad3f03fd9013a9d15005056825665' \
  --header 'Content-Type: application/json' \
  --data '{ "pix": "<the boleto emv>" }'

Or the control action, with canal: "pix":

bash
curl --request POST \
  --url https://api.mimicr.dev/v1/bb/actions/boleto.pay \
  --header 'Authorization: Bearer mk_…' \
  --header 'Content-Type: application/json' \
  --data '{ "nossoNumero": "00031285570031443497", "canal": "pix" }'

What happens:

  1. The BOLETO…DATA… cobv moves to CONCLUIDA and the Pix lands in the account. If the key has a Pix webhook, it is sent.
  2. The boleto moves to 6 (LIQUIDADO) with codigoTipoLiquidacao 4 (Pix) and codigoCanalPagamento 161.
  3. The baixa operacional webhook goes out with canalLiquidacao 4 and codigoEstadoBaixaOperacional 1.

Paid by barcode, the boleto's Pix is closed and can no longer be paid. Writing the boleto off closes the Pix too.