Create a widget session for purchasing cryptocurrency. This generates a widget URL that users can use to complete their purchase.
Request Body
The ISO 3166 2-digit country code
The code for the Crypto Currency (e.g., “ETH_BASE”, “USDC_BASE”)
The code for the Fiat Currency (e.g., “USD”, “CAD”)
The amount (in source currency) to buy
The identifier for the Payment Method
The wallet address for the user making this request (does not have to be AGW)
The deposit address on Base returned in the quote
Service Provider to use for this session
URL to navigate back to when widget flow is complete
The name of the app referring the user to the Onramp
Response
The name of the app referring the user to the Onramp (matches provided referrer
)
The wallet address for the user making this request (matches provided walletAddress
)
Meld generated unique identifier for your customer
The crypto widget URL where users complete their purchase
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"
}