DocsAPI Reference
Log In
Docs

Crypto Widget Object

Launching a Crypto Ramp Widget

You can request a widget session, which launches the selected service provider for your customer to interact with. To do so, see the create crypto widget endpoint. We return a fully formatted URL for you to route your customer to.

Before you launch a crypto widget, make sure you have whitelisted Meld's urls and IP addresses with the expected providers (Simplex, Banxa, Moonpay, and Xanpool).

Setup

Buying Crypto

Pictured below is a sample widget flow for purchasing crypto:

Moonpay On-Ramp Widget

Moonpay On-Ramp Widget

The typical purchase widget flow contains a quote screen, which allows the user to see and edit their quote, followed by a screen where the user can enter their payment information, followed by a payment submission screen, as shown above. After payment is complete, the cryptocurrency will be sent by the service provider to the user, and this completes the flow.

Selling Crypto

Pictured below is a sample widget flow for selling crypto:

Moonpay Off-Ramp Widget

Moonpay Off-Ramp Widget

The typical sell flow contains a quote screen, which allows the user to see and edit their quote, followed by a screen to connect their bank account, followed by a screen showing where to send the cryptocurrency to, as shown above. After the service provider receives the cryptocurrency, they inform the user that the bank transfer has been initiated, and this completes the flow.

If you subscribe to webhooks you will get alerts whenever any transaction status changes for all service providers. You may also poll our transaction status endpoint.

Information on how to test the crypto wizard can be found in the crypto testing guide.

Locking fields

Some service providers support locking the cryptocurrency and wallet address fields within their widgets. To do this, simply pass in the lockFields param to the widget endpoint with the values of destinationCurrencyCode/sourceCurrencyCode (depending on buy vs sell flow), walletAddress, or both. Here are the service providers that support locking those fields in their widgets:

Locking cryptocurrency


Locking wallet address


Banxa

Not supported
Not supported

BTC Direct

Supported
Supported

MoonPay

Supported
Always locked when passed in

Onramp Money

Not supported
Always locked when passed in

Ramp.Network

Supported
Not supported

Simplex

Supported
Supported

Transak

Supported
Supported

Sardine

Always locked
Always locked

Binance Connect

Always locked
Not supported

TransFi

Always locked when passed in
Always locked when passed in

Unlimit

Supported
Supported

Paybis

Not supported
Not supported

Fonbnk

Not supported
Supported

Koywe

Always locked when passed in
Always locked when passed in

Robinhood

Always locked when passed in
Always locked when passed in

Coinbase

Not supported
Not supported

Blockchain

Always locked when passed in
Always locked when passed in

Here's a sample buy request with both the cryptoCurrency and walletAddress fields locked:

{
    "sessionData": {
        "walletAddress": "2N3oefVeg6stiTb5Kh3ozCSkaqmx91FDbsm",
        "countryCode": "US",
        "sourceCurrencyCode": "USD",
        "sourceAmount": "70",
        "destinationCurrencyCode": "BTC",
        "serviceProvider": "MOONPAY",
        "lockFields": ["destinationCurrencyCode","walletAddress"]
    },
    "externalCustomerId": "test1",
    "externalSessionId": "test1"
}

NFT Checkout

Besides buying and selling crypto, Meld also support NFT Checkouts for some providers. This flow allows users to purchase NFTs using several different payment methods, including credit cards. See here for a list of providers for whom Meld supports the NFT Checkout flow.

See creating a crypto widget for more information on how to trigger the NFT checkout flow, as well as pass in params such as a description of the NFT.

Embedding the Widget

Meld supports embedding the crypto widget within an iframe. For information on the recommended iframe size, see Embedding the Wizard.