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
Configure Your Endpoint
Create an endpoint on your server to receive POST requests (e.g.,
https://yourdomain.com/api/webhook)Add URL to Dashboard
Go to your Payviox Dashboard and navigate to Settings > Webhooks
Available Events
You can subscribe to the following webhook events:| Event | Description | Recommended |
|---|---|---|
succeeded | Payment completed successfully | ✅ Always enable |
pending_review | Payment flagged for fraud review | ✅ If using fraud detection |
declined | Payment declined by fraud prevention | ✅ If using fraud detection |
refunded | Refund processed | ✅ If you process refunds |
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)
Total fees amount in the smallest currency unit (e.g., cents for USD). The customer pays
amount + fees = total. This field is present when fees have been calculated for the transaction.Custom metadata associated with the payment session
The payment event type. Possible values:
succeeded: Payment completed successfully. You can fulfill the order.pending_review: Payment flagged for fraud review. Do NOT ship until you receivesucceededordeclined.declined: Payment declined by fraud prevention. Customer has been automatically refunded.refunded: A refund has been processed for this transaction.
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)
Optional. Customer information if available from the payment provider.
This field is only present when customer data was collected during payment.
Event Types
Payviox sends different webhook events based on the payment lifecycle. Here’s what each event means and how to handle it:succeeded - Payment Successful
✅ Payment Successful
The payment has been validated by the payment processor. You can safely fulfill the order.Typical flow:
- Customer completes payment
- Payment processor confirms the charge
- You receive
succeededwebhook - Ship the order / provide the service
pending_review - Fraud Review Required
⚠️ Pending Review
The payment has been flagged by our fraud detection system for manual review. Do NOT ship until you receive a final decision.Typical flow:
- Customer completes payment
- Fraud detection flags the transaction
- You receive
pending_reviewwebhook - Admin reviews the transaction
- You receive either
succeededordeclinedwebhook
declined - Fraud Declined
❌ Declined (Fraud)
The payment was automatically declined by the fraud prevention system. The customer has been automatically refunded.Typical flow:
- Customer completes payment
- Fraud score exceeds threshold
- Automatic refund is issued
- You receive
declinedwebhook - Do NOT ship the order
refunded - Payment Refunded
↩️ Refunded
A refund has been processed for this transaction.Typical flow:
- Original payment was successful
- Refund is requested (by you or the customer)
- Refund is processed
- You receive
refundedwebhook
Webhook Headers
Every webhook request includes these headers:| Header | Description |
|---|---|
Content-Type | Always application/json |
Signature | HMAC SHA256 signature for verification |
Signature Verification
TheSignature 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: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 [email protected] for assistance