Guides
API Pix

Received Pix and refunds

Get the Pix that came into the account, refund in full or in part, handle MED infractions and reconcile with balance, receipts and statement.

Every Pix that comes into the account becomes a received Pix, identified by its endToEndId (32 characters, starts with E). It may come from a charge (it has a txid) or straight to the key or a static QR (no txid).

Receive without a charge

To simulate someone paying straight to a key of the account:

bash
npx mimicr action efi pix.receive chave=<chave> valor=12.50 nome="Maria Souza" infoPagador="Almoço"

With via=qrcode_estatico (and an optional txid), the Pix comes from a static QR Code; with via=dados_bancarios, it comes by branch and account, without a key: it shows up in List received Pix without chave and triggers no webhook, which Efí registers per key.

By default, Pix without a txid trigger no webhook. To receive them, turn on pixSemTxid in the key's configuration with Save settings:

json
{
  "pix": {
    "receberSemChave": true,
    "chaves": {
      "<chave>": {
        "recebimento": {
          "txidObrigatorio": false,
          "qrCodeEstatico": { "recusarTodos": false },
          "webhook": { "notificacao": { "tarifa": true, "pagador": true }, "notificar": { "pixSemTxid": true } }
        }
      }
    }
  }
}

With notificacao.pagador and notificacao.tarifa, the webhook gets gnExtras.pagador and gnExtras.tarifa. The pix.receive action applies the receiving rules like Efí: with txidObrigatorio: true, the key refuses Pix without a txid; with qrCodeEstatico.recusarTodos: true, it refuses every static QR Code payment (via=qrcode_estatico); with recusarTipoPessoa, it refuses payers of that kind; and with receberSemChave: false, the account refuses Pix by bank details (via=dados_bancarios), except from the same owner (the account's CNPJ). A refused Pix never arrives and the action answers 422 action_failed. On the other hand, recebimento.documentoPagadorIgualDevedor: true (the payer must be the charge's debtor) and recebimento.recusarTipoPessoa: "PF" (refuses individual payers) are applied when a charge is paid: the charge stays ATIVA and the pix.pay_cob action answers pagamento_recusado.

Get

bash
curl --url 'https://pix.efi.mimicr.dev/v2/pix/E09089356202610212340oZXrYiuEIGF' \
  --header 'Authorization: Bearer <token>'
json
{
  "endToEndId": "E09089356202610212340oZXrYiuEIGF",
  "txid": "f57c97eae45caa148f94074813876865",
  "valor": "5.00",
  "chave": "d01efe21-d811-41a0-9634-6bb4e7802852",
  "horario": "2026-10-21T23:40:03.282Z",
  "infoPagador": "Pagamento automático de homologação"
}

With ?exibirCodigoBanco=true, the response adds pagador.contaBanco.codigoBanco. An unknown e2eId answers 400 pix_nao_encontrado. To list, use GET /v2/pix?inicio=…&fim=… with the txid, txIdPresente, devolucaoPresente, cpf and cnpj filters.

Refund

The refund id is yours (^[a-zA-Z0-9]{1,35}$) and cannot repeat on the same Pix:

bash
curl --request PUT \
  --url https://pix.efi.mimicr.dev/v2/pix/E09089356202610212340oZXrYiuEIGF/devolucao/D001 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "valor": "1.00" }'
json
{
  "id": "D001",
  "rtrId": "D09089356202610212340HpsrIQO2Rcf",
  "valor": "1.00",
  "horario": { "solicitacao": "2026-10-21T23:40:17.898Z" },
  "status": "EM_PROCESSAMENTO"
}

About 3 seconds later, the refund becomes DEVOLVIDO (with horario.liquidacao) and the key's webhook receives the Pix with the devolucoes array. In homologation, "valor": "0.01" always ends in NAO_REALIZADO, with motivo.

Rules:

  • The sum of the refunds cannot exceed the Pix amount: above that, 400 valor_invalido ("O valor da devolução excede o valor disponível para devolução").
  • A repeated id answers 409 devolucao_id_duplicado.
  • The amount leaves the balance; NAO_REALIZADO refunds come back.
  • Received Pix with split are refunded through Refund a Pix with split.

Get it with GET /v2/pix/:e2eId/devolucao/:id. To decide a refund yourself (for example, with chaos on), use pix.decide_devolucao id=<rtrId> ok=false.

MED infractions

MED (Special Return Mechanism) lets the payer's bank dispute a Pix for fraud. While the infraction is open, the amount stays blocked. In Mimicr, you play the payer's bank and the analysis:

bash
npx mimicr action efi pix.open_med e2eId=<e2eId>
  1. The infraction shows up in List MED infractions with status: "ABERTA", and GET /v2/gn/saldo?bloqueios=true shows the amount in bloqueios.med.
  2. Defend within the deadline with Defend a MED infraction: {"analise": "rejeitado", "justificativa": "…"}. The infraction moves to EM_DEFESA.
  3. Decide with pix.decide_med id=<idInfracao> accept=true: the amount goes back to the payer (refund with natureza: MED_FRAUDE and a webhook). With accept=false, the infraction becomes REJEITADA and the block is released.

Balance, receipts and statement

  • Get the balance: GET /v2/gn/saldo returns saldo; with ?bloqueios=true, also the court-order and MED blocks. The sandbox starts at R$ 1,000.00.
  • Download a receipt: GET /v2/gn/pix/comprovantes?e2eid=… (or idEnvio, rtrId, txid, exactly one) returns a PDF.
  • Request a reconciliation statement: POST /v2/gn/relatorios/extrato-conciliacao with a dataMovimento before today returns 202 and an id. Download a report answers 202 while processing and then the CSV.