Skip to main content
For the complete webhook guide — setup, signature verification, event catalog, payload schemas, and best practices — see the central Webhooks documentation.

Quick Reference

import { verifyWebhook } from '@solvapay/server'

const event = verifyWebhook({
  body: rawBodyString,
  signature: request.headers.get('sv-signature')!,
  secret: process.env.SOLVAPAY_WEBHOOK_SECRET!,
})

switch (event.type) {
  case 'payment.succeeded':
    // fulfil the order
    break
  case 'purchase.created':
    // grant access
    break
  case 'purchase.cancelled':
    // revoke access
    break
}

Edge Runtimes

import { verifyWebhook } from '@solvapay/server/edge'

const event = await verifyWebhook({
  body: rawBodyString,
  signature: svSignatureHeader,
  secret: process.env.SOLVAPAY_WEBHOOK_SECRET!,
})

Event Types

EventDescription
payment.succeededPayment successfully processed
payment.failedPayment attempt failed
payment.refundedRefund successfully processed
payment.refund_failedRefund attempt failed
purchase.createdNew purchase created
purchase.updatedPurchase modified
purchase.cancelledPurchase cancelled
purchase.expiredPurchase expired
purchase.suspendedPurchase suspended
customer.createdCustomer created
customer.updatedCustomer updated
customer.deletedCustomer deleted
See Webhooks documentation for full payload schemas and integration examples.