API Reference
Cobranças · Boletos

Register a boleto

POST/cobrancas/v2/boletos
Base URL: https://bb.mimicr.dev · provider: https://api.hm.bb.com.br

Registers a collection boleto, with or without a Pix QR Code (indicadorPix: "S"). One boleto per request. The response carries the nosso número (numero), the typeable line, the barcode and, with Pix, the qrCode.

The boleto starts open (codigoEstadoTituloCobranca 1, NORMAL) and can be paid right away. In Mimicr, the sandbox's and the homologação convênio (3128557), carteira 17 and variations 35 and 19 are accepted, and any CPF or CNPJ with valid check digits is accepted as payer.

Scope: cobrancas.boletos-requisicao.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Query parameters

gw-dev-app-keystringrequired

Your application's key (developer_application_key) in the Developers Portal. In Mimicr, the sandbox's (GET /v1/bb). Without it the gateway answers 403.

Example: "<app-key>"

Body

application/json
numeroConveniointegerrequired

Cobrança convênio number (7 digits). Homologação: 3128557. In Mimicr, the sandbox's convênio is also accepted.

Example: 3128557
numeroCarteiraintegerrequired

Collection portfolio. Only carteira 17 registers via the API.

Example: 17
numeroVariacaoCarteiraintegerrequired

Portfolio variation. Homologação: 35.

Example: 35
codigoModalidadeinteger

1 Simples, 4 Vinculada.

14
Example: 1
dataEmissaostring

Issue date, dd.mm.aaaa. Cannot be after today.

Example: "23.10.2026"
dataVencimentostringrequired

Due date, dd.mm.aaaa. Cannot be before the registration date.

Example: "12.11.2026"
valorOriginalnumberrequired

Boleto amount in reais, greater than zero and greater than discounts + abatimento.

Example: 150
valorAbatimentonumber

Abatimento (reduction) in reais.

quantidadeDiasProtestointeger

Days until protest: 0, 3 to 29, 35, 40 or 45.

quantidadeDiasNegativacaointeger

Calendar days after the due date for credit-bureau listing.

orgaoNegativadorinteger

10 SERASA, 11 QUOD.

indicadorAceiteTituloVencidostring

S accepts payment after the due date up to numeroDiasLimiteRecebimento; N doesn't.

SN
numeroDiasLimiteRecebimentointeger

Days after the due date during which the boleto can still be paid; less than 360 (4882713). In Mimicr, without it the limit is 360 days.

codigoAceitestring

A accepted, N not accepted.

AN
Example: "A"
codigoTipoTitulointegerrequired

Kind of bill: 1 cheque, 2 duplicata mercantil, 3 duplicata mercantil por indicação, 4 duplicata de serviço, 5 duplicata de serviço por indicação, 6 duplicata rural, 7 letra de câmbio, 8 nota de crédito comercial, 9 nota de crédito à exportação, 10 nota de crédito industrial, 11 nota de crédito rural, 12 nota promissória, 13 nota promissória rural, 14 triplicata mercantil, 15 triplicata de serviço, 16 nota de seguro, 17 recibo, 18 fatura, 19 nota de débito, 20 apólice de seguro, 21 school fee, 22 consortium installment, 23 federal outstanding debt, 24 state outstanding debt, 25 municipal outstanding debt, 31 credit card, 32 boleto proposta, 33 boleto aporte, 99 other. Missing: 400 4012111 "Espécie não informada.". In Mimicr, a value outside this table also answers 4012111 (BB documents no code for an invalid kind).

29 values
1234567891011121314151617181920212223242531323399
Example: 2
descricaoTipoTitulostring

Free description of the kind.

Example: "DM"
indicadorPermissaoRecebimentoParcialstring

S allows partial payment; N doesn't.

SN
numeroTituloBeneficiariostring

Seu número: up to 15 characters (A–Z, 0–9, -, ', space).

Example: "12501"
campoUtilizacaoBeneficiariostring

Beneficiary free field: up to 25 uppercase characters, no special characters or double spaces (4678420).

numeroTituloClientestring

Nosso número: 000 + convênio (7) + control number (10). A repeated one answers 4874915. In Mimicr, when omitted, the bank numbers it.

Example: "00031285570031443497"
mensagemBloquetoOcorrenciastring

Message printed on the boleto (up to 165 characters, no line breaks).

descontoobject

First discount.

Show child attributes
tipointeger

Discount type: 0 none, 1 fixed amount until the date, 2 percentage until the date, 3 per day of early payment.

0123
dataExpiracaostring

Discount deadline, dd.mm.aaaa. Required when tipo > 0 and must be before the due date.

Example: "02.11.2026"
porcentagemnumber

Discount percentage (type 2).

valornumber

Discount amount in reais (type 1).

Example: 5
segundoDescontoobject

Second or third discount. It has no tipo: it inherits the first discount's type.

Show child attributes
dataExpiracaostring

Deadline, dd.mm.aaaa, after the previous discount's date.

porcentagemnumber

Percentage (when the first discount is type 2).

valornumber

Amount in reais (when the first discount is type 1).

terceiroDescontoobject

Second or third discount. It has no tipo: it inherits the first discount's type.

Show child attributes
dataExpiracaostring

Deadline, dd.mm.aaaa, after the previous discount's date.

porcentagemnumber

Percentage (when the first discount is type 2).

valornumber

Amount in reais (when the first discount is type 1).

jurosMoraobject

Late interest, computed on the original amount minus the abatimento.

Show child attributes
tipointeger

0 waive, 1 amount per day late, 2 monthly rate, 3 exempt.

0123
Example: 2
porcentagemnumber

Monthly rate in % (type 2).

Example: 1
valornumber

Amount per day late in reais (type 1).

multaobject

Late fine.

Show child attributes
tipointeger

0 waive, 1 fixed amount, 2 percentage.

012
Example: 2
datastring

Date from which the fine applies, dd.mm.aaaa, after the due date.

Example: "13.11.2026"
porcentagemnumber

Percentage (type 2).

Example: 2
valornumber

Amount in reais (type 1).

pagadorobjectrequired

The boleto's payer.

Show child attributes
tipoInscricaointegerrequired

1 CPF, 2 CNPJ.

12
Example: 1
numeroInscricaostringrequired

CPF (11 digits) or CNPJ (14, alphanumeric allowed), with or without mask. A JSON number is also accepted. An invalid document answers 4500431 (CPF) or 4500947 (CNPJ).

Example: "96050176876"
nomestring

Payer name (up to 60).

Example: "VALERIO DE AGUIAR ZORZATO"
enderecostring

Address (up to 60).

cepinteger

Postal code, no leading zeros.

Example: 74715715
cidadestring

City (up to 30).

bairrostring

District (up to 30).

ufstring

State, 2 letters.

Example: "GO"
telefonestring

Phone (up to 30).

emailstring

E-mail to send the boleto to. An invalid e-mail does not fail registration: observacao says it was not sent.

beneficiarioFinalobject

Final beneficiary (sacador avalista).

Show child attributes
tipoInscricaointeger

1 CPF, 2 CNPJ.

12
numeroInscricaostring

CPF or CNPJ of the final beneficiary (sacador avalista).

nomestring

Name (up to 30).

indicadorPixstring

S registers the boleto with a dynamic Pix QR Code (hybrid boleto); any other value registers it without Pix. In Mimicr, the Pix Automático modes (A, B, C) are not simulated and behave as N.

SN
Example: "S"

Responses

201Boleto registered.
beneficiarioobject

Beneficiary (convênio owner) with its registered address.

Show child attributes
agenciainteger
Example: 3301
contaCorrenteinteger
Example: 86319
tipoEnderecointeger
logradourostring
bairrostring
cidadestring
codigoCidadeinteger
ufstring
cepinteger
indicadorComprovacaostring
qrCodeobject

The boleto's Pix QR Code. Empty ("" in each field) when the boleto has no Pix.

Show child attributes
urlstring

Pix payload URL (location), without scheme.

Example: "qrcodepix.bb.mimicr.dev/pix/v2/cobv/69bd55c0-bf68-4ed8-b0a0-fe4450b03ae7"
txIdstring

txid of the boleto's Pix charge: BOLETO + nosso número without the 3 zeros + DATA + registration date (ddmmaaaa).

Example: "BOLETO31285570031443497DATA23102026"
emvstring

Pix copy-and-paste code (EMV BR Code).

numerostring

The boleto's nosso número (20 characters). Use it as {id} in the other operations.

Example: "00031285570031443497"
numeroCarteirainteger
Example: 17
numeroVariacaoCarteirainteger
Example: 35
codigoClienteinteger

Client code (the convênio).

Example: 3128557
linhaDigitavelstring

Typeable line (47 digits, no dots).

Example: "00190000090312855700031443497172516280000015000"
codigoBarraNumericostring

Barcode (44 digits).

Example: "00195162800000150000000003128557003144349717"
numeroContratoCobrancainteger

Collection contract number.

urlImagemBoletostring

BB page with the boleto's PDF copy.

observacaostring

Notice about the registration, e.g. boleto not e-mailed; empty when there is none.

400Invalid data: missing required field, convênio/carteira/variação not registered (4432632), dates, discounts, interest, fine, CPF/CNPJ (4500431, 4500947), invalid (4494380, 4023524) or repeated (4874915) nosso número, invalid JSON (999).
errosobject[]required
Show child attributes
codigostringrequired

Error message code (the API's error table).

Example: "4874915"
versaostringrequired

Message version.

Example: "1"
mensagemstringrequired

Error text.

Example: "Nosso Número já incluído anteriormente."
providenciastring

How to fix it; empty when BB gives no hint.

Example: "Informar outro Nosso Número."
ocorrenciastringrequired

BB's occurrence id (trace), not an HTTP code. N/A on generic errors.

Example: "000000000000000000221327"
401Missing, invalid or expired token.
statusCodeinteger
Example: 401
errorstring
Example: "Unauthorized"
messagestring
Example: "Bad credentials"
attributesobject
Show child attributes
errorstring
Example: "Bad Credentials"
403Missing or invalid application key (gateway shape), or a token without the operation's scope (Application key is not allowed to call this resource method).
Gateway
detailstring

Gateway error description.

Example: "A chave de aplicacao (AppKey) nao foi informada"
userHelpstring

How to solve it.

errorCodestring
Example: "403"
bbMsgobject
Show child attributes
categoriastring
Example: "SISTEMA"
tipostring
Example: "ERRO"
Escopo
statusCodeinteger
Example: 401
errorstring
Example: "Unauthorized"
messagestring
Example: "Bad credentials"
attributesobject
Show child attributes
errorstring
Example: "Bad Credentials"
500Internal error.
errosobject[]required
Show child attributes
codigostringrequired

Error message code (the API's error table).

Example: "4874915"
versaostringrequired

Message version.

Example: "1"
mensagemstringrequired

Error text.

Example: "Nosso Número já incluído anteriormente."
providenciastring

How to fix it; empty when BB gives no hint.

Example: "Informar outro Nosso Número."
ocorrenciastringrequired

BB's occurrence id (trace), not an HTTP code. N/A on generic errors.

Example: "000000000000000000221327"