Guides
Getting started

Environment

Hosts, the sandbox account, BB test data that is accepted, balance, clock and background processing.

Hosts

APIMimicr hostEquivalent to
OAuthhttps://oauth.bb.mimicr.dev/oauth/tokenhttps://oauth.hm.bb.com.br/oauth/token
Pixhttps://api-pix.bb.mimicr.dev/pix/v2https://api-pix.hm.bb.com.br/pix/v2
Cobrançashttps://bb.mimicr.dev/cobrancas/v2https://api.hm.bb.com.br/cobrancas/v2
Pagamentos em Lotehttps://bb.mimicr.dev/pagamentos-lote/v1 or https://pagamentos-lote.bb.mimicr.dev/v1https://api.hm.bb.com.br/pagamentos-lote/v1 or https://pagamentos-lote.mtls.api.hm.bb.com.br/v1
Extratos v1https://bb.mimicr.dev/extratos/v1https://api.hm.bb.com.br/extratos/v1
Extratos v2https://bb.mimicr.dev/extratos/v2 or https://extratos.bb.mimicr.dev/v2https://extratos.mtls.api.hm.bb.com.br/v2
Simulatorshttps://bb.mimicr.dev/testes-portal-desenvolvedor/v1https://api.hm.bb.com.br/testes-portal-desenvolvedor/v1

Every subdomain of bb.mimicr.dev answers the same routes, so https://bb.mimicr.dev/pix/v2 works too. On the dedicated pagamentos-lote. and extratos. hosts the path has no API segment (/v1/lotes-transferencias, /v2/conta-corrente/...), like BB's mTLS hosts.

Differences from BB:

  • There is no mTLS. You need no ICP-Brasil certificate to call the APIs or to receive webhooks.
  • Unknown prefixes answer BB's generic 404; known routes with the wrong method or a trailing slash answer 404 Api not found.
  • Webhooks are not signed and don't use mTLS. See Pix webhook.

The sandbox account

Each organization has one sandbox, which stands for a company that is a BB customer. Its data comes from GET https://api.mimicr.dev/v1/bb:

FieldUse
credentials.developer_application_keygw-dev-app-key of every call
credentials.client_id, credentials.client_secretBasic auth of POST /oauth/token
account.agencia, account.conta, account.digitoCurrent account: batch debits, statement, boletos
account.convenio_cobranca, carteira 17, variacao_carteira 35Boleto registration
account.contrato_pagamentonumeroContratoPagamento of the batches
pix_keysThe account's Pix keys: EVP, e-mail and CNPJ

BB test data that is accepted

BB's homologação is shared and uses fixed data. Mimicr accepts that data as your sandbox's own, so code that already runs against BB's homologação works without changing its configuration:

APIAccepted data
PixKeys hmtestes2@bb.com.br, 9e881f18-cc66-4fc7-8f2c-a795dbb2bfc1, +5511985732102 and 95127446000198
CobrançasConvênio 3128557, agência 452, conta 123873
Pagamentos em LoteContract 731030, agência 1607, conta 99738672-X
ExtratosAgência and conta 551/5087, 1505/1348 and 452/123873
SimulatorsThe portal's public app key 95cad3f03fd9013a9d15005056825665

Data stays isolated: a resource created with convênio 3128557 only shows up in your sandbox. The exception is the boleto simulator, which looks the boleto up by its linha digitável in any sandbox. More in Homologação.

Balance

The sandbox starts with R$ 50,000.00 in the current account. The balance is not stored: it is computed from what happened.

  • Credits: received Pix (with or without txid) and boletos settled by barcode. A boleto paid through its Pix QR counts as the Pix.
  • Debits: refunds DEVOLVIDO and batch payments PAGO. A DEVOLVIDO payment comes back as a credit.

The same movements make up the lines of the Statement. Without balance, refunds end NAO_REALIZADO and batch payments become BLOQUEADO. The current value is balance (cents) in GET /v1/bb.

Dates and clock

The APIs answer in Brasília time (-03:00), each with BB's own date format (see Formats and pagination).

The sandbox has its own clock. Move it with POST https://api.mimicr.dev/v1/bb/clock/advance or npx mimicr clock bb +1d to test cob expiration, due dates, interest, fines and boleto write-off after the deadline, scheduled batches, the 30-minute lock and the 600 s token expiry. A reset brings the clock back to real time. See Sandbox control.

Background processing

What at BB happens after the response also happens here, a few seconds later:

StepWhen
Pix refund EM_PROCESSAMENTO → DEVOLVIDO or NAO_REALIZADO~3 s after the PUT
Batch validated (state 1, 2 or 3 → 4, or rejected)~2 s after the POST
Released entry → AGUARDANDO DEBITO → PAGO~3 s later, on the payment date
PAGO payment of value x.92 → DEVOLVIDO~3 s after the payment
Boleto past its receiving deadline → BAIXADOWhen the sandbox clock's day turns
Webhook retry10 s after a failure, up to 3 attempts

These steps run before each API call, right after each call that changes data, every minute and when you call wait or POST /v1/bb/sweep on the control API.