curl --request POST \
--url https://api-sb.meld.io/payments/crypto/quote \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"countryCode": "US",
"destinationCurrencyCode": "BTC",
"sourceAmount": 100,
"sourceCurrencyCode": "USD"
}
'import requests
url = "https://api-sb.meld.io/payments/crypto/quote"
payload = {
"countryCode": "US",
"destinationCurrencyCode": "BTC",
"sourceAmount": 100,
"sourceCurrencyCode": "USD"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
countryCode: 'US',
destinationCurrencyCode: 'BTC',
sourceAmount: 100,
sourceCurrencyCode: 'USD'
})
};
fetch('https://api-sb.meld.io/payments/crypto/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sb.meld.io/payments/crypto/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'countryCode' => 'US',
'destinationCurrencyCode' => 'BTC',
'sourceAmount' => 100,
'sourceCurrencyCode' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sb.meld.io/payments/crypto/quote"
payload := strings.NewReader("{\n \"countryCode\": \"US\",\n \"destinationCurrencyCode\": \"BTC\",\n \"sourceAmount\": 100,\n \"sourceCurrencyCode\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sb.meld.io/payments/crypto/quote")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"countryCode\": \"US\",\n \"destinationCurrencyCode\": \"BTC\",\n \"sourceAmount\": 100,\n \"sourceCurrencyCode\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sb.meld.io/payments/crypto/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"countryCode\": \"US\",\n \"destinationCurrencyCode\": \"BTC\",\n \"sourceAmount\": 100,\n \"sourceCurrencyCode\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"quotes": [
{
"countryCode": "<string>",
"destinationAmount": 123,
"destinationAmountWithoutFees": 123,
"destinationCurrencyCode": "<string>",
"exchangeRate": 123,
"fiatAmountWithoutFees": 123,
"isNativeAvailable": false,
"networkFee": 123,
"partnerFee": 123,
"paymentMethodType": "APPLE_PAY",
"rampIntelligence": {
"lowKyc": false,
"previouslyUsed": "2023-11-07T05:31:56Z",
"rampScore": 123
},
"serviceProvider": "ALCHEMYPAY",
"sourceAmount": 123,
"sourceAmountWithoutFees": 123,
"sourceCurrencyCode": "<string>",
"totalFee": 123,
"transactionFee": 123,
"transactionType": "<string>"
}
]
}Create a crypto quote
Use this endpoint to request the current exchange rate of the selected fiat currency-cryptocurrency pair, and the required fees. Enter a fiat currency as the sourceCurrencyCode to buy crypto and enter a crypto currency in that field to sell crypto.
curl --request POST \
--url https://api-sb.meld.io/payments/crypto/quote \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"countryCode": "US",
"destinationCurrencyCode": "BTC",
"sourceAmount": 100,
"sourceCurrencyCode": "USD"
}
'import requests
url = "https://api-sb.meld.io/payments/crypto/quote"
payload = {
"countryCode": "US",
"destinationCurrencyCode": "BTC",
"sourceAmount": 100,
"sourceCurrencyCode": "USD"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
countryCode: 'US',
destinationCurrencyCode: 'BTC',
sourceAmount: 100,
sourceCurrencyCode: 'USD'
})
};
fetch('https://api-sb.meld.io/payments/crypto/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sb.meld.io/payments/crypto/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'countryCode' => 'US',
'destinationCurrencyCode' => 'BTC',
'sourceAmount' => 100,
'sourceCurrencyCode' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sb.meld.io/payments/crypto/quote"
payload := strings.NewReader("{\n \"countryCode\": \"US\",\n \"destinationCurrencyCode\": \"BTC\",\n \"sourceAmount\": 100,\n \"sourceCurrencyCode\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sb.meld.io/payments/crypto/quote")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"countryCode\": \"US\",\n \"destinationCurrencyCode\": \"BTC\",\n \"sourceAmount\": 100,\n \"sourceCurrencyCode\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sb.meld.io/payments/crypto/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"countryCode\": \"US\",\n \"destinationCurrencyCode\": \"BTC\",\n \"sourceAmount\": 100,\n \"sourceCurrencyCode\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"quotes": [
{
"countryCode": "<string>",
"destinationAmount": 123,
"destinationAmountWithoutFees": 123,
"destinationCurrencyCode": "<string>",
"exchangeRate": 123,
"fiatAmountWithoutFees": 123,
"isNativeAvailable": false,
"networkFee": 123,
"partnerFee": 123,
"paymentMethodType": "APPLE_PAY",
"rampIntelligence": {
"lowKyc": false,
"previouslyUsed": "2023-11-07T05:31:56Z",
"rampScore": 123
},
"serviceProvider": "ALCHEMYPAY",
"sourceAmount": 123,
"sourceAmountWithoutFees": 123,
"sourceCurrencyCode": "<string>",
"totalFee": 123,
"transactionFee": 123,
"transactionType": "<string>"
}
]
}Headers
Query Parameters
If true, include both direct ramp/offramp quotes and stitched ramp+swap/offramp+swap quotes (CRYPTO_PURCHASE_SWAP / CRYPTO_SELL_SWAP) in the response. When false, swap is only used as a fallback when no direct ramp or offramp providers return quotes. Swap quotes are gated by the per-account onrampSwapEnabled / offrampSwapEnabled preferences regardless of this flag.
Body
Payment Method Type or SubType
The paymentMethodType and paymentMethodSubType included here are a sample set. Review the Supported Payment Methods section to view the complete list.
An optional list of Strings representing the Service Providers for this Quote.
Reference Crypto supported service providers for a full list of supported service providers
If this field is null or an empty list, Meld will get quotes from all the service providers linked to the API key used on the request.
ACROSS, AEROPAY, AKOYA, ALCHEMYPAY, APPLEPAY, AUTHORIZENET, BANXA, BILIRA, BINANCECONNECT, BINANCEPAY, BLOCKCHAINDOTCOM, BOOMFI, BRAINTREE, BRALE, BTCDIRECT, CASHAPP, CHECKOUT, CIRCLE, COINBASEPAY, COINFLOW, DUENETWORK, ELDORADO, FINICITY, FLASHNET, FONBNK, GUARDARIAN, HARBOUR, KOYWE, KRYPTONIM, MERCURYO, MESH, MESO, MOONPAY, MOOV, MX, NMI, NOAH, ONMETA, ONRAMPMONEY, PAYBIS, PAYPAL, PLAID, RAMP, REVOLUT, ROBINHOOD, ROUTERPROTOCOL, SALTEDGE, SALTEDGEPARTNERS, SARDINE, SHIFT4, SHOPIFY, SIMPLEX, SKRILLCRYPTO, SQUARE, STRIPE, SUMSUB, SWAPPED, TANGOCARD, TELLER, TOPPER, TRANSAK, TREMENDOUS, TRANSFI, UNLIMIT, UPHOLD, WYRE, XANPOOL, YELLOWCARD, YODLEE