Create Widget Session
Initialize a new onramp widget session for a user
Description
This endpoint creates a session token and widget URL that can be used to embed the ZBD Onramp widget in your game or application.
Usage
The onramp widget allows your users to purchase Bitcoin or USDC using their preferred fiat currency. The session creation process involves:
First
Create a session with user details and configuration options
Second
Receive a widget URL and session token to embed in your application
Configuration
Header Parameters
ZBD Project API Key
Content Type
Body Parameters
Email address of the user launching the Ramp
URL to receive webhook notifications
Existing user session token (for returning users)
Currency to convert from (e.g., USD)
Currency to convert to (e.g., BTC)
Destination address for the funds (Lightning Address, onchain address, or USDC address)
Your internal reference ID for this transaction
Additional metadata for the transaction
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: