For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
DocsAPI Reference
DocsAPI Reference
    • What is Transak
  • Features
    • Auth Reliance
    • KYC Reliance using Sumsub
    • Webhooks
    • WebSockets
  • Products Overview
    • On Ramp
    • Off Ramp
    • NFT Checkout
  • Integration Options
    • API
  • Customization Options
    • Query Parameters
    • Customizing theme using query parameters
  • Guides
    • How To Create a Partner Dashboard Account
    • How to Add Partner Fees and Set Up Partner Payouts
    • How to Test using Sandbox Credentials
    • How to Test ACH Pull Transaction in Sandbox
    • How to Test Apple Pay in Sandbox
    • How to Track Order Status
    • Transak Different KYC Levels
    • How to Submit FCA Requirements
    • How to Use Advanced Query Params
    • How to Create a Widget URL with Parameters and Test Different Scenarios
    • How to Generate Calldata for NFT Checkout
    • How to Add NFT Smart Contract in the Dashboard and Create a contractId
    • Get Price based on User Region
    • How to Create Partner Access Token
    • How to Decrypt the Webhook Payload
    • How to add MCP Server for Transak Documentation
    • Widget with API Customization
    • Integration Update - Mandatory Migration to API based Transak Widget URL
    • Biconomy: Simplified Onboarding Using MEE-Compatible Smart Accounts
    • Partner FAQs
    • Need Help?
Dashboard
LogoLogo
Guides

How to Create a Widget URL with Parameters and Test Different Scenarios

Generate a widget URL through the API and use sandbox credentials to validate common flows
||View as Markdown|
Was this page helpful?
Edit this page
Previous

How to Use Advanced Query Parameters

Next

How to Generate Calldata for NFT Checkout

Built with
On this page
  • Important change
  • Before you start
  • Step 1: Create a Partner Access Token
  • Step 2: Create the widget URL
  • Session rules
  • Common parameters to use in widgetParams
  • Test scenario 1: Basic buy flow
  • Test scenario 2: Skip the exchange screen
  • Test scenario 3: Skip wallet confirmation
  • Test scenario 4: Pre-fill email and lite KYC
  • Sandbox credentials for staging
  • Europe test account
  • Payment test data
  • Test cards
  • 3DS password
  • Bank transfer and payout testing
  • Test failure scenarios with email aliases

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.

$curl --request POST \
> --url https://api-stg.transak.com/partners/api/v2/refresh-token \
> --header 'accept: application/json' \
> --header 'api-secret: YOUR_API_SECRET' \
> --header 'content-type: application/json' \
> --data '{"apiKey":"YOUR_API_KEY"}'

You will receive:

1{
2 "data": {
3 "accessToken": "YOUR_ACCESS_TOKEN",
4 "expiresAt": 1770977934
5 }
6}

Step 2: Create the widget URL

Call the Create Widget URL API from your backend.

$curl --request POST \
> --url https://api-gateway-stg.transak.com/api/v2/auth/session \
> --header 'accept: application/json' \
> --header 'access-token: YOUR_ACCESS_TOKEN' \
> --header 'content-type: application/json' \
> --data '{
> "widgetParams": {
> "apiKey": "YOUR_API_KEY",
> "referrerDomain": "yourdomain.com",
> "productsAvailed": "BUY",
> "fiatAmount": 100,
> "fiatCurrency": "EUR",
> "cryptoCurrencyCode": "ETH",
> "network": "ethereum",
> "paymentMethod": "credit_debit_card"
> }
>}'

Sample response:

1{
2 "data": {
3 "widgetUrl": "https://global-stg.transak.com?apiKey=YOUR_API_KEY&sessionId=YOUR_SESSION_ID"
4 }
5}

Session rules

Keep these constraints in mind:

  • The widgetUrl is valid for 5 minutes
  • A sessionId can 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

ParameterPurpose
apiKeyYour Transak API key
referrerDomainYour approved website domain or app package
productsAvailedBUY, SELL, or BUY,SELL
fiatAmountLock the fiat amount
fiatCurrencyLock the fiat currency
cryptoCurrencyCodeLock the crypto asset
networkLock the blockchain network
paymentMethodLock the payment method
hideExchangeScreenSkip the exchange screen when all required values are present
walletAddressPre-fill destination wallet
disableWalletAddressFormPrevent editing of the wallet
emailPre-fill email
userDataPre-fill lite KYC details
partnerOrderIdYour internal order reference
partnerCustomerIdYour internal customer reference

Test scenario 1: Basic buy flow

Use this to validate the default path with minimal configuration.

1{
2 "widgetParams": {
3 "apiKey": "YOUR_API_KEY",
4 "referrerDomain": "yourdomain.com",
5 "productsAvailed": "BUY",
6 "fiatAmount": 100,
7 "fiatCurrency": "EUR",
8 "cryptoCurrencyCode": "ETH",
9 "network": "ethereum"
10 }
11}

Test scenario 2: Skip the exchange screen

If your own app already collects the trade inputs, you can skip the exchange screen.

1{
2 "widgetParams": {
3 "apiKey": "YOUR_API_KEY",
4 "referrerDomain": "yourdomain.com",
5 "productsAvailed": "BUY",
6 "fiatAmount": 100,
7 "fiatCurrency": "GBP",
8 "cryptoCurrencyCode": "ETH",
9 "network": "ethereum",
10 "paymentMethod": "credit_debit_card",
11 "hideExchangeScreen": true
12 }
13}

Test scenario 3: Skip wallet confirmation

1{
2 "widgetParams": {
3 "apiKey": "YOUR_API_KEY",
4 "referrerDomain": "yourdomain.com",
5 "walletAddress": "0xFfb61856d2aEC494e8c9cFB599b82D466124e280",
6 "disableWalletAddressForm": true
7 }
8}

Test scenario 4: Pre-fill email and lite KYC

1{
2 "widgetParams": {
3 "apiKey": "YOUR_API_KEY",
4 "referrerDomain": "yourdomain.com",
5 "email": "doe.jane@example.com",
6 "userData": {
7 "firstName": "Doe",
8 "lastName": "Jane",
9 "mobileNumber": "+33791112345",
10 "dob": "1998-01-01",
11 "address": {
12 "addressLine1": "170 Rue du Faubourg Saint-Denis",
13 "addressLine2": "Paris",
14 "city": "Paris",
15 "state": "Paris",
16 "postCode": "75010",
17 "countryCode": "FR"
18 }
19 }
20 }
21}

Sandbox credentials for staging

Use the staging data below to test KYC flows.

Europe test account

FieldValue
First NameDoe
Last NameJane
Mobile Number+33 791112345
Date of Birth01-01-1998
Address Line170 Rue du Faubourg Saint-Denis, Paris
State / RegionParis
CityParis
Postal Code75010

Additional staging identifiers:

  • US SSN: 123456789
  • India PAN: ABCDE1234A

Payment test data

Test cards

Card TypeCard NumberExpiryCVVFiat currencies
VISA402476444997151910/33123USD, IDR
VISA424242424242424210/33100GBP, EUR, AUD, CAD, CHF, NOK, JPY, KRW, ZAR, NZD, SGD, HKD

3DS password

Use Checkout1! on the staging payment authorization screen.

Bank transfer and payout testing

  • Test UTR: 345678909872 for INR
  • Use 000000 when 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.

ScenarioExample email
Normal flowxyz@abc.com
Refunded orderxyz+review@abc.com
Failed orderxyz+failed@abc.com