Webhooks

Eventos assinados para estado assíncrono de pagamentos.

Bunne envia eventos por POST. Seu endpoint deve verificar a assinatura, processar de forma idempotente e retornar qualquer status 2xx para confirmar a entrega.

Payload
{  "id": "we_xxx",  "object": "event",  "type": "charge.paid",  "livemode": false,  "created": 1782388805,  "data": {    "object": {      "id": "ch_xxx",      "object": "charge",      "status": "paid",      "amount_cents": 10990,      "currency": "BRL",      "payment_method": "credit_card",      "capture_method": "manual",      "captured": true    }  }}
Verificar assinatura
const signedPayload = timestamp + "." + rawBody;const expected = hmacSha256(webhookSecret, signedPayload);const valid = timingSafeEqual(expected, signatureFromHeader);

Headers de entrega

CampoTipoDescrição
Zedy-SignatureobrigatóriostringHeader HMAC SHA-256 no formato `t=unix_seconds,v1=hex`.
Zedy-Event-IdobrigatóriostringId público do evento de webhook.
Zedy-Delivery-IdobrigatóriostringId da tentativa de entrega para este endpoint/evento.
Zedy-TimestampobrigatóriointegerTimestamp Unix em segundos.

Eventos

charge.createdcharge.authorizedcharge.paidcharge.refusedcharge.failedcharge.refundedrefund.createdrefund.succeededrefund.failedchargeback.createdsettlement.createdsettlement.paidseller.createdseller.updated

Política de retry

Cada tentativa tem timeout de 10s. Entregas com falha tentam novamente até 7 tentativas totais, com backoff de 60s, 5min, 15min, 1h, 6h e 24h. Pares endpoint/evento que já retornaram 2xx não são entregues novamente.