Guides
API Pix

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:

bash
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."
  }'
json
{
  "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:

  • chave must be a key of the account, otherwise 400 chave_invalida.
  • valor.original follows \d{1,10}\.\d{2} and is greater than zero. "123.4" answers json_invalido.
  • devedor is optional, but when present it needs a valid cpf or cnpj and nome.
  • calendario.expiracao is optional (default 86400 s) and greater than zero.
  • A repeated txid on PUT answers 409 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:

bash
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:

bash
npx mimicr action efi pix.pay_cob txid=<txid>

When the charge is paid:

  1. The status becomes CONCLUIDA and the charge gets the pix array with the endToEndId.
  2. The Pix shows up in List received Pix.
  3. If the key has a webhook, POST <webhookUrl>/pix arrives 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.

bash
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

StatusWhen
ATIVACreated and not paid yet
CONCLUIDAPaid
REMOVIDA_PELO_USUARIO_RECEBEDORYou removed it with PATCH
REMOVIDA_PELO_PSPRemoved 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).