Guides
Open Finance

Open Finance webhooks and errors

The webhooks for payments, refunds, enrollments and consents, how to recognize them, retries and the error format.

The Open Finance API reports every status change with a JSON POST to the webhookURL from Configure the application. Without a configuration, nothing is sent.

Recognizing Efí

webhookSecurity.typeAt EfíIn Mimicr
mtls (default)Efí presents its certificate; your server validates Efí's chainThe POST goes to webhookURL as is, without a certificate
hmacThe registered hash goes in the query string: ?hmac=<hash>Same

In hmac mode there is no body signature: check that the hmac parameter is the one you registered.

text
POST https://sua-app.dev/open-finance?hmac=minha-hash-secreta
Content-Type: application/json

Payloads

The tipo field says what changed.

Immediate, scheduled or biometric payment (tipo: pagamento):

json
{
  "identificadorPagamento": "urn:efi:31ad3884-2914-4b63-a9f5-560f3ce13cce",
  "valor": "9.99",
  "status": "aceito",
  "dataCriacao": "2026-10-22T01:35:05.666Z",
  "endToEndId": "E09089356202610220135Tw8gFokZtlG",
  "idProprio": "6236574863254",
  "tipo": "pagamento"
}

When rejected, the same body comes with "status": "rejeitado" and motivo (Pagamento recusado no destino, Saldo insuficiente or Cancelado pelo usuário na instituição bancária). Scheduled payments include dataOperacao.

Recurrence (tipo: recorrencia), on every installment change:

json
{
  "identificadorPagamento": "urn:efi:3e392de7-5499-4fbb-9772-032451abebfb",
  "valor": "4.00",
  "status": "ativa",
  "dataCriacao": "2026-10-22T01:35:16.574Z",
  "recorrencia": [
    { "endToEndId": "E09089356202610220135YzHna15gFa9", "status": "aceito", "dataOperacao": "2026-10-27" },
    { "endToEndId": "E09089356202610220135ZRdgxVQqE4p", "status": "agendado", "dataOperacao": "2026-11-03" }
  ],
  "tipo": "recorrencia"
}

Refund (tipo: devolucao), when the refund completes:

json
{
  "identificadorPagamento": "urn:efi:31ad3884-2914-4b63-a9f5-560f3ce13cce",
  "identificadorDevolucao": "D09089356202610220135a1b2c3d4e5f6",
  "endToEndId": "E09089356202610220135Tw8gFokZtlG",
  "idProprio": "6236574863254",
  "valor": "1.00",
  "status": "aceito",
  "dataCriacao": "2026-10-22T01:35:11.000Z",
  "tipo": "devolucao"
}

Enrollment (tipo: vinculo): {"identificadorVinculo": "urn:efi:…", "status": "autorizado", "tipo": "vinculo"}, or rejeitado with motivo.

Consent (tipo: adesao): {"identificadorAdesao": "urn:efi:…", "idProprio": "…", "status": "aceito", "dataCriacao": "…", "tipo": "adesao"}. Also rejeitado and revogado, with motivo. Pix Automático payments arrive as tipo: pagamento with identificadorAdesao, endToEndId, dataOperacao and infoPagador.

Retries

Efí expects a 2xx. Any other response, or a network failure, is retried up to 10 times, at these minutes after the failure: 5, 10, 20, 40, 80, 160, 320, 640, 1280 and 52560. 3xx redirects count as failures. In Mimicr each attempt times out after 10 seconds.

To test without waiting, advance the sandbox clock (due retries go out right away) and look at the deliveries, with the body and your server's response:

bash
npx mimicr wait efi delivery api=openfinance kind=of_pagamento ref=urn:efi:31ad3884-...
curl --url 'https://api.mimicr.dev/v1/efi/deliveries?api=openfinance&status=pending' \
  --header 'Authorization: Bearer mk_...'

Delivery kinds are of_pagamento, of_recorrencia, of_devolucao, of_vinculo and of_adesao; event is the status. See Sandbox control to resend a delivery and for webhook chaos (first attempt failing, duplicate deliveries).

Errors

Open Finance API errors use {nome, mensagem}:

json
{ "nome": "tipo_conta_favorecido_invalida", "mensagem": "O tipo conta do favorecido é invalida, permitido (CACC/SLRY/SVGS/TRAN)" }
HTTPnomeWhen
400chave_idempotencia_obrigatorioPayment POST without x-idempotency-key
400cpf_pagador_obrigatorio, identificador_participante_obrigatorio, valor_obrigatorio, codigo_banco_favorecido_obrigatorio…Missing required field
400erro_iniciacao_pagamentoDates outside the window, invalid recurrence, invalid key or QR Code
400parametro_ausenteBiometrics and Pix Automático: missing parameter
404configuracao_nao_encontradaGET /v1/config without a configuration
404pagamento_nao_encontradoList with no results
404recurso_nao_encontradoUnknown enrollment, consent or payment
409conflito_chave_idempotenciaSame key, different body
422valor_invalido, tipo_conta_favorecido_invalida, cpf_pagador_invalido, identificador_participante_invalido…Invalid field
422status_pagamento_invalido_para_devolucao, saldo_devolucao_insuficiente, saldo_insuficienteRefund not allowed
422identificador_pagamento_invalidoCancellation or replacement not allowed
422entidade_nao_processavelBiometrics and Pix Automático: state or amounts don't allow it
431chave_idempotencia_invalidaKey shorter than 36 or longer than 72 characters
500erro_aplicacaoInternal error

Authentication and scope use the OAuth format, the same on every Efí API:

HTTPerrorWhen
401invalid_clientWrong Client_Id or Client_Secret on POST /v1/oauth/token
401invalid_tokenToken missing, expired or from another API
403insufficient_scopeToken without the route's scope

With controlled chaos on for the openfinance area, 500, 503 and 429 responses can also show up, and payments can be rejected with the reasons above.