Webhooks
We POST a JSON event to your webhook URL (set it in Dashboard → Webhooks) whenever something happens.
{
"id": "evt_…",
"type": "payment.paid",
"created_at": 1764599200,
"data": { "payment": { "id": "pay_…", "status": "paid", "order_id": "1234", "metadata": {} } }
}
Headers: X-Signature: t=<unix>,v1=<hex>, X-Event-Id, X-Event-Type.
Events
| Event | data | When |
|---|---|---|
payment.paid | payment | Confirmed on-chain. Fulfil the order now. |
payment.expired | payment | The 15-minute quote ran out unpaid. |
payment.failed | payment, reason | A subscription charge could not be collected. |
refund.sent | refund, payment | Your refund reached the buyer's wallet. |
refund.requested | refund_request, payment | A buyer asked for a refund from their wallet receipt (includes their paying wallet). |
subscription.created | subscription | The buyer approved; the first charge follows. |
subscription.charged | subscription, payment | A period was paid. |
subscription.charge_failed | subscription, attempt, reason, will_retry | A charge failed (e.g. low balance); retries after 1, 2 and 4 days. |
subscription.cancelled | subscription, cancelled_by | Buyer (on-chain) or merchant cancelled. |
Verifying signatures
v1 = HMAC_SHA256(webhook_secret, "<t>.<raw body>") in hex. Reject the request if the signature doesn't match (compare in constant time), or if t is more than 5 minutes from now (replay protection). Always verify the raw body, before parsing it.
- Node:
sdk/node/verify-webhook.mjs→verifyWebhook(rawBody, header, secret) - PHP:
sdk/php/verify-webhook.php→verify_webhook($raw, $_SERVER['HTTP_X_SIGNATURE'], $secret)
Delivery and retries
- Reply 2xx within 10 seconds. Do slow work asynchronously.
- Failures retry after 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h… for 24 hours, then the delivery is marked
failed. - Events can arrive more than once or out of order, so make your handler idempotent:
event.id(also sent asX-Event-Id) is the idempotency key. - Logs and Resend: Dashboard → Webhooks, or
GET /v1/webhook_deliveries. - Outside local development, webhook URLs must use HTTPS. You can rotate the signing secret in the dashboard.