- Get a ready-to-use URL directly from the Buy Quote API by including the
destination_addressparameter
- Use the getOnrampBuyUrl util to generate a URL
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:presetFiatAmountorpresetCryptoAmountfiatCurrencyrequired forpresetFiatAmountdefaultAsset(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. |