Crypto off-ramp
The crypto off-ramp flow allows a user to sell cryptocurrency and convert it into fiat, which can then be transferred to their linked debit cards.
Bootstrap token payload
- Schema
- Example
partner(optional): Partner object.continueUrl(optional): URL to redirect the user to after the order is placed and the funds were received.continueUrlTarget(optional): In which tab should thecontinueUrlbe opened.new-tab: Open in a new tab.same-tab: Open in the same tab or iframe (default).parent-tab: Useful only in an iframe: open in the tab that contains the iframe.
displayName(optional): Partner name to be displayed to the user.fee(optional): An object configuring the partner fee to be charged.percentage: Percentage of the total source amount (the maximum allowed value is "5").
refund(optional): An object configuring the refund details. The asset and network of the refund will be the same as the source asset and network.address: Address to which the refund will be sent.tag(optional): Tag of the crypto transaction, used to complement theaddress.type: Tag type (e.g.:memoordestination-tag).value: Tag value.
priority(optional): Priority of the crypto transaction (e.g.:fastwill enable instant send forDashtransactions). Defaults tonormal.
simulation(optional): Simulation object.country(optional): Country to use during simulations, in alpha-2 code format; It will be ignored after the user is authenticated and the user's country will be used.
source(optional): An object configuring the asset and amount to be sold.allowedAssets(optional): Set of cryptoassets that the user can set as source asset.amount(optional): Amount to be sold.asset: Cryptoasset the user will send.editMode(optional): Controls what values the user can change on the widget.all-editable: The user can changeamount,assetandnetworkon the widget. (default)only-amount: The user can only change the amount on the widget.
network(optional): Network of the receiving asset.walletSendUrl(optional): URL to redirect the user to send the crypto from their wallet. It will include order details as query parameters liketopper_order_address,topper_order_amount,topper_order_asset_code,topper_order_asset_network,topper_order_tag_type,topper_order_tag_value, and others. Placeholders{topper_*}can be used on the given URL for dynamic value replacement, useful for deep linking (e.g:https://partner.app/send?amount={topper_order_amount}&address={topper_order_address}).walletSendUrlTarget(optional): In which tab should thewalletSendUrlbe opened.new-tab: Open in a new tab.same-tab: Open in the same tab or iframe (default).parent-tab: Useful only in an iframe: open in the tab that contains the iframe.
walletSendUrlMode(optional): Defines how the order review CTA behaves.button: Navigates to the order payment details screen (default).redirect: Automatically redirects to thewalletSendUrlafter the order is committed.
target(optional): An object configuring the amount and asset to be paid.amount(optional): Amount the user will receive.asset: Currency code in the ISO 4217 format used to receive the funds.
At least one of source.amount or target.amount must be provided, but not both.
The supported values for target.asset, source.asset, source.network, source.tag can be found using our REST API, via the assets endpoint.
If source.allowedAssets is set, and you define source.asset with an asset that is not allowed, the bootstrap will fail.
If source.allowedAssets is set and source.asset is not, the source.asset will default to the first asset on source.allowedAssets.
In the sandbox environment, Topper has limited funds on testnets. If you make an order that needs to be refunded using an asset we have no funds for, the order will be stuck indefinitely trying to create the blockchain transaction.
We recommend that you use XRP for testing purposes when integrating Topper since we have a larger quantity of them. If you prefer to test with another asset and network, please reach out to us beforehand so that we can guarantee funds on our pool and give you a smoother integration experience.
{
"iat": 1679538023,
"jti": "4b552af1-1592-42f8-bbc9-dac28e2b4000",
"sub": "b9fe022b-f436-49e1-bb89-6f2e8eabf336",
"partner": {
"continueUrl": "https://example.com",
"continueUrlTarget": "new-tab",
"displayName": "ACME",
"fee": {
"percentage": "1"
}
},
"refund": {
"address": "0xb794f5ea0ba39494ce839613fffba74279579268",
"priority": "normal"
},
"simulation": {
"country": "US"
},
"source": {
"allowedAssets": [
"BTC",
{
"asset": "ETH",
"networks": [ "ethereum", "arbitrum" ]
},
{ "asset": "XRP" }
]
"amount": "1",
"asset": "ETH",
"editMode": "all-editable",
"network": "ethereum",
"walletSendUrl": "https://example.com",
"walletSendUrlTarget": "new-tab"
},
"target": {
"asset": "USD",
}
}
Events
Full information about the available events and their associated payloads can be found on the events page.