PryvPay Docs
Get API keys

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

EventdataWhen
payment.paidpaymentConfirmed on-chain. Fulfil the order now.
payment.expiredpaymentThe 15-minute quote ran out unpaid.
payment.failedpayment, reasonA subscription charge could not be collected.
refund.sentrefund, paymentYour refund reached the buyer's wallet.
refund.requestedrefund_request, paymentA buyer asked for a refund from their wallet receipt (includes their paying wallet).
subscription.createdsubscriptionThe buyer approved; the first charge follows.
subscription.chargedsubscription, paymentA period was paid.
subscription.charge_failedsubscription, attempt, reason, will_retryA charge failed (e.g. low balance); retries after 1, 2 and 4 days.
subscription.cancelledsubscription, cancelled_byBuyer (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 as X-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.

Questions? Email [email protected].