- Get a ready-to-use URL directly from the Buy Quote API by including the
destination_address
parameter - Use the getOnrampBuyUrl util to generate a URL
Specify all the parameters in the util to get one-click-buy experience
Should my App use One-click-buy?If your users have already selected the asset they want to buy, an amount, and/or a payment method in your App, yes.
If you want to preset these values for your users, yes.
Manually generating One-Click-Buy URLs
Full API endpoint listFor a complete list of all API endpoints supported by Onramp/Offramp, visit our API Reference section.
Generating One-Click-Buy URLs
One-Click-Buy URLs must have following query parameters set in the URL:presetFiatAmount
orpresetCryptoAmount
fiatCurrency
required forpresetFiatAmount
defaultAsset
(can be omitted when session token specifies only one asset)
Query parameters
Parameter | Reqd | Type | Description |
---|---|---|---|
sessionToken | Yes | String | Token generated by the Session Token API. |
defaultAsset | Yes | String | UUID of asset. optional if session token contains a single asset. Received from Onramp Options and sent to Buy Quote. |
presetFiatAmount | Yes | Number | Amount in fiat to be spent on the crypto purchase, fees included. |
presetCryptoAmount | Yes | Number | Use this instead of presetFiatAmount with defaultPaymentMethod set to CRYPTO_ACCOUNT for send only. |
fiatCurrency | Yes | String | Ticker symbol of the fiat currency. Required only when using presetFiatAmount . |