- Use the getOnrampBuyUrl util to generate a URL
- Use the
<FundCard />or<FundButton />UI React component
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
Generating One-Click-Buy URLs
One-Click-Buy URLs must have following query parameters set in the URL:presetFiatAmountorpresetCryptoAmountfiatCurrencyrequired forpresetFiatAmountdefaultAssetdefaultPaymentMethod
Query parameters
| Parameter | Reqd | Type | Description |
|---|---|---|---|
| defaultAsset | Yes | String | UUID of asset. Received from Onramp Options and sent to Buy Quote. |
| defaultPaymentMethod | Yes | String | Default payment method, one of:
|
| fiatCurrency | Yes | String | Ticker symbol of the fiat currency. |
| 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. |
| quoteId | No | String | ID of the quote. Received from Onramp Quote. |
| defaultNetwork | No | String | Default network that should be selected when multiple networks are present. When not set, default is the asset network. Received from Buy Options and sent to Buy Quote. |