Webhooks are the source of truth
Webhooks are delivered server-to-server, so they don’t depend on the customer’s browser surviving the checkout round-trip. Drive fulfillment, entitlement, and billing records from webhook events—not from the SDK’sonCheckoutComplete callback, which runs in the browser as a UX signal only and isn’t guaranteed to fire (the customer can close or background the tab or lose connection, on any payment method, and asynchronous methods can settle slightly later).
Use these payment and subscription events to trigger business logic:
Keep
onCheckoutComplete for immediate UX only—showing a success or pending screen right after checkout. Because webhooks are delivered server-to-server, driving fulfillment from them removes the closed-tab / lost-connection failure mode entirely.Set Up a Webhook
1
Create your endpoint
Set up an HTTPS endpoint in your application to receive POST requests with JSON payloads (e.g.,
https://api.yourapp.com/webhooks/paynext).2
Register in Dashboard
Go to Dashboard → Developers → Webhooks, click Add Endpoint, and enter your URL.
3
Select events
Choose which event types to receive (e.g.,
payment_v2.settled, subscription_v2.cancelled), or subscribe to all events. New endpoints default to the v2 taxonomy—see Versioning.4
Save
Click Create to activate your webhook.
Monitor Delivery
Each endpoint displays delivery health and statistics:
Filter message attempts by All, Succeeded, or Failed to troubleshoot issues.
Verify Signatures
PayNext signs every webhook so you can verify the request originated from us. Always validate signatures before processing events.Get your signing secret
- Go to Dashboard → Developers → Webhooks
- Select your endpoint
- Copy the Signing Secret (format:
whsec_...)
Verify the signature
PayNext delivers webhooks through Svix. Pass the raw request body (not parsed JSON) and headers to the Svix SDK for verification. See the Svix documentation for implementation:- Platform-specific examples — Ready-to-use code for Node.js, Python, Go, Ruby, and more
- Manual verification guide — HMAC validation without the SDK
Retries
PayNext automatically retries failed webhook deliveries with exponential backoff:
Your endpoint must return
2xx status to acknowledge receipt. After all attempts fail, the endpoint may be disabled.
If your endpoint consistently fails, check the Logs tab for error details. Common issues include SSL certificate errors, timeouts, and non-2xx responses.
Advanced Endpoints
Beyond standard webhooks, PayNext supports alternative delivery methods for specific use cases:
Contact support to enable advanced endpoint types for your account.
Troubleshooting
Webhook not receiving events
Webhook not receiving events
- Verify your endpoint URL is publicly accessible
- Check that the endpoint is Active in the Dashboard
- Ensure your endpoint returns
2xxstatus - Review delivery logs for error details
Signature verification failing
Signature verification failing
- Confirm you’re using the correct signing secret
- Pass the raw request body (not parsed JSON) to verification
- Check that webhook headers are being forwarded correctly
Events arriving out of order
Events arriving out of order
- Use event timestamps to determine correct sequence
- Implement idempotency using event IDs
- Consider FIFO endpoints for ordered delivery
Duplicate deliveries
Duplicate deliveries
- Each event has a stable
idthat is reused across delivery retries - Store processed event IDs and skip any you’ve already handled
- See Versioning → Idempotency