API Reference
Complete API reference for ZBD Onramp integration
Complete reference for all ZBD Onramp API endpoints and webhook events.
Base URL
All API requests should be made to:
Authentication
All requests require an API key in the header:
Get your API keys by scheduling a call with our sales team.
Create Widget Session
Initialize a new onramp widget session for a user.
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
email | string | Yes | User’s email address for verification |
webhook_url | string | Yes | URL to receive webhook notifications |
access_token | string | No | Existing user session token (for returning users) |
quote_currency | string | No | Fiat currency code (default: “USD”) |
base_currency | string | No | Cryptocurrency: “BTC” or “USDC” (default: “BTC”) |
destination | string | No | URL to redirect after successful purchase |
reference_id | string | No | Your internal reference ID for this session |
metadata | object | No | Custom key-value pairs (max 10 keys, 500 chars per value) |
Response
Error Responses
Common error codes:
INVALID_EMAIL
- Email format is invalidINVALID_WEBHOOK_URL
- Webhook URL is not accessibleUNAUTHORIZED
- Invalid API keyRATE_LIMITED
- Too many requests
Webhook Events
Webhooks are sent as POST requests to your specified webhook_url
.
Event Structure
All webhook events follow this structure:
Event Types
onramp.session.created
Fired when a widget session is initialized.
onramp.email.verified
Fired when user completes email verification.
onramp.kyc.completed
Fired when KYC verification is successfully completed (first-time users only).
onramp.purchase.completed
Fired when a purchase is successfully completed and crypto is delivered.
onramp.purchase.failed
Fired when a purchase fails at any stage.
Webhook Security
All webhooks include a signature header for verification:
Verify webhooks using HMAC-SHA256:
Webhook Retry Policy
Failed webhook deliveries are retried with exponential backoff:
- Attempt 1: Immediate
- Attempt 2: 5 seconds
- Attempt 3: 30 seconds
- Attempt 4: 2 minutes
- Attempt 5: 10 minutes
- Attempt 6: 1 hour
Webhooks are considered failed if:
- Response status is not 2xx
- No response within 5 seconds
- Connection error
Error Codes
HTTP Status Codes
Code | Description |
---|---|
200 | Success |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid API key |
403 | Forbidden - Access denied |
404 | Not Found - Resource doesn’t exist |
429 | Too Many Requests - Rate limited |
500 | Internal Server Error |
Application Error Codes
Code | Description | Resolution |
---|---|---|
INVALID_EMAIL | Email format is invalid | Provide valid email address |
INVALID_CURRENCY | Currency code not supported | Use USD for fiat, BTC/USDC for crypto |
SESSION_EXPIRED | Widget session has expired | Create a new session |
USER_BLOCKED | User failed fraud checks | Contact support |
KYC_REQUIRED | User needs to complete KYC | User will be guided through KYC flow |
PURCHASE_LIMIT_EXCEEDED | Amount exceeds limits | Reduce purchase amount |
PAYMENT_METHOD_UNAVAILABLE | Selected payment method not available | Try different payment method |
Rate Limits
API endpoints are rate limited to ensure platform stability:
Endpoint | Limit | Window |
---|---|---|
/api/v1/ramp-widget | 100 requests | 1 minute |
All endpoints (per API key) | 1000 requests | 1 hour |
Rate limit headers are included in responses:
Testing
Sandbox environment is coming soon. Currently, all integrations use production mode. Test with small amounts during development.
Support
Integration Support
Get help with your integration from our technical team
API Status
Check current API status and subscribe to updates
This API is in active development. Subscribe to our changelog for updates.