Skip to main content
POST
/
widget
curl -X POST "https://onramp.staging-portal.abs.xyz/widget" \
  -H "Content-Type: application/json" \
  -d '{
    "country": "US",
    "destinationCurrency": "USDC_BASE",
    "sourceCurrency": "USD",
    "amount": "100",
    "paymentMethod": "CREDIT_DEBIT_CARD",
    "walletAddress": "0xfc61f1b7701f6765ff548b3bca403cdaa723d260",
    "toAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "serviceProvider": "TRANSAK",
    "redirectUrl": "https://myapp.com/success",
    "referrer": "MyApp"
  }'
{
  "id": "WePzm7gRdUgis7VHQjMYYL",
  "externalSessionId": "MyApp",
  "externalCustomerId": "0xfc61f1b7701f6765ff548b3bca403cdaa723d260",
  "customerId": "WeP9qpZzvBizvKhR8bGigL",
  "widgetUrl": "https://sb.meldcrypto.com?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtZWxkLmlvIiwiaWF0IjoxNzUxOTUwMDM5LCJzdWIiOiJjcnlwdG8iLCJleHAiOjE3NTE5NTE4MzksImFjY291bnRJZCI6IldlUUVGcDZyZVU3VFNOQWVOODZjdFUiLCJzZXNzaW9uSWQiOiJXZVB6bTdnUmRVZ2lzN1ZIUWpNWVlMIn0.xr6V09K4ZSwYUaiOlmGVJ_QgAiaHFx9OXKvJroLGNtE",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtZWxkLmlvIiwiaWF0IjoxNzUxOTUwMDM5LCJzdWIiOiJjcnlwdG8iLCJleHAiOjE3NTE5NTE4MzksImFjY291bnRJZCI6IldlUUVGcDZyZVU3VFNOQWVOODZjdFUiLCJzZXNzaW9uSWQiOiJXZVB6bTdnUmRVZ2lzN1ZIUWpNWVlMIn0.xr6V09K4ZSwYUaiOlmGVJ_QgAiaHFx9OXKvJroLGNtE"
}
Create a widget session for purchasing cryptocurrency. This generates a widget URL that users can use to complete their purchase.

Request Body

country
string
required
The ISO 3166 2-digit country code
destinationCurrency
string
required
The code for the Crypto Currency (e.g., “ETH_BASE”, “USDC_BASE”)
sourceCurrency
string
required
The code for the Fiat Currency (e.g., “USD”, “CAD”)
amount
string
required
The amount (in source currency) to buy
paymentMethod
string
required
The identifier for the Payment Method
walletAddress
string
required
The wallet address for the user making this request (does not have to be AGW)
toAddress
string
required
The deposit address on Base returned in the quote
serviceProvider
string
required
Service Provider to use for this session
redirectUrl
string
URL to navigate back to when widget flow is complete
referrer
string
The name of the app referring the user to the Onramp

Response

id
string
required
Session identifier
externalSessionId
string
required
The name of the app referring the user to the Onramp (matches provided referrer)
externalCustomerId
string
required
The wallet address for the user making this request (matches provided walletAddress)
customerId
string
required
Meld generated unique identifier for your customer
widgetUrl
string
required
The crypto widget URL where users complete their purchase
token
string
required
The session token
curl -X POST "https://onramp.staging-portal.abs.xyz/widget" \
  -H "Content-Type: application/json" \
  -d '{
    "country": "US",
    "destinationCurrency": "USDC_BASE",
    "sourceCurrency": "USD",
    "amount": "100",
    "paymentMethod": "CREDIT_DEBIT_CARD",
    "walletAddress": "0xfc61f1b7701f6765ff548b3bca403cdaa723d260",
    "toAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "serviceProvider": "TRANSAK",
    "redirectUrl": "https://myapp.com/success",
    "referrer": "MyApp"
  }'
{
  "id": "WePzm7gRdUgis7VHQjMYYL",
  "externalSessionId": "MyApp",
  "externalCustomerId": "0xfc61f1b7701f6765ff548b3bca403cdaa723d260",
  "customerId": "WeP9qpZzvBizvKhR8bGigL",
  "widgetUrl": "https://sb.meldcrypto.com?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtZWxkLmlvIiwiaWF0IjoxNzUxOTUwMDM5LCJzdWIiOiJjcnlwdG8iLCJleHAiOjE3NTE5NTE4MzksImFjY291bnRJZCI6IldlUUVGcDZyZVU3VFNOQWVOODZjdFUiLCJzZXNzaW9uSWQiOiJXZVB6bTdnUmRVZ2lzN1ZIUWpNWVlMIn0.xr6V09K4ZSwYUaiOlmGVJ_QgAiaHFx9OXKvJroLGNtE",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtZWxkLmlvIiwiaWF0IjoxNzUxOTUwMDM5LCJzdWIiOiJjcnlwdG8iLCJleHAiOjE3NTE5NTE4MzksImFjY291bnRJZCI6IldlUUVGcDZyZVU3VFNOQWVOODZjdFUiLCJzZXNzaW9uSWQiOiJXZVB6bTdnUmRVZ2lzN1ZIUWpNWVlMIn0.xr6V09K4ZSwYUaiOlmGVJ_QgAiaHFx9OXKvJroLGNtE"
}
I