- Get a ready-to-use URL directly from the Buy Quote API by including the destination_addressparameter
Security Requirements must be enforced: Your backend API that generates session tokens must implement proper security measures. See Security Requirements for complete implementation guidance.
- 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.
Generating One-Click-Buy URLs
One-Click-Buy URLs must have following query parameters set in the URL:- presetFiatAmountor- presetCryptoAmount
- fiatCurrencyrequired for- presetFiatAmount
- 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_ACCOUNTfor send only. | 
| fiatCurrency | Yes | String | Ticker symbol of the fiat currency. Required only when using presetFiatAmount. |