Overview
Webhooks allow Payviox to send real-time notifications to your server when payment events occur. When a payment is processed, Payviox sends an HTTP POST request to your configured webhook URL with the payment details.Webhooks are essential for keeping your application synchronized with payment statuses. Configure your webhook URL in the Payviox Dashboard under Settings > Webhooks.
Webhook Configuration
Setting Up Your Webhook URL
1
Configure Your Endpoint
Create an endpoint on your server to receive POST requests (e.g.,
https://yourdomain.com/api/webhook)2
Add URL to Dashboard
Go to your Payviox Dashboard and navigate to Settings > Webhooks
3
Enter Your Webhook URL
Paste your endpoint URL in the webhook URL field
4
Save Your Webhook Token
Copy your webhook token - you’ll need it to verify webhook signatures
Always verify webhook signatures to ensure requests are coming from Payviox and not from malicious actors.
Webhook Payload Structure
Payviox sends webhooks with the following structure:Payload Fields
The payment amount in the smallest currency unit (e.g., cents for USD)
Three-letter ISO currency code (e.g., USD, EUR, GBP)
Custom metadata associated with the payment session
The payment status. Possible values:
succeeded: Payment completed successfullyprocessing: Payment is being processedcanceled: Payment was canceledrequires_payment_method: Additional payment method requiredrequires_confirmation: Payment requires confirmationrequires_action: Additional action required from customer
The payment provider used (e.g., stripe, paypal, crypto)
Your unique order identifier
Array of items purchased
Specific payment method used (e.g., card, bank_transfer)
Webhook Headers
Every webhook request includes these headers:| Header | Description |
|---|---|
Content-Type | Always application/json |
Signature | HMAC SHA256 signature for verification |
Signature Verification
Critical Security Step: Always verify the webhook signature before processing the payload. This ensures the request is legitimate and from Payviox.
Signature header contains an HMAC SHA256 hash of the request body, signed with your webhook token. Here’s how to verify it:
Verification Algorithm
- Get the raw request body (JSON string)
- Compute HMAC SHA256 hash using your webhook token as the secret key
- Compare the computed signature with the
Signatureheader - Only process the webhook if signatures match
Implementation Examples
Retry Logic
Payviox implements an automatic retry mechanism for failed webhook deliveries:1
First Attempt
Instant delivery (0 seconds)
2
Second Attempt
30 seconds after first failure
3
Third Attempt
5 minutes after second failure
4
Fourth Attempt
30 minutes after third failure
After 4 failed attempts, the webhook will be marked as failed. You can manually retry failed webhooks from the Payviox Dashboard.
Success Criteria
A webhook is considered successfully delivered when your endpoint:- Returns HTTP status code
200 - Responds within 30 seconds
Troubleshooting
Common Issues
Signature Verification Failing
Signature Verification Failing
Possible causes:
- Using the wrong webhook token
- Parsing/modifying the request body before verification
- Incorrect HMAC algorithm (must be SHA256)
Webhooks Not Being Received
Webhooks Not Being Received
Possible causes:
- Incorrect webhook URL in dashboard
- Firewall blocking Payviox IP addresses
- Server not responding within 30 seconds
Duplicate Webhook Processing
Duplicate Webhook Processing
Possible causes:
- Not implementing idempotency checks
- Slow response times causing retries
Webhook Timeout
Webhook Timeout
Possible causes:
- Processing taking too long before responding
- Database locks or slow queries
Security Checklist
Need Help?
If you’re having trouble with webhook integration:- Check the Webhook Logs in your dashboard
- Review your server logs for errors
- Contact support@payviox.com for assistance
Include your webhook attempt IDs from the dashboard when contacting support for faster resolution.