Crypto on-ramp
The crypto on-ramp flow allows a user to add funds from a credit or debit card to a crypto address.
Bootstrap token payload
- Schema
- Example
partner
(optional): Partner object.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").
continueUrl
(optional): URL to redirect the user to after the order is placed.continueUrlTarget
(optional): In which tab should thecontinueUrl
be 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.
partnerFee
(deprecated): Usepartner.fee
instead.source
(optional): An object configuring the asset and amount to be paid.amount
(optional): Amount to be paid.asset
: Currency code in the ISO 4217 format used to make the payment.paymentMethod
(optional): An object configuring the pre-selected payment method.network
: Payment method network (e.g.:apple-pay
,google-pay
,pix
orcard
).
target
(optional): An object configuring recipient wallet.allowedAssets
(optional): Set of cryptoassets that the user can set as target asset.amount
(optional): Amount the user will receive.asset
: Cryptoasset the user will receive.network
: Network of the receiving asset.address
: Recipient wallet address.tag
(optional): Tag of the crypto transaction, used to complement theaddress
.type
: Tag type (e.g.:memo
ordestination-tag
).value
: Tag value.
priority
(optional): Priority of the crypto transaction (e.g.:fast
will enable instant send forDash
transactions). Defaults tonormal
.recipientEditMode
(optional): Controls if the user can changeasset
,network
,address
andtag
on the widget. Defaults tonot-editable
.label
(optional): A label used for display purposes to name the recipient wallet. Defaults to the widget name.
At least one of source.amount
or target.amount
must be provided, but not both.
The supported values for source.asset
, target.asset
, target.network
, target.tag
and target.priority
can be found using our REST API, via the assets endpoint.
If target.allowedAssets
is set, and you define target.asset
with an asset that is not allowed, the bootstrap will fail.
If target.allowedAssets
is set and target.asset
is not, the target.asset
will default to the first asset on target.allowedAssets
.
In the sandbox
environment, Topper has limited funds on testnets. If you make an order 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": {
"displayName": "ACME",
"fee": {
"percentage": "1"
},
"continueUrl": "https://example.com",
"continueUrlTarget": "new-tab"
},
"source": {
"amount": "100.00",
"asset": "USD",
"paymentMethod": {
"network": "card"
}
},
"target": {
"allowedAssets": [
"BTC",
{
"asset": "ETH",
"networks": [ "ethereum", "arbitrum" ]
},
{ "asset": "XRP" }
]
"address": "0xb794f5ea0ba39494ce839613fffba74279579268",
"asset": "ETH",
"network": "ethereum",
"label": "My wallet"
}
}
Recipient edit mode
- Not editable
- Only address and tag
- All editable
When recipientEditMode
is not-editable
, the user can can't change asset
, network
, address
or tag
on the widget. This means that these fields are all required on the bootstrap token.
{
"iat": 1679538023,
"jti": "4b552af1-1592-42f8-bbc9-dac28e2b4000",
"sub": "b9fe022b-f436-49e1-bb89-6f2e8eabf336",
"target": {
"asset": "ETH",
"network": "ethereum",
"address": "0xb794f5ea0ba39494ce839613fffba74279579268",
"label": "My wallet",
"recipientEditMode": "not-editable"
}
}
When recipientEditMode
is only-address-and-tag
, the user can only change address
and tag
on the widget. This means that these fields are optional on the bootstrap token but you can still provide values for them. On the other hand, asset
and network
become mandatory.
{
"iat": 1679538023,
"jti": "4b552af1-1592-42f8-bbc9-dac28e2b4000",
"sub": "b9fe022b-f436-49e1-bb89-6f2e8eabf336",
"target": {
"asset": "ETH",
"network": "ethereum",
"recipientEditMode": "only-address-and-tag"
}
}
When recipientEditMode
is all-editable
, the user can change asset
, network
, address
and tag
on the widget. This means that all these fields are optional on the bootstrap token but you can still provide values for them.
{
"iat": 1679538023,
"jti": "4b552af1-1592-42f8-bbc9-dac28e2b4000",
"sub": "b9fe022b-f436-49e1-bb89-6f2e8eabf336",
"target": {
"recipientEditMode": "all-editable"
}
}
Events
order:crypto-onramp:committed
Triggered when a user has placed an order.
- Schema
- Example
id
: UUID of the order.status
: Status of the order (pending
).createdAt
: Timestamp at which the order was created.updatedAt
: Timestamp at which the order was last updated.origin
: Object containing information about how the user paid.amount
: Amount the user will pay.rate
: Rate used to calculate the amount.asset
: Currency code in the ISO 4217 format used to make the payment.paymentMethod
: Object containing information about the payment method used.type
: Type of payment method.
destination
: Object containing information about what the user will receive.amount
: Amount the user will receive.rate
: Rate used to calculate the amount.asset
: Cryptoasset the user will receive.network
: Network of the receiving asset.address
: Recipient wallet address.tag
(optional): Tag of the crypto transaction, used to complement theaddress
.type
: Tag type (e.g.:memo
ordestination-tag
).value
: Tag value.
priority
(optional): Priority of the crypto transaction.
fees
: Array containing fees associated with the order.amount
: Amount user was charged for this fee.asset
: Asset used to charge the fee.normalized
: Amount in USD that the user was charged for this fee.type
: Type of fee (network
,deposit
orpartner
).
widget
: Widget associated with the session.id
UUID of the widget.name
: Name of the widget.flow
: Flow associated with the widget.
The values for origin.paymentMethod.type
can be found using our REST API, via the payment methods endpoint.
{
"name": "order:crypto-onramp:committed",
"id": "00a991cf-a870-43af-88b8-43c51532831d",
"bootstrapTokenId": "141bfa06-481e-4684-96eb-cec4ad529616",
"data": {
"id": "966b8e24-6a65-442a-942e-577f16288789",
"status": "pending",
"createdAt": "2023-06-12T17:21:21.240Z",
"updatedAt": "2023-06-12T17:21:21.240Z",
"origin": {
"amount": "100.00",
"rate": "1770.27534301775263314892",
"asset": "USD",
"paymentMethod": {
"type": "credit-card"
}
},
"destination": {
"amount": "0.047116964221968237",
"rate": "0.00056488387749632223",
"asset": "ETH",
"network": "ethereum",
"address": "0xb794F5eA0ba39494cE839613fffBA74279579268"
},
"fees": [
{
"amount": "14.17",
"asset": "USD",
"normalized": "14.17",
"type": "network"
},
{
"amount": "2.42",
"asset": "USD",
"normalized": "2.42",
"type": "deposit"
},
{
"amount": "1.00",
"asset": "USD",
"normalized": "1.00",
"type": "partner"
}
],
"widget": {
"id": "998544f2-5b01-4062-9394-22827ff5db6c",
"name": "ACME",
"flow": "crypto_onramp"
}
}
}
order:crypto-onramp:charged
Triggered when a user has been charged.
- Schema
- Example
id
: UUID of the order.status
: Status of the order (processing
).createdAt
: Timestamp at which the order was created.updatedAt
: Timestamp at which the order was last updated.origin
: Object containing information about how the user paid.amount
: Amount the user paid.rate
: Rate used to calculate the amount.asset
: Currency code in the ISO 4217 format used to make the payment.paymentMethod
: Object containing information about the payment method used.type
: Type of payment method.
destination
: Object containing information about what the user will receive.amount
: Amount the user will receive.rate
: Rate used to calculate the amount.asset
: Cryptoasset the user will receive.network
: Network of the receiving asset.address
: Recipient wallet address.tag
(optional): Tag of the crypto transaction, used to complement theaddress
.type
: Tag type (e.g.:memo
ordestination-tag
).value
: Tag value.
priority
(optional): Priority of the crypto transaction.
fees
: Array containing fees associated with the order.amount
: Amount user was charged for this fee.asset
: Asset used to charge the fee.normalized
: Amount in USD that the user was charged for this fee.type
: Type of fee (network
,deposit
orpartner
).
widget
: Widget associated with the session.id
UUID of the widget.name
: Name of the widget.flow
: Flow associated with the widget.
The values for origin.paymentMethod.type
can be found using our REST API, via the payment methods endpoint.
{
"name": "order:crypto-onramp:charged",
"id": "00a991cf-a870-43af-88b8-43c51532831d",
"bootstrapTokenId": "141bfa06-481e-4684-96eb-cec4ad529616",
"data": {
"id": "966b8e24-6a65-442a-942e-577f16288789",
"status": "processing",
"createdAt": "2023-06-12T17:21:21.240Z",
"updatedAt": "2023-06-12T17:21:21.240Z",
"origin": {
"amount": "100.00",
"rate": "1770.27534301775263314892",
"asset": "USD",
"paymentMethod": {
"type": "credit-card"
}
},
"destination": {
"amount": "0.047116964221968237",
"rate": "0.00056488387749632223",
"asset": "ETH",
"network": "ethereum",
"address": "0xb794F5eA0ba39494cE839613fffBA74279579268"
},
"fees": [
{
"amount": "14.17",
"asset": "USD",
"normalized": "14.17",
"type": "network"
},
{
"amount": "2.42",
"asset": "USD",
"normalized": "2.42",
"type": "deposit"
},
{
"amount": "1.00",
"asset": "USD",
"normalized": "1.00",
"type": "partner"
}
],
"widget": {
"id": "998544f2-5b01-4062-9394-22827ff5db6c",
"name": "ACME",
"flow": "crypto_onramp"
}
}
}
order:crypto-onramp:completed
Triggered when a user's order has completed.
- Schema
- Example
id
: UUID of the order.status
: Status of the order (completed
).createdAt
: Timestamp at which the order was created.updatedAt
: Timestamp at which the order was last updated.origin
: Object containing information about how the user paid.amount
: Amount the user paid.rate
: Rate used to calculate the amount.asset
: Currency code in the ISO 4217 format used to make the payment.paymentMethod
: Object containing information about the payment method used.type
: Type of payment method.
destination
: Object containing information about what the user received.amount
: Amount the user received.rate
: Rate used to calculate the amount.asset
: Cryptoasset the user received.blockchainUrl
(deprecated): URL to view the transaction details on a blockchain explorer.network
: Network of the receiving asset.address
: Recipient wallet address.tag
(optional): Tag of the crypto transaction, used to complement theaddress
.type
: Tag type (e.g.:memo
ordestination-tag
).value
: Tag value.
priority
(optional): Priority of the crypto transaction.ledger
(optional): Object containing information about the transaction on the ledger.txid
: Transaction ID on the ledger.url
: URL to view the transaction details on a blockchain explorer.
fees
: Array containing fees associated with the order.amount
: Amount user was charged for this fee.asset
: Asset used to charge the fee.normalized
: Amount in USD that the user was charged for this fee.type
: Type of fee (network
,deposit
orpartner
).
widget
: Widget associated with the session.id
UUID of the widget.name
: Name of the widget.flow
: Flow associated with the widget.
The values for origin.paymentMethod.type
can be found using our REST API, via the payment methods endpoint.
{
"name": "order:crypto-onramp:completed",
"id": "00a991cf-a870-43af-88b8-43c51532831d",
"bootstrapTokenId": "141bfa06-481e-4684-96eb-cec4ad529616",
"data": {
"id": "966b8e24-6a65-442a-942e-577f16288789",
"status": "completed",
"createdAt": "2023-06-12T17:21:21.240Z",
"updatedAt": "2023-06-12T17:21:21.240Z",
"origin": {
"amount": "100.00",
"rate": "1770.27534301775263314892",
"asset": "USD",
"paymentMethod": {
"type": "credit-card"
}
},
"destination": {
"amount": "0.047116964221968237",
"rate": "0.00056488387749632223",
"asset": "ETH",
"ledger": {
"txid": "0xdfa1ea4ddb841af466a5ca78c6e1f0edfaef5e54e79a28238d2a5bb2da4f1911",
"url": "https://etherscan.io/tx/0xdfa1ea4ddb841af466a5ca78c6e1f0edfaef5e54e79a28238d2a5bb2da4f1911"
},
"network": "ethereum",
"address": "0xb794F5eA0ba39494cE839613fffBA74279579268"
},
"fees": [
{
"amount": "14.17",
"asset": "USD",
"normalized": "14.17",
"type": "network"
},
{
"amount": "2.42",
"asset": "USD",
"normalized": "2.42",
"type": "deposit"
},
{
"amount": "1.00",
"asset": "USD",
"normalized": "1.00",
"type": "partner"
}
],
"widget": {
"id": "998544f2-5b01-4062-9394-22827ff5db6c",
"name": "ACME",
"flow": "crypto_onramp"
}
}
}
order:crypto-onramp:failed
Triggered when a user's order has failed.
- Schema
- Example
id
: UUID of the order.status
: Status of the order (failed
).createdAt
: Timestamp at which the order was created.updatedAt
: Timestamp at which the order was last updated.origin
: Object containing information about how the user paid.amount
: Amount the user paid.rate
: Rate used to calculate the amount.asset
: Currency code in the ISO 4217 format used to make the payment.paymentMethod
: Object containing information about the payment method used.type
: Type of payment method.
destination
: Object containing information about what the user would have received.amount
: Amount the user would have received.rate
: Rate used to calculate the amount.asset
: Cryptoasset the user would have received.network
: Network of the receiving asset.address
: Recipient wallet address.tag
(optional): Tag of the crypto transaction, used to complement theaddress
.type
: Tag type (e.g.:memo
ordestination-tag
).value
: Tag value.
priority
(optional): Priority of the crypto transaction.
fees
: Array containing fees associated with the order.amount
: Amount user was charged for this fee.asset
: Asset used to charge the fee.normalized
: Amount in USD that the user was charged for this fee.type
: Type of fee (network
,deposit
orpartner
).
widget
: Widget associated with the session.id
UUID of the widget.name
: Name of the widget.flow
: Flow associated with the widget.
error
: Indicates specific error information.reason
: Indicates the reason for the error, possible values arefraud
.
The values for origin.paymentMethod.type
can be found using our REST API, via the payment methods endpoint.
{
"name": "order:crypto-onramp:failed",
"id": "00a991cf-a870-43af-88b8-43c51532831d",
"bootstrapTokenId": "141bfa06-481e-4684-96eb-cec4ad529616",
"data": {
"id": "966b8e24-6a65-442a-942e-577f16288789",
"status": "failed",
"createdAt": "2023-06-12T17:21:21.240Z",
"updatedAt": "2023-06-12T17:21:21.240Z",
"origin": {
"amount": "100.00",
"rate": "1770.27534301775263314892",
"asset": "USD",
"paymentMethod": {
"type": "credit-card"
}
},
"destination": {
"amount": "0.047116964221968237",
"rate": "0.00056488387749632223",
"asset": "ETH",
"network": "ethereum",
"address": "0xb794F5eA0ba39494cE839613fffBA74279579268"
},
"fees": [
{
"amount": "14.17",
"asset": "USD",
"normalized": "14.17",
"type": "network"
},
{
"amount": "2.42",
"asset": "USD",
"normalized": "2.42",
"type": "deposit"
},
{
"amount": "1.00",
"asset": "USD",
"normalized": "1.00",
"type": "partner"
}
],
"widget": {
"id": "998544f2-5b01-4062-9394-22827ff5db6c",
"name": "ACME",
"flow": "crypto_onramp"
},
"error": {
"reason": "fraud"
}
}
}
order:crypto-onramp:refund:completed
Triggered when a user's order has been successfully refunded.
- Schema
- Example
id
: UUID of the order.status
: Status of the order (refunded
).createdAt
: Timestamp at which the order was created.updatedAt
: Timestamp at which the order was last updated.origin
: Object containing information about how the user paid.amount
: Amount the user paid.rate
: Rate used to calculate the amount.asset
: Currency code in the ISO 4217 format used to make the payment.paymentMethod
: Object containing information about the payment method used.type
: Type of payment method.
destination
: Object containing information about what the user would have received.amount
: Amount the user would have received.rate
: Rate used to calculate the amount.asset
: Cryptoasset the user would have received.network
: Network of the receiving asset.address
: Recipient wallet address.tag
(optional): Tag of the crypto transaction, used to complement theaddress
.type
: Tag type (e.g.:memo
ordestination-tag
).value
: Tag value.
priority
(optional): Priority of the crypto transaction.
fees
: Array containing fees associated with the order.amount
: Amount user was charged for this fee.asset
: Asset used to charge the fee.normalized
: Amount in USD that the user was charged for this fee.type
: Type of fee (network
,deposit
orpartner
).
refund
: Object containing information about how much was refunded to the user.formattedAmount
: Amount refunded to the userasset
: Currency code in the ISO 4217 format used to make the payment.rate
: Rate used to calculate the amount.
widget
: Widget associated with the session.id
UUID of the widget.name
: Name of the widget.flow
: Flow associated with the widget.
The values for origin.paymentMethod.type
can be found using our REST API, via the payment methods endpoint.
{
"name": "order:crypto-onramp:refund:completed",
"id": "00a991cf-a870-43af-88b8-43c51532831d",
"bootstrapTokenId": "141bfa06-481e-4684-96eb-cec4ad529616",
"data": {
"id": "966b8e24-6a65-442a-942e-577f16288789",
"status": "refunded",
"createdAt": "2023-06-12T17:21:21.240Z",
"updatedAt": "2023-06-12T17:21:21.240Z",
"origin": {
"amount": "100.00",
"rate": "1770.27534301775263314892",
"asset": "USD",
"paymentMethod": {
"type": "credit-card"
}
},
"destination": {
"amount": "0.047116964221968237",
"rate": "0.00056488387749632223",
"asset": "ETH",
"network": "ethereum",
"address": "0xb794F5eA0ba39494cE839613fffBA74279579268"
},
"fees": [
{
"amount": "14.17",
"asset": "USD",
"normalized": "14.17",
"type": "network"
},
{
"amount": "2.42",
"asset": "USD",
"normalized": "2.42",
"type": "deposit"
},
{
"amount": "1.00",
"asset": "USD",
"normalized": "1.00",
"type": "partner"
}
],
"refund": {
"asset": "USD",
"formattedAmount": "$ 100.00",
"rate": "1770.27534301775263314892",
},
"widget": {
"id": "998544f2-5b01-4062-9394-22827ff5db6c",
"name": "ACME",
"flow": "crypto_onramp"
}
}
}