Understanding Webhooks
Webhooks are essential for confirming payments. They provide real-time notifications when payment events occur.How Webhooks Work
Configure your webhook URL
Set up your webhook endpoint URL in the Payviox Dashboard
Payviox sends a POST request
When payment events occur, Payviox sends a POST request to your configured URL
Your server receives the notification
Your server endpoint receives the webhook with complete payment details
Verify the signature
Always verify the webhook signature to ensure it’s from Payviox and hasn’t been tampered with
Webhook Payload Example
The
customer field is optional and only present when customer data was collected during payment. It may include name, email, phone, and address depending on the payment provider.Webhook Event Types
Payviox sends different webhook events based on the payment lifecycle:| Event | Description | Action Required |
|---|---|---|
succeeded | Payment completed successfully | ✅ Fulfill order |
pending_review | Payment flagged for fraud review | ⏳ Wait for final decision |
declined | Payment declined by fraud prevention (auto-refunded) | ❌ Do NOT fulfill |
refunded | Refund processed for a transaction | 📦 Handle return/cancellation |
What Happens During Payment?
1. Session Creation (Your Application)
1. Session Creation (Your Application)
Your application creates a payment session by calling Payviox with:
- Amount (in smallest currency unit, e.g., cents)
- Currency (USD, EUR, GBP, etc.)
- Order details (customer ID, order ID, items)
- Payment method (card, crypto, bank transfer, etc.)
2. Payment Processing (Payviox)
2. Payment Processing (Payviox)
The customer is redirected to Payviox’s secure payment page where:
- Payment form is displayed with selected payment method
- Customer enters payment details
- Payment is processed through the appropriate provider (Stripe, PayPal, etc.)
- Transaction is encrypted and secured
3. Webhook Notification (Payviox → Your Server)
3. Webhook Notification (Payviox → Your Server)
Immediately after payment processing:
- Payviox sends a webhook POST request to your configured URL
- Includes payment status, amount, order ID, and all details
- This is your source of truth for payment confirmation
- Retries automatically if your server doesn’t respond
4. Customer Redirect (Back to Your Site)
4. Customer Redirect (Back to Your Site)
After payment:
- Customer is redirected back to your website
- URL includes session ID as parameter
- You can show a confirmation page
- Note: Always rely on webhooks, not just redirects