Webhook Overview
Webhooks allow your application to receive real-time notifications about events in your Xerobi account, eliminating the need for constant polling.How Webhooks Work
- Event Occurs: Something happens in your Xerobi account (payment succeeds, SMS delivers, credential issues)
- Notification Sent: Xerobi sends an HTTP POST request to your configured webhook URL
- Your App Responds: Your application processes the event and responds with a 200 status code
- Confirmation: Xerobi marks the webhook as successfully delivered
Setting Up Webhooks
Payment Gateway Webhooks
1
Create a webhook endpoint
Create an HTTPS endpoint in your application to receive webhook events:
2
Register webhook in dashboard
- Go to dash.hixbe.com
- Navigate to Webhooks section
- Click “Create Webhook”
- Enter your endpoint URL
- Select event types to listen for
3
Test your webhook
Use the dashboard to send test events to your endpoint.
SMS Gateway Webhooks
1
Set up delivery tracking
2
Register SMS webhook
Certification Webhooks
1
Handle credential events
Webhook Events
Payment Events
SMS Events
Certification Events
Webhook Security
Verify Webhook Signatures
Security Best Practices
- Always use HTTPS for webhook endpoints
- Verify webhook signatures on all requests
- Use secret keys unique to each webhook
- Implement idempotency to handle duplicate events
- Validate event data before processing
- Monitor webhook delivery in your dashboard
Webhook Payload Format
All webhook payloads follow a consistent structure:Handling Webhook Failures
Retry Logic
Xerobi automatically retries failed webhook deliveries:- Immediate retry: After 1 minute
- Exponential backoff: 2, 4, 8, 16 minutes
- Final attempt: After 24 hours
- Expiration: Events expire after 7 days
Failure Response Codes
Manual Retry
Failed webhooks can be manually retried from your dashboard.Testing Webhooks
Use RequestBin for Testing
For initial testing, use services like RequestBin or ngrok:Test Events
Use the dashboard to send test events to your webhook endpoint.Monitoring and Debugging
Webhook Logs
Access webhook delivery logs in your dashboard:- Delivery status (success/failure)
- Response time and status codes
- Request/response payloads
- Failure reasons
Common Issues
Webhook not receiving events
Webhook not receiving events
- Check endpoint URL is correct and accessible
- Ensure HTTPS is used (HTTP not supported)
- Verify firewall allows incoming connections
Invalid signature errors
Invalid signature errors
- Confirm webhook secret is correct
- Check signature verification implementation
- Ensure raw request body is used for signature calculation
Duplicate events
Duplicate events
- Implement idempotency using event IDs
- Store processed event IDs in your database
- Return success quickly to prevent retries
Best Practices
- Process webhooks asynchronously to avoid timeouts
- Implement idempotency using event IDs
- Store webhook events for debugging
- Monitor webhook health in your dashboard
- Use different endpoints for different event types
- Test thoroughly in sandbox before production
Need Help?
Troubleshooting
Common webhook issues and solutions
Error Handling
Handle webhook errors gracefully
Best Practices
Webhook security and reliability
API Reference
Complete webhook API documentation