Voltar ao site
Webhooks

Câmbio falhou

Operação falhou (FAILED) sem dinheiro recebido.

Escopo de leitura exigido do cliente dono do endpoint: fx:operations:read. data.object tem o formato do GET /v1/fx/operations/{id}.

Entrega: POST na url do endpoint com Content-Type: application/json; charset=utf-8, corpo de até 256 KB, TLS 1.2+, sem seguir redirect, IP validado contra SSRF a cada tentativa. Verificar a assinatura sobre os bytes crus (nunca sobre JSON re-serializado). Entrega duplicada é esperada e a ordem não é garantida: deduplicar por id.

Header Parameters

X-Kodano-Signature*string

t=<unix em segundos>,v1=<hex>; durante a rotação, t=<unix>,v1=<novo>,v1=<anterior>. v1 = hex minúsculo de HMAC-SHA256(chave = bytes UTF-8 do segredo inteiro, inclusive whsec_; mensagem = "{t}." + bytes crus do corpo). Rejeitar |agora − t| > 300 s, comparar em tempo constante e aceitar se qualquer v1 conferir.

X-Kodano-Event-Id*string

Igual ao id do corpo; chave de deduplicação.

Match^evt_
X-Kodano-Event-Type*string

Igual ao type do corpo.

Value in"payment.succeeded""payment.failed""payment.refunded""chargeback.received""withdrawal.completed""withdrawal.failed""fx.operation.settled""fx.operation.expired""fx.operation.failed""fx.operation.action_required""fx.operation.refunded""settlement.closed""webhook_endpoint.disabled""ping"
User-Agent*string

Kodano-Webhooks/1.0.

Request Body

application/json
  1. body

Envelope: corpo assinado do webhook, item de GET /v1/events e resposta de GET /v1/events/{id}.

id*string

Igual ao header X-Kodano-Event-Id; chave de deduplicação.

Match^evt_
type*string
Value in"payment.succeeded""payment.failed""payment.refunded""chargeback.received""withdrawal.completed""withdrawal.failed""fx.operation.settled""fx.operation.expired""fx.operation.failed""fx.operation.action_required""fx.operation.refunded""settlement.closed""webhook_endpoint.disabled""ping"
apiVersion*string

2026-10-01.

createdAt*string
Formatdate-time
environment*string
Value in"sandbox""production"
merchantId*|

mrc_…; null em evento de organização.

data*

Response Body

Recebido. Sucesso é qualquer 2xx em até 10 s (DNS, TLS e resposta inclusos); o corpo da resposta é ignorado.

Example Requests
POST/fx.operation.failed
Request Bodyapplication/json
{  "id": "evt_<id do evento>",  "type": "fx.operation.failed",  "apiVersion": "2026-10-01",  "createdAt": "2026-11-03T14:00:05Z",  "environment": "sandbox",  "merchantId": "mrc_e3cc4727054da558273162251e310d29",  "data": {    "object": {      "id": "fxo_0192f4a2d4e35f6a9b0c1d2e3f4a5b6c",      "type": "SPOT",      "status": "FAILED",      "direction": "BRL_TO_USD",      "rate": "5.2400",      "payin": {        "amount": 500260,        "currency": "BRL"      },      "payout": {        "amount": 95412,        "currency": "USD"      },      "fees": [        {          "type": "COVER_FEE",          "rail": "ACH",          "amount": {            "amount": 262,            "currency": "BRL"          },          "reference": {            "amount": 50,            "currency": "USD"          }        }      ],      "repricedFromQuote": true,      "payoutAccount": {        "id": "fxa_0192f4a0b2c14d3e7f8a9b0c1d2e3f4a",        "label": "Fornecedor EUA · ACH · ••••0288",        "rail": "ACH"      },      "customerReference": "pedido-8841",      "paymentInstructions": null,      "timeline": [        {          "status": "AWAITING_PAYMENT",          "at": "2026-11-02T15:00:30Z"        },        {          "status": "FAILED",          "at": "2026-11-03T14:00:00Z"        }      ],      "supportReference": "GA-7K2M9Q",      "receiptAvailable": false,      "createdAt": "2026-11-02T15:00:30Z",      "updatedAt": "2026-11-03T14:00:00Z"    }  }}
Header Parameters
{  "X-Kodano-Signature": "t=1792155732,v1=d3e134866c73f1ace702a6dab8e1d8225c471951a3f88f395c987bc441b22962",  "X-Kodano-Event-Id": "string",  "X-Kodano-Event-Type": "payment.succeeded",  "User-Agent": "Kodano-Webhooks/1.0"}