Guides
Immediate charges
Create a cob, show the QR code, follow the payment and revise or remove the charge.
The immediate charge (cob) is a Pix with an amount and a lifetime in seconds, paid through a dynamic QR code or Pix Copy and Paste. The cycle is: create, show the QR, receive the /pix webhook and check the charge is CONCLUIDA.
Create
With POST /v2/cob Efí generates the txid; with PUT /v2/cob/:txid you choose it (26 to 35 alphanumeric characters). The body is the same:
curl --request POST \
--url https://pix.efi.mimicr.dev/v2/cob \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"calendario": { "expiracao": 3600 },
"devedor": { "cpf": "12345678909", "nome": "Francisco da Silva" },
"valor": { "original": "5.00" },
"chave": "<chave>",
"solicitacaoPagador": "Cobrança dos serviços prestados."
}'{
"calendario": { "criacao": "2026-10-21T23:40:00.109Z", "expiracao": 3600 },
"txid": "f57c97eae45caa148f94074813876865",
"revisao": 0,
"loc": { "id": 2, "location": "qrcodespix.efi.mimicr.dev/v2/613636811a17d1bdd4eabb8716cde048", "tipoCob": "cob", "criacao": "2026-10-21T23:40:00.070Z" },
"location": "qrcodespix.efi.mimicr.dev/v2/613636811a17d1bdd4eabb8716cde048",
"status": "ATIVA",
"devedor": { "cpf": "12345678909", "nome": "Francisco da Silva" },
"valor": { "original": "5.00" },
"chave": "d01efe21-d811-41a0-9634-6bb4e7802852",
"solicitacaoPagador": "Cobrança dos serviços prestados.",
"pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.efi.mimicr.dev/v2/6136…6304B743"
}Rules at creation:
chavemust be a key of the account, otherwise400 chave_invalida.valor.originalfollows\d{1,10}\.\d{2}and is greater than zero."123.4"answersjson_invalido.devedoris optional, but when present it needs a validcpforcnpjandnome.calendario.expiracaois optional (default 86400 s) and greater than zero.- A repeated
txidon PUT answers409 txid_duplicado.
Reference: Create a charge and Create a charge with txid.
Show the QR code
pixCopiaECola is the full BR Code, with CRC: render it with any QR code library or ask the location for the ready image:
curl --url https://pix.efi.mimicr.dev/v2/loc/2/qrcode \ --header 'Authorization: Bearer <token>'
The response carries qrcode, imagemQrcode (SVG as a data URI) and linkVisualizacao. See Locations and QR codes.
Payment
In homologation, the R$ 5.00 cob above is paid on its own in about 3 s. Above R$ 10.00, pay as the customer:
npx mimicr action efi pix.pay_cob txid=<txid>
When the charge is paid:
- The status becomes
CONCLUIDAand the charge gets thepixarray with theendToEndId. - The Pix shows up in List received Pix.
- If the key has a webhook,
POST <webhookUrl>/pixarrives with{"pix": [...]}(see Pix webhooks).
On reads (GET /v2/cob/:txid and the list), calendario.expiracao comes as a string ("3600"), as in Efí's examples; on create and revise responses, it is a number.
Revise or remove
While the charge is ATIVA, PATCH /v2/cob/:txid changes valor, devedor, calendario, chave, solicitacaoPagador, loc and infoAdicionais. Each change adds 1 to revisao, and GET /v2/cob/:txid?revisao=0 returns the old version.
curl --request PATCH \
--url https://pix.efi.mimicr.dev/v2/cob/<txid> \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "status": "REMOVIDA_PELO_USUARIO_RECEBEDOR" }'A charge that is not ATIVA answers 400 status_cobranca_invalido. An unknown txid answers 400 cobranca_nao_encontrada (not 404).
Statuses
| Status | When |
|---|---|
ATIVA | Created and not paid yet |
CONCLUIDA | Paid |
REMOVIDA_PELO_USUARIO_RECEBEDOR | You removed it with PATCH |
REMOVIDA_PELO_PSP | Removed by Efí |
Expiring does not change the status: the cob stays ATIVA, but can no longer be paid. To test that without waiting, advance the sandbox clock (npx mimicr clock efi +2h).
Related
- Due-date charges
- Payment split: split the amount before payment.