Webhook Integration
Learn how to integrate webhooks to receive real-time notifications about account onboarding status changes.Why Use Webhooks?
Webhooks provide real-time notifications when account statuses change, eliminating the need to poll the API repeatedly.Benefits
Real-time Updates
Receive notifications instantly when status changes
Reduced API Calls
No need to poll for status updates
Automated Workflows
Trigger actions automatically based on events
Better UX
Provide immediate feedback to users
Setting Up Webhooks
Step 1: Create a Webhook Endpoint
Create an HTTPS endpoint in your application to receive webhook notifications:Step 2: Register Your Webhook
Register your webhook URL with WEpayments:Save the
webhook_id for future reference. You’ll need it to update or delete the webhook.Step 3: Handle Webhook Events
Process different account statuses:Webhook Payload
Structure
Field Descriptions
| Field | Type | Description |
|---|---|---|
event | string | Always "onboarding" for account events |
event_id | string | Unique identifier for this event |
timestamp | string | When the event occurred (ISO 8601) |
data.account_id | string | The account identifier |
data.status | string | New account status |
data.previous_status | string | Previous account status |
data.reason | string | Rejection reason (if applicable) |
Best Practices
Return 200 OK Quickly
Return 200 OK Quickly
Your endpoint should return a
200 OK response within 5 seconds. Process the webhook data asynchronously.Handle Duplicate Events
Handle Duplicate Events
Use the
event_id to prevent processing the same event multiple times:Implement Retry Logic
Implement Retry Logic
If your processing fails, store the event and retry later:
Secure Your Endpoint
Secure Your Endpoint
- Use HTTPS only
- Validate webhook signatures (if provided)
- Implement rate limiting
- Log all webhook deliveries
Testing Webhooks Locally
Use ngrok or localtunnel to test webhooks on your local machine:Managing Webhooks
List All Webhooks
Update Webhook URL
Delete Webhook
Troubleshooting
Webhooks Not Being Received
Webhooks Not Being Received
Checklist:
- Endpoint is using HTTPS
- Endpoint is publicly accessible
- Endpoint returns 200 OK
- No firewall blocking requests
- Webhook is registered correctly
Duplicate Webhooks
Duplicate Webhooks
Cause: Your endpoint didn’t return 200 OK quickly enoughSolution: Return 200 immediately and process asynchronously
Missing Webhooks
Missing Webhooks
Cause: Endpoint was down or returned an errorSolution: Implement monitoring and alerting for your webhook endpoint

