Quickstart guide
Get up and running with webhooks in just a few minutes:Enable webhooks
Configure your endpoint
- Add your webhook endpoint URL (e.g.,
https://your-domain.com/webhooks/paygentic) - Select which event types to subscribe to
- View your webhook signing secret
Test your endpoint
Verify and process events
Setting up webhooks
Enabling webhooks
- Access the dashboard: Log in to your Paygentic account and navigate to Developer > Webhooks
- Enable webhooks: Toggle the “Enable Webhooks” switch to activate webhook functionality
- Access management portal: Select “Manage Webhook Endpoints” to open the webhook management portal
Configuring endpoints
In the webhook management portal, you can:- Add endpoints: Specify the URL where you want to receive webhook events
- Select event types: Select which events you want to subscribe to
- Set filters: Configure advanced filtering rules if needed
- View logs: Monitor webhook deliveries and debug any issues
- Retrieve signing secret: Access your webhook signing secret for verification
Best practices
- Use HTTPS endpoints only (HTTP is not supported for security reasons)
- Implement webhook processing asynchronously to respond quickly
- Store the
svix-idto handle duplicate events (idempotency) - Disable CSRF protection for your webhook endpoint
- Respond with a 2xx status code within 15 seconds
Security and verification
Webhook security is critical to ensure that the events you receive are legitimate and have not been tampered with. Paygentic signs all webhooks with HMAC-SHA256.Required headers
Every webhook request includes three important headers:svix-id: Unique identifier for the webhook message (use for idempotency)svix-timestamp: Unix timestamp when the webhook was sentsvix-signature: Base64 encoded signature(s) for verification
Signature verification
Use Svix’s verification library for easy and secure webhook verification:Verification examples
Replay attack protection
The timestamp in thesvix-timestamp header protects against replay attacks. The Svix library automatically rejects webhooks with timestamps more than 5 minutes old (past or future). Ensure your server’s clock is synchronized using NTP.
Handling webhooks
Response requirements
- Status code: Return a 2xx status code (200-299) to indicate successful receipt
- Timeout: Respond within 15 seconds or the delivery will be considered failed
- Body: The response body is ignored - a simple “OK” or empty response is fine
Processing best practices
Idempotency
Use thesvix-id header to ensure you only process each event once:
CSRF protection
Retry policy and failure handling
Automatic retry schedule
If your endpoint fails to respond successfully, we will retry with exponential backoff:Failure scenarios
A webhook delivery is considered failed if:- Your endpoint returns a non-2xx status code
- Your endpoint does not respond within 15 seconds
- The endpoint is unreachable (connection error)
- Your endpoint returns a 3xx redirect (not followed)
Endpoint disabling
If an endpoint fails continuously for 5 days, it will be automatically disabled. You’ll receive an operational webhook notification when this happens. You can re-enable the endpoint from the webhook management portal.Manual recovery
You can manually retry failed webhooks through the webhook management portal:- Individual retry: Retry a specific failed message
- Bulk recovery: Replay all failed messages from a specific date
- View logs: Inspect delivery attempts and error messages
Event types reference
Paygentic currently supports the following webhook event types:Customer Events
Customer Events
customer.created.v0
customer.created.v0
customer.creation_failed.v0
customer.creation_failed.v0
Subscription Events
Subscription Events
subscription.created.v0
subscription.created.v0
subscription.activated.v0
subscription.activated.v0
active state, which happens either:- Immediately upon creation for subscriptions without upfront costs
- After successful payment of upfront costs for subscriptions requiring wallet prefunding
subscription.created.v0 fires when a subscription is first created (which may be in pending_payment state), subscription.activated.v0 fires when the subscription is ready for use. Use this event to provision access or activate features for customers.subscription.cancelled.v0
subscription.cancelled.v0
subscription.updated.v0
subscription.updated.v0
Payment Events
Payment Events
payment.completed.v0
payment.completed.v0
payment.failed.v0
payment.failed.v0
payment.expired.v0
payment.expired.v0
Invoice Events
Invoice Events
invoice.issued.v0
invoice.issued.v0
invoice.paid.v0
invoice.paid.v0
PAID — covers subscription renewals, grant purchases (the grantId is included in the payload), out-of-band payments, and zero-amount invoices.grantId is populated only when the invoice was created via POST /v1/entitlements/{id}/grants/purchase; otherwise it is omitted. paymentIntentId is present for Stripe-routed payments and omitted for out-of-band and zero-amount invoices.grandTotal is the authoritative amount paid. subtotal and totalTax are each rounded to 2 decimal places independently, so re-adding them can land a cent off grandTotal — use grandTotal directly rather than re-summing the parts.invoice.paid.v0 more than once for a given invoice — dedupe on invoiceId (or the Svix message idempotency key) before acting on it.Source Events
Source Events
source.activated.v0
source.activated.v0
source.activation_failed.v0
source.activation_failed.v0
source.disconnected.v0
source.disconnected.v0
Source Event Processing
Source Event Processing
source_event.pending.v0
source_event.pending.v0
source_event.processed.v0
source_event.processed.v0
source_event.failed.v0
source_event.failed.v0
source_event.rejected.v0
source_event.rejected.v0
Common event fields
All webhook events include these standard fields:Code examples
Complete webhook handler
Here’s a production-ready webhook handler example:Testing webhooks locally
For local development, use a tunneling service to expose your local server:Additional resources
- Webhook Management Portal - Manage your webhook endpoints and view logs
- Paygentic API Documentation - Complete API reference
Need help?
If you encounter any issues with webhooks:- Check the delivery logs in the webhook management portal for error messages
- Verify your endpoint is returning a 2xx status code
- Ensure you’re using the correct signing secret
- Confirm your server’s clock is synchronized (for timestamp validation)
- Contact support if you need additional assistance