How to Create a Widget URL with Parameters and Test Different Scenarios
This guide shows how to create a widget URL using widgetParams, then test different user journeys in the staging environment.
Important change
Passing query parameters directly in the hosted widget URL is deprecated.
Use the Create Widget URL API from your backend to generate a widgetUrl and load that session in your app.
Before you start
- Your API key
- Your API secret
- A backend service where you can safely generate the access token and widget session
- Access to the staging environment for testing
Step 1: Create a Partner Access Token
Generate a partner access token first.
You will receive:
Step 2: Create the widget URL
Call the Create Widget URL API from your backend.
Sample response:
Session rules
Keep these constraints in mind:
- The
widgetUrlis valid for 5 minutes - A
sessionIdcan be used only once - Reopening the same widget URL is not supported
- Generate a fresh session for every new flow
Common parameters to use in widgetParams
Test scenario 1: Basic buy flow
Use this to validate the default path with minimal configuration.
Test scenario 2: Skip the exchange screen
If your own app already collects the trade inputs, you can skip the exchange screen.
Test scenario 3: Skip wallet confirmation
Test scenario 4: Pre-fill email and lite KYC
Sandbox credentials for staging
Use the staging data below to test KYC flows.
Europe test account
Additional staging identifiers:
- US SSN:
123456789 - India PAN:
ABCDE1234A
Payment test data
Test cards
3DS password
Use Checkout1! on the staging payment authorization screen.
Bank transfer and payout testing
- Test UTR:
345678909872for INR - Use
000000when a bank or phone verification code is requested
Test failure scenarios with email aliases
You can simulate different outcomes by changing the email address used in staging.