Guides
Immediate charge (cob)
Create a Pix charge with a dynamic QR Code, revise it, cancel it and follow it to CONCLUIDA.
The immediate charge (cob) is the API Pix's dynamic QR Code: you send the amount and the key, BB returns the Pix Copia e Cola and, when the payer pays, the charge moves from ATIVA to CONCLUIDA with the Pix in pix[].
Prerequisites
- A token with the
cob.writeandcob.readscopes (see Authentication). - A Pix key of the receiver. In Mimicr, your sandbox's keys (
pix_keysinGET https://api.mimicr.dev/v1/bb) and BB's four test keys (hmtestes2@bb.com.br,9e881f18-cc66-4fc7-8f2c-a795dbb2bfc1,+5511985732102,95127446000198) work. Any other key answers 400 with"detail": "A chave Pix informada não pertence ao cliente".
1. Create the charge
With POST /cob, BB generates the txid (26 characters). With PUT /cob/{txid}, the txid is yours: 26 to 35 alphanumeric characters, unique per receiver.
curl --request POST \
--url 'https://api-pix.bb.mimicr.dev/pix/v2/cob?gw-dev-app-key=<app-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"calendario": { "expiracao": 3600 },
"devedor": { "cpf": "12345678909", "nome": "Francisco da Silva" },
"valor": { "original": "90.00" },
"chave": "e488511c-2025-4005-97ac-ff01ff2b5686",
"solicitacaoPagador": "Pedido 1"
}'{
"calendario": { "criacao": "2026-10-23T01:57:13.32-03:00", "expiracao": 3600 },
"loc": { "id": 1001, "location": "qrcodepix.bb.mimicr.dev/pix/v2/0cc11f84-4e9b-49ea-a0c2-cc688fce46fe", "tipoCob": "cob", "criacao": "2026-10-23T01:57:13.31-03:00" },
"devedor": { "cpf": "12345678909", "nome": "Francisco da Silva" },
"valor": { "original": "90.00", "modalidadeAlteracao": 0 },
"chave": "e488511c-2025-4005-97ac-ff01ff2b5686",
"solicitacaoPagador": "Pedido 1",
"infoAdicionais": [],
"txid": "8IpSaxGdL5mkOpTNA6BGvJBDO6",
"revisao": 0,
"location": "qrcodepix.bb.mimicr.dev/pix/v2/0cc11f84-4e9b-49ea-a0c2-cc688fce46fe",
"status": "ATIVA",
"pixCopiaECola": "00020101021226890014br.gov.bcb.pix2567qrcodepix.bb.mimicr.dev/pix/v2/0cc11f84-…6304143D",
"hiperlink": "https://pagamentospix.apps.bb.com.br/m/#/eyJvcHIiOiJQSVhRUkMiLCJpZCI6IjBjYzExZjg0…"
}valor.originalalways has two decimals ("90.00"), even if it is zero.modalidadeAlteracaocomes back0even when not sent.calendario.expiracaois in seconds from creation (default 86400). Expiration does not change thestatus: an expired charge staysATIVAbut can no longer be paid.- BB does not generate the QR Code image: render the
pixCopiaECola. Withoutloc.id, a location is reserved automatically (see Batches and locations). - Dates come in Brasília time with two fraction digits (
…13.32-03:00).
Reference: Create an immediate charge, Create with a txid.
2. Pay the charge in the sandbox
In homologação, the payer is BB's payment simulator. Send the pixCopiaECola; no token is needed, only the application key:
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": "00020101021226890014br.gov.bcb.pix2567qrcodepix.bb.mimicr.dev/pix/v2/0cc11f84-…6304143D" }'{"code": 1,"texto": "E000000002026102304576VBYCAW5OYZ"}texto is the Pix endToEndId. The payer is always VICTOR LOPES DORNELES (CPF 93492239293). Through the sandbox control you pay by txid and pick the payer:
curl --request POST \
--url https://api.mimicr.dev/v1/bb/actions/pix.pay_cob \
--header 'Authorization: Bearer mk_…' \
--header 'Content-Type: application/json' \
--data '{ "txid": "8IpSaxGdL5mkOpTNA6BGvJBDO6", "payer_document": "52998224725", "payer_name": "Maria Silva" }'Or with the CLI: npx mimicr action bb pix.pay_cob txid=8IpSaxGdL5mkOpTNA6BGvJBDO6. Only ATIVA, unexpired charges with an amount above zero can be paid. Reference: Pay a Pix QR Code.
In homologação BB sends no webhook for simulated payments. Mimicr sends it if the key has one registered; turn on the noWebhooksOnSimulatedPayments toggle to reproduce BB's behaviour. See Pix webhook.
3. Get it
curl --request GET \ --url 'https://api-pix.bb.mimicr.dev/pix/v2/cob/8IpSaxGdL5mkOpTNA6BGvJBDO6?gw-dev-app-key=<app-key>' \ --header 'Authorization: Bearer <token>'
{
"calendario": { "criacao": "2026-10-23T01:57:13.00-03:00", "expiracao": 3600 },
"valor": { "original": "90.00", "modalidadeAlteracao": 0 },
"txid": "8IpSaxGdL5mkOpTNA6BGvJBDO6",
"revisao": 0,
"status": "CONCLUIDA",
"pix": [
{
"endToEndId": "E000000002026102304576VBYCAW5OYZ",
"txid": "8IpSaxGdL5mkOpTNA6BGvJBDO6",
"valor": "90.00",
"componentesValor": { "original": { "valor": "90.00" } },
"chave": "e488511c-2025-4005-97ac-ff01ff2b5686",
"horario": "2026-10-23T01:57:15.00-03:00",
"infoPagador": "Pedido 1",
"pagador": { "cpf": "93492239293", "nome": "VICTOR LOPES DORNELES" },
"devolucoes": []
}
]
}On GET, as at BB, criacao is truncated (.00), an empty infoAdicionais disappears and pixCopiaECola only appears while the charge is ATIVA. Use ?revisao=n to see an earlier revision. Reference: Get an immediate charge.
4. Revise or cancel
PATCH /cob/{txid} changes an ATIVA charge. Every change except cancelling and changing loc adds 1 to revisao. chave cannot change.
curl --request PATCH \
--url 'https://api-pix.bb.mimicr.dev/pix/v2/cob/exemplomvki0abacobtxid0000000?gw-dev-app-key=<app-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "valor": { "original": "16.00" } }'To cancel, send only the status: {"status": "REMOVIDA_PELO_USUARIO_RECEBEDOR"}. Together with any other field, BB answers 400 with the title Operação inválida.. Reference: Revise an immediate charge.
5. List
GET /cob requires inicio and fim (RFC 3339, at most 5 days apart) and accepts cpf, cnpj, status, locationPresente and pagination. With no results, BB answers 404, not an empty list. Reference: List immediate charges.
Statuses
| Status | When |
|---|---|
ATIVA | Created and not paid yet (even after it expires). |
CONCLUIDA | Paid. The Pix shows up in pix[] and in received Pix. |
REMOVIDA_PELO_USUARIO_RECEBEDOR | Cancelled by you with PATCH. |
REMOVIDA_PELO_PSP | Removed by BB. Mimicr never produces this status. |
Common errors
| Case | Response |
|---|---|
Field outside the schema (e.g. "original": "1") | 400 CobOperacaoInvalida with violacoes |
| txid already used in a cob or cobv | 400, detail "Identificador de transação já cadastrado para o cliente" |
| Key not owned by the receiver | 400, detail "A chave Pix informada não pertence ao cliente" |
| Unknown txid | 404 NaoEncontrado |
See every format in Errors.