Guides
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.type | At Efí | In Mimicr |
|---|---|---|
mtls (default) | Efí presents its certificate; your server validates Efí's chain | The POST goes to webhookURL as is, without a certificate |
hmac | The 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.
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):
{
"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:
{
"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:
{
"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:
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}:
{ "nome": "tipo_conta_favorecido_invalida", "mensagem": "O tipo conta do favorecido é invalida, permitido (CACC/SLRY/SVGS/TRAN)" }| HTTP | nome | When |
|---|---|---|
| 400 | chave_idempotencia_obrigatorio | Payment POST without x-idempotency-key |
| 400 | cpf_pagador_obrigatorio, identificador_participante_obrigatorio, valor_obrigatorio, codigo_banco_favorecido_obrigatorio… | Missing required field |
| 400 | erro_iniciacao_pagamento | Dates outside the window, invalid recurrence, invalid key or QR Code |
| 400 | parametro_ausente | Biometrics and Pix Automático: missing parameter |
| 404 | configuracao_nao_encontrada | GET /v1/config without a configuration |
| 404 | pagamento_nao_encontrado | List with no results |
| 404 | recurso_nao_encontrado | Unknown enrollment, consent or payment |
| 409 | conflito_chave_idempotencia | Same key, different body |
| 422 | valor_invalido, tipo_conta_favorecido_invalida, cpf_pagador_invalido, identificador_participante_invalido… | Invalid field |
| 422 | status_pagamento_invalido_para_devolucao, saldo_devolucao_insuficiente, saldo_insuficiente | Refund not allowed |
| 422 | identificador_pagamento_invalido | Cancellation or replacement not allowed |
| 422 | entidade_nao_processavel | Biometrics and Pix Automático: state or amounts don't allow it |
| 431 | chave_idempotencia_invalida | Key shorter than 36 or longer than 72 characters |
| 500 | erro_aplicacao | Internal error |
Authentication and scope use the OAuth format, the same on every Efí API:
| HTTP | error | When |
|---|---|---|
| 401 | invalid_client | Wrong Client_Id or Client_Secret on POST /v1/oauth/token |
| 401 | invalid_token | Token missing, expired or from another API |
| 403 | insufficient_scope | Token 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.