Overview
Webhooks allow you to receive real-time notifications about events that occur during the ZBD Ramp lifecycle. From session initialization to payment completion, webhooks provide crucial updates about your users’ transactions. ZBD Ramp sends webhook events to your specified endpoint as HTTP POST requests. Each event contains detailed information about what occurred, allowing you to update your systems accordingly.Webhook URL Setup
Configure your webhook URL when creating a session:Event Categories
Webhook events are organized into six main categories:Session
Widget lifecycle events
Authentication
User verification events
KYC
Identity verification events
Bank
Bank connection events
Payment
Transaction events
Withdrawal
Crypto delivery events
Event Structure
All webhook events follow a consistent structure:Complete Event Reference
Session Events
Session Initiated
Session Initiated
Event:
RAMP_WIDGET.V1.SESSION.INITIATED
Triggered when a Ramp session is successfully initiated.Session Closed
Session Closed
Event:
RAMP_WIDGET.V1.SESSION.CLOSED
Fired when a Ramp session is closed, either by unmount, user action, or completion.Authentication Events
Code Verification Succeeded
Code Verification Succeeded
Event:
RAMP_WIDGET.V1.CODE_VERIFICATION.SUCCEEDED
Sent when a user successfully verifies their 6-digit code.Code Verification Failed
Code Verification Failed
Event:
RAMP_WIDGET.V1.CODE_VERIFICATION.FAILED
Triggered when a 6-digit code verification attempt fails.Access Token Created
Access Token Created
Event:
RAMP_WIDGET.V1.USER_ACCESS_TOKEN.CREATED
Fired when user access and refresh tokens are generated.KYC Events
KYC Initiated
KYC Initiated
Event:
RAMP_WIDGET.V1.KYC.INITIATED
Fired when KYC (Know Your Customer) verification process is initiated.KYC Processing
KYC Processing
Event:
RAMP_WIDGET.V1.KYC.PROCESSING
Indicates that KYC verification is being processed.KYC Completed
KYC Completed
Event:
RAMP_WIDGET.V1.KYC.COMPLETED
Sent when KYC verification is successfully completed.KYC Rejected
KYC Rejected
Event:
RAMP_WIDGET.V1.KYC.REJECTED
Triggered when KYC verification is rejected or fails.Bank Connection Events
Bank Connection Initiated
Bank Connection Initiated
Event:
RAMP_WIDGET.V1.BANK_CONNECTION.INITIATED
Triggered when bank connection flow is initiated.Bank Connection Completed
Bank Connection Completed
Event:
RAMP_WIDGET.V1.BANK_CONNECTION.COMPLETED
Sent when bank connection is successfully established.Bank Connection Failed
Bank Connection Failed
Event:
RAMP_WIDGET.V1.BANK_CONNECTION.FAILED
Fired when bank connection attempt fails.Payment Events
Payment Initiated
Payment Initiated
Event:
RAMP_WIDGET.V1.PAYMENT.INITIATED
Triggered when a payment transaction is initiated.Payment Settled
Payment Settled
Event:
RAMP_WIDGET.V1.PAYMENT.SETTLED
Sent when a payment transaction is successfully settled.Payment Failed
Payment Failed
Event:
RAMP_WIDGET.V1.PAYMENT.FAILED
Fired when a payment transaction fails.Withdrawal Events
Withdrawal Succeeded
Withdrawal Succeeded
Event:
RAMP_WIDGET.V1.WITHDRAWAL.SUCCEEDED
Triggered when a withdrawal is successfully completed.Withdrawal Failed
Withdrawal Failed
Event:
RAMP_WIDGET.V1.WITHDRAWAL.FAILED
Sent when a withdrawal attempt fails.Webhook Implementation
Basic Handler Examples
Here are webhook handler implementations in popular frameworks:Security Best Practices
Important: Always validate webhook authenticity before processing events.
Webhook Verification
- Use HTTPS Only - Always use HTTPS endpoints for webhooks
- Verify Signatures - Validate webhook signatures when provided
- IP Allowlisting - Restrict webhook access to ZBD IP addresses
- Idempotency - Handle duplicate events gracefully
- Timeout Handling - Respond quickly (within 5 seconds)
Error Handling
- Always respond with
200 OK
status, even if processing fails - Log all webhook events for debugging
- Implement retry logic for critical operations
- Use message queues for asynchronous processing
Testing Webhooks
Local Development
Use tools like ngrok to expose your local webhook endpoint:Webhook Testing Checklist
- Required Events
- Recommended Events
- Optional Events
Essential events to handle:
- ✅ PAYMENT.SETTLED
- ✅ WITHDRAWAL.SUCCEEDED
- ✅ PAYMENT.FAILED
- ✅ WITHDRAWAL.FAILED
Troubleshooting
Common Issues
Webhooks not being received
Webhooks not being received
- Verify your webhook URL is publicly accessible
- Check for firewall or security rules blocking requests
- Ensure your endpoint responds with 200 status
- Confirm webhook URL was correctly set during session creation
Duplicate webhooks
Duplicate webhooks
- Implement idempotency using the session_id
- Store processed event IDs to prevent reprocessing
- Use database transactions for critical operations
Webhook timeout errors
Webhook timeout errors
- Process webhooks asynchronously using queues
- Respond immediately with 200 OK
- Move heavy processing to background jobs