Guides
Getting started

Homologação

BB's payment simulators, the convênio and test data, the values that force outcomes and the sandbox switches.

BB's homologação has no payer or bank on the other side: it offers two payment simulators and a set of fixed data. Mimicr reproduces both simulators and accepts the same data. For everything BB doesn't simulate (Pix without txid, refunds, batch payments), use the control API actions; see Sandbox control.

Pix payment simulator

Pays an ATIVA cob or cobv from its copia e cola, as BB's test payer:

bash
curl --request POST \
  --url 'https://bb.mimicr.dev/testes-portal-desenvolvedor/v1/boletos-pix/pagar?gw-dev-app-key=<app-key>' \
  --header 'Content-Type: application/json' \
  --data '{ "pix": "<pixCopiaECola>" }'
json
{"code": 1,"texto": "E000000002026102304576VBYCAW5OYZ"}
  • texto is the endToEndId of the new Pix. The charge becomes CONCLUIDA right away.
  • No token is needed. The app key can be your sandbox's or BB's public portal key, 95cad3f03fd9013a9d15005056825665, in gw-dev-app-key or gw-app-key.
  • The payer is always VICTOR LOPES DORNELES, CPF 93492239293, and the amount is the charge's. A cobv is paid at its original value, on the day, even with a future due date.
  • Empty copia e cola: 422 with code 421. A copia e cola that doesn't point to a Mimicr charge, or a charge that isn't ATIVA: 500 ERRO_SISTEMA, with the reason in variaveisMonitoradas.

See Pay a Pix QR Code (simulator). To choose the payer, use the pix.pay_cob action with payer_document and payer_name.

Boleto payment simulator

Pays an open boleto of the Cobranças API by its linha digitável (47 digits) or barcode (44):

bash
curl --request POST \
  --url 'https://bb.mimicr.dev/testes-portal-desenvolvedor/v1/boletos-cobranca/00190000090312855700031443497172516280000015000/pagar?gw-app-key=95cad3f03fd9013a9d15005056825665'
json
{ "mensagem": "Boleto pago com sucesso." }
  • The boleto is settled (state 6) on the day of the call, even with a future due date, for the amount due that day. The account is credited and the Cobrança URL receives the baixa operacional webhook.
  • BB documents GET; Mimicr accepts GET and POST, with no token and no body. Other methods answer 404 Api not found.
  • Wrong length: 400 3295618 "Número do Título Inválido". Boleto that doesn't exist: 404 4023795. Boleto already paid or written off: 400 4007954.

See Pay a boleto (simulator). To pay at another bank, through the boleto's Pix or with a partial amount, use the boleto.pay action.

BB's homologação sends no webhook for payments made by the simulators. Mimicr does, so you can test receiving them. To mirror BB, turn on noWebhooksOnSimulatedPayments (below). Control API actions always send the webhook.

Test data

APIDataValue
PixTest receiver keyshmtestes2@bb.com.br, 9e881f18-cc66-4fc7-8f2c-a795dbb2bfc1, +5511985732102, 95127446000198
PixSimulator payerVICTOR LOPES DORNELES, CPF 93492239293
CobrançasConvênio, carteira and variação3128557, 17, 35
CobrançasAgência and conta452, 123873
Pagamentos em LoteContract, debit agência and conta731030, 1607, 99738672-X
ExtratosAgência and conta551/5087, 1505/1348, 452/123873

Mimicr accepts this data as your sandbox's own, besides the sandbox's own data (GET /v1/bb). In the Cobranças API, BB lists a few fictitious payers; Mimicr accepts any CPF or CNPJ with valid check digits and rejects invalid ones with 4500431 (CPF) or 4500947 (CNPJ). Each sandbox has its own base: nosso números other people used in BB's homologação don't collide with yours.

Values that force outcomes

BB documents no test triggers. These rules are Mimicr's own:

WhereValue or situationOutcome
Pagamentos em LoteCents .91 (e.g. 100.91)Entry REJEITADO
Pagamentos em LoteCents .92PAGO and, ~3 s later, DEVOLVIDO by the receiver (the amount returns to the account)
Pagamentos em LoteCents .93BLOQUEADO (reason 269, insufficient balance)
Pagamentos em LoteBalance lower than the paymentBLOQUEADO
PixRefund larger than the account balanceNAO_REALIZADO, "Saldo insuficiente para realizar a devolução."
AllChaos onErrors, latency and operation and webhook failures (see Sandbox control)

Sandbox switches

All off by default. Change them in the console or through the control API:

bash
curl --request PUT \
  --url https://api.mimicr.dev/v1/bb/homolog \
  --header 'Authorization: Bearer mk_...' \
  --header 'Content-Type: application/json' \
  --data '{ "autoRelease": true, "tokenRateLimit": true }'
SwitchWhen on
noWebhooksOnSimulatedPaymentsPayments through BB's simulators generate no webhook, as in the real homologação
autoReleaseBatches are released on their own once validated, with no POST /liberar-pagamentos
tokenRateLimitAt most 10 tokens every 10 minutes; the 11th gets 429

The "Trava de 30 minutos" (boletoLock, in the console or with PUT /v1/bb/homolog): as at BB, a boleto can only be updated or written off 30 minutes after registration or the last change; before that, 400 4923876 "Inconsistência Boleto em processamento". Use the sandbox clock to get past the lock.