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
| Campo | Tipo | Descrição |
|---|---|---|
Zedy-Signatureobrigatório | string | Header HMAC SHA-256 no formato `t=unix_seconds,v1=hex`. |
Zedy-Event-Idobrigatório | string | Id público do evento de webhook. |
Zedy-Delivery-Idobrigatório | string | Id da tentativa de entrega para este endpoint/evento. |
Zedy-Timestampobrigatório | integer | Timestamp Unix em segundos. |
Eventos
charge.createdcharge.authorizedcharge.paidcharge.refusedcharge.failedcharge.refundedrefund.createdrefund.succeededrefund.failedchargeback.createdsettlement.createdsettlement.paidseller.createdseller.updatedPolí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.