Guides
Pix webhooks
Register webhooks per key and per account, understand the /pix suffix, the payloads, the retries and how to resend.
The API Pix reports by webhook everything that happens with the money: received Pix, sent Pix, refunds made and received and, in Pix Automático, changes to recurrences and recurring charges.
Where to register
| Webhook | Registration | Delivered to | Events |
|---|---|---|---|
| Per key | PUT /v2/webhook/:chave | webhookUrl + /pix | Received Pix, sent Pix (paying key) and refunds |
| Recurrences | PUT /v2/webhookrec | webhookUrl + /rec | Recurrence status changes |
| Recurring charges | PUT /v2/webhookcobr | webhookUrl + /cobr | Changes to recurring charges and their attempts |
One URL can serve several keys; each key has a single URL, and a new PUT replaces it.
Registration
curl --request PUT \
--url https://pix.efi.mimicr.dev/v2/webhook/<chave> \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "webhookUrl": "https://sua-app.dev/webhooks/efi" }'Before saving, Mimicr sends POST https://sua-app.dev/webhooks/efi (without the suffix) with {"evento": "teste_webhook", "data_criacao": "…"}. The URL must answer 2xx. Otherwise:
nome | mensagem |
|---|---|
valor_invalido | Invalid URL, or "A URL do webhook deve usar o protocolo HTTPS" |
webhook_invalido | "A URL informada respondeu com o código HTTP 500" (or another code) |
webhook_invalido | "A URL informada atingiu o tempo limite de resposta" |
webhook_invalido | "A requisição na URL informada falhou com o erro: ECONNREFUSED" |
chave_nao_encontrada | The key does not belong to the account |
At the real Efí, registration also tests mTLS: a first POST without a certificate must be refused and a second one, with Efí's certificate, accepted (or you send x-skip-mtls-checking: true). Mimicr does no mTLS: a single test POST is enough, the header is ignored and http://localhost is accepted.
The /pix suffix
Efí appends /pix to the end of the registered URL. To avoid the suffix, end the URL with ?ignorar=: the /pix text becomes the parameter's value (https://sua-app.dev/webhook?ignorar=/pix).
Payloads
Received Pix:
{
"pix": [
{
"endToEndId": "E09089356202610212340oZXrYiuEIGF",
"txid": "f57c97eae45caa148f94074813876865",
"chave": "d01efe21-d811-41a0-9634-6bb4e7802852",
"valor": "5.00",
"horario": "2026-10-21T23:40:03.282Z",
"infoPagador": "Pagamento automático de homologação",
"gnExtras": { "pagador": { "nome": "EFI SA - INSTITUICAO DE PAGAMENTO", "cnpj": "09089356000118", "codigoBanco": "09089356" }, "tarifa": "0.05" }
}
]
}gnExtras.pagador and gnExtras.tarifa only come when turned on in Save settings; with split, gnExtras.split comes. Pix without a txid are only notified with notificar.pixSemTxid: true. In Mimicr the fee is 1% of the amount, at least R$ 0.01.
Refund (one webhook per refund, with the original Pix and the refund that changed):
{
"pix": [
{
"endToEndId": "E09089356202610212340oZXrYiuEIGF",
"txid": "f57c97eae45caa148f94074813876865",
"chave": "d01efe21-d811-41a0-9634-6bb4e7802852",
"valor": "5.00",
"horario": "2026-10-21T23:40:03.282Z",
"devolucoes": [
{ "id": "D001", "rtrId": "D09089356202610212340HpsrIQO2Rcf", "valor": "1.00", "natureza": "ORIGINAL", "horario": { "solicitacao": "2026-10-21T23:40:17.898Z", "liquidacao": "2026-10-21T23:40:21.002Z" }, "status": "DEVOLVIDO" }
]
}
]
}Sent Pix (on the paying key): tipo: "SOLICITACAO", status REALIZADO or NAO_REALIZADO and gnExtras.idEnvio; when rejected, gnExtras.erro carries the SPI code and reason. See Pix send.
Pix Automático: {"recs": [...]} on /rec and {"cobsr": [...]} on /cobr, with status, atualizacao and, on charges, tentativas and pix. See Pix Automático.
Delivery and retries
POSTwithContent-Type: application/json, unsigned. Any 2xx is success.- Without a 2xx, Efí tries again: 9 attempts in total, the first immediate and the next after 5, 5, 5, 10, 20, 40, 80 and 160 minutes. Mimicr follows the same table, on the sandbox clock.
- Efí waits up to 60 s for the response; Mimicr waits 10 s.
- Every delivery is recorded in the console and in the control API's
GET /v1/efi/deliveries, with status, attempts and the last response.
To skip the retries, advance the clock (npx mimicr clock efi +30m) or resend a delivery with POST /v1/efi/deliveries/{id}/resend.
Resend through the API
POST /v2/gn/webhook/reenviar is disabled in Efí's homologation and answers 500 WebhooksErroInterno; Mimicr does the same. Use the resend of the console or the control API.
Wait for a webhook in tests
npx mimicr wait efi delivery kind=pix event=PIX_RECEBIDO npx mimicr wait efi delivery kind=envio ref=envio0001 npx mimicr wait efi delivery kind=cobr status=success
kind is pix, devolucao, devolucao_recebida, envio, rec or cobr. See Sandbox control.