Create Quote
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentChannel: 'BANK_TRANSFER',
source: {amount: 5, symbol: 'USDC', blockchain: 'MATIC'},
target: {country: 'NG', currency: 'NGN'}
})
};
fetch('https://sandboxapi.me-cash.com/v1/ramp/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://sandboxapi.me-cash.com/v1/ramp/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"paymentChannel": "BANK_TRANSFER",
"source": {
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC"
},
"target": {
"country": "NG",
"currency": "NGN"
}
}
'import requests
url = "https://sandboxapi.me-cash.com/v1/ramp/quote"
payload = {
"paymentChannel": "BANK_TRANSFER",
"source": {
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC"
},
"target": {
"country": "NG",
"currency": "NGN"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://sandboxapi.me-cash.com/v1/ramp/quote';
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentChannel: 'BANK_TRANSFER',
source: {amount: 5, symbol: 'USDC', blockchain: 'MATIC'},
target: {country: 'NG', currency: 'NGN'}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.me-cash.com/v1/ramp/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([
'paymentChannel' => 'BANK_TRANSFER',
'source' => [
'amount' => 5,
'symbol' => 'USDC',
'blockchain' => 'MATIC'
],
'target' => [
'country' => 'NG',
'currency' => 'NGN'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://sandboxapi.me-cash.com/v1/ramp/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paymentChannel\": \"BANK_TRANSFER\",\n \"source\": {\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\"\n },\n \"target\": {\n \"country\": \"NG\",\n \"currency\": \"NGN\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.me-cash.com/v1/ramp/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentChannel\": \"BANK_TRANSFER\",\n \"source\": {\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\"\n },\n \"target\": {\n \"country\": \"NG\",\n \"currency\": \"NGN\"\n }\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"paymentChannel": "BANK_TRANSFER",
"source": [
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC"
],
"target": [
"country": "NG",
"currency": "NGN"
]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://sandboxapi.me-cash.com/v1/ramp/quote")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"paymentChannel\": \"BANK_TRANSFER\",\n \"source\": {\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\"\n },\n \"target\": {\n \"country\": \"NG\",\n \"currency\": \"NGN\"\n }\n}")
val request = Request.Builder()
.url("https://sandboxapi.me-cash.com/v1/ramp/quote")
.post(body)
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.me-cash.com/v1/ramp/quote"
payload := strings.NewReader("{\n \"paymentChannel\": \"BANK_TRANSFER\",\n \"source\": {\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\"\n },\n \"target\": {\n \"country\": \"NG\",\n \"currency\": \"NGN\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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))
}{
"status": "success",
"message": "quote generated successfully",
"data": {
"id": "3f41daaa-029c-44a2-b7c6-ed922a68177b",
"source": {
"currency": "USDC",
"symbol": "USDC",
"type": "CRYPTOCURRENCY",
"amount": 5,
"network": {
"id": "f8fc48ff-81e6-4b5f-9a70-44fb744e3572",
"name": "USDC",
"blockchain": "MATIC"
}
},
"target": {
"currency": "NGN",
"country": "NG",
"type": "FIAT",
"paymentChannel": "BANK_TRANSFER",
"amount": 5537.1
},
"rate": 1107.42,
"fees": [
{
"amount": 0.025,
"gas": {
"type": "MEDIUM",
"total": 0.29237925
}
}
],
"summary": {
"total": 5.31737925
},
"expiresInSeconds": 600
}
}{
"message": "Invalid API key",
"status": "failed"
}{
"message": "Server failed to process request.",
"status": "failed"
}Ramp
Create Quote (Crypto)
Generate a quote for converting one cryptocurrency to another
POST
/
v1
/
ramp
/
quote
Create Quote
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentChannel: 'BANK_TRANSFER',
source: {amount: 5, symbol: 'USDC', blockchain: 'MATIC'},
target: {country: 'NG', currency: 'NGN'}
})
};
fetch('https://sandboxapi.me-cash.com/v1/ramp/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://sandboxapi.me-cash.com/v1/ramp/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"paymentChannel": "BANK_TRANSFER",
"source": {
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC"
},
"target": {
"country": "NG",
"currency": "NGN"
}
}
'import requests
url = "https://sandboxapi.me-cash.com/v1/ramp/quote"
payload = {
"paymentChannel": "BANK_TRANSFER",
"source": {
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC"
},
"target": {
"country": "NG",
"currency": "NGN"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://sandboxapi.me-cash.com/v1/ramp/quote';
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentChannel: 'BANK_TRANSFER',
source: {amount: 5, symbol: 'USDC', blockchain: 'MATIC'},
target: {country: 'NG', currency: 'NGN'}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.me-cash.com/v1/ramp/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([
'paymentChannel' => 'BANK_TRANSFER',
'source' => [
'amount' => 5,
'symbol' => 'USDC',
'blockchain' => 'MATIC'
],
'target' => [
'country' => 'NG',
'currency' => 'NGN'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://sandboxapi.me-cash.com/v1/ramp/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paymentChannel\": \"BANK_TRANSFER\",\n \"source\": {\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\"\n },\n \"target\": {\n \"country\": \"NG\",\n \"currency\": \"NGN\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.me-cash.com/v1/ramp/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentChannel\": \"BANK_TRANSFER\",\n \"source\": {\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\"\n },\n \"target\": {\n \"country\": \"NG\",\n \"currency\": \"NGN\"\n }\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"paymentChannel": "BANK_TRANSFER",
"source": [
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC"
],
"target": [
"country": "NG",
"currency": "NGN"
]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://sandboxapi.me-cash.com/v1/ramp/quote")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"paymentChannel\": \"BANK_TRANSFER\",\n \"source\": {\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\"\n },\n \"target\": {\n \"country\": \"NG\",\n \"currency\": \"NGN\"\n }\n}")
val request = Request.Builder()
.url("https://sandboxapi.me-cash.com/v1/ramp/quote")
.post(body)
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.me-cash.com/v1/ramp/quote"
payload := strings.NewReader("{\n \"paymentChannel\": \"BANK_TRANSFER\",\n \"source\": {\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\"\n },\n \"target\": {\n \"country\": \"NG\",\n \"currency\": \"NGN\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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))
}{
"status": "success",
"message": "quote generated successfully",
"data": {
"id": "3f41daaa-029c-44a2-b7c6-ed922a68177b",
"source": {
"currency": "USDC",
"symbol": "USDC",
"type": "CRYPTOCURRENCY",
"amount": 5,
"network": {
"id": "f8fc48ff-81e6-4b5f-9a70-44fb744e3572",
"name": "USDC",
"blockchain": "MATIC"
}
},
"target": {
"currency": "NGN",
"country": "NG",
"type": "FIAT",
"paymentChannel": "BANK_TRANSFER",
"amount": 5537.1
},
"rate": 1107.42,
"fees": [
{
"amount": 0.025,
"gas": {
"type": "MEDIUM",
"total": 0.29237925
}
}
],
"summary": {
"total": 5.31737925
},
"expiresInSeconds": 600
}
}{
"message": "Invalid API key",
"status": "failed"
}{
"message": "Server failed to process request.",
"status": "failed"
}New to the Ramp API? Read How meCash Ramp Works for the full lifecycle, both transaction flows, and integration considerations. See Supported Assets & Destinations for the complete token and network reference.
Endpoint
POST {{baseURL}}/v1/ramp/quote
Headers
| Header | Value | Required | Description |
|---|---|---|---|
Content-Type | application/json | Yes | Specifies that the request body is JSON. |
x-api-key | YOUR_API_KEY | Yes | API key for authentication. |
Request Example
curl --location '{{baseURL}}/v1/ramp/quote' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"source": {
"amount": 5000,
"symbol": "POL",
"blockchain": "MATIC"
},
"target": {
"symbol": "POL",
"blockchain": "MATIC"
},
"feeLevel": {
"type": "MEDIUM"
},
"recipient": {
"address": "0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx"
}
}'
const quoteDetails = {
source: {
amount: 5000,
symbol: "POL",
blockchain: "MATIC"
},
target: {
symbol: "POL",
blockchain: "MATIC"
},
feeLevel: {
type: "MEDIUM"
},
recipient: {
address: "0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx"
}
};
fetch('{{baseURL}}/v1/ramp/quote', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify(quoteDetails)
})
.then(res => res.json())
.then(console.log)
.catch(console.error);
import requests
url = "{{baseURL}}/v1/ramp/quote"
payload = {
"source": {
"amount": 5000,
"symbol": "POL",
"blockchain": "MATIC"
},
"target": {
"symbol": "POL",
"blockchain": "MATIC"
},
"feeLevel": {
"type": "MEDIUM"
},
"recipient": {
"address": "0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx"
}
}
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const axios = require('axios');
const quoteDetails = {
source: {
amount: 5000,
symbol: 'POL',
blockchain: 'MATIC'
},
target: {
symbol: 'POL',
blockchain: 'MATIC'
},
feeLevel: {
type: 'MEDIUM'
},
recipient: {
address: '0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx'
}
};
axios.post('{{baseURL}}/v1/ramp/quote', quoteDetails, {
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error(error.response?.data ?? error.message);
});
Request Breakdown
| Field | Type | Description |
|---|---|---|
source.amount | number | Amount of the source cryptocurrency to convert |
source.symbol | string | Symbol of the source cryptocurrency (e.g., "POL") |
source.blockchain | string | Blockchain network of the source cryptocurrency (e.g., "MATIC") |
target.symbol | string | Symbol of the target cryptocurrency |
target.blockchain | string | Blockchain network of the target cryptocurrency |
feeLevel.type | string | Transaction fee level ("LOW", "MEDIUM", "HIGH") |
recipient.address | string | Wallet address of the recipient where the crypto will be sent |
Success Response 200 OK
{
"message": "quote successfully created",
"status": "success",
"data": {
"id": "92da6ea0-79fe-4000-971d-xxxxxxxxxxxxx",
"source": {
"currency": "Polygon",
"symbol": "POL",
"addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
"amount": 0.12,
"blockchain": "MATIC",
"type": "CRYPTOCURRENCY"
},
"target": {
"currency": "Polygon",
"symbol": "POL",
"addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
"amount": 0.12,
"blockchain": "MATIC",
"type": "CRYPTOCURRENCY"
},
"rate": 0.00102300,
"fees": {
"symbol": "POL",
"amount": 0.00,
"gas": {
"type": "MEDIUM",
"amount": 0.01909123
}
},
"rules": [
{
"category": "LIMIT",
"appliedCurrency": "USDC",
"transaction": {
"minimum": 10.00,
"maximum": 2000000.00
},
"invoice": 2000000.00
}
],
"summary": {
"total": 0.12
}
}
}
Response Breakdown
| Field | Type | Description |
|---|---|---|
message | string | Status message (e.g., "quote successfully created") |
status | string | Status of the request (e.g., "success") |
data.id | string | Unique identifier of the created quote |
data.source | object | Details of the source cryptocurrency |
data.source.currency | string | Name of the source currency (e.g., "Polygon") |
data.source.symbol | string | Symbol of the source cryptocurrency (e.g., "POL") |
data.source.addressRegex | string | Regular expression pattern for validating crypto addresses |
data.source.amount | number | Amount of source cryptocurrency converted |
data.source.blockchain | string | Blockchain network (e.g., "MATIC") |
data.source.type | string | Type of the asset ("CRYPTOCURRENCY") |
data.target | object | Details of the target cryptocurrency |
data.target.currency | string | Name of the target currency (e.g., "Polygon") |
data.target.symbol | string | Symbol of the target cryptocurrency (e.g., "POL") |
data.target.addressRegex | string | Regular expression pattern for validating target crypto addresses |
data.target.amount | number | Amount of target cryptocurrency received |
data.target.blockchain | string | Blockchain network of the target currency |
data.target.type | string | Type of the asset ("CRYPTOCURRENCY") |
data.rate | number | Exchange rate between the source and target currency |
data.fees | object | Fee breakdown for the transaction |
data.fees.symbol | string | Currency symbol for fees |
data.fees.amount | number | Fee amount charged |
data.fees.gas | object | Gas fee details |
data.fees.gas.type | string | Gas fee level ("MEDIUM") |
data.fees.gas.amount | number | Gas fee amount |
data.rules | array | Rules that apply to this transaction |
data.rules[].category | string | Rule category (e.g., "LIMIT") |
data.rules[].appliedCurrency | string | Currency to which the rule applies (e.g., "USDC") |
data.rules[].transaction | object | Transaction limits |
data.rules[].transaction.minimum | number | Minimum amount allowed for the transaction |
data.rules[].transaction.maximum | number | Maximum amount allowed for the transaction |
data.rules[].invoice | number | Maximum invoice amount |
data.summary | object | Summary of the transaction |
data.summary.total | number | Total amount of the source currency involved in the transaction |
Error Responses
| HTTP Status | Error Code | Message | Description |
|---|---|---|---|
| 400 | INVALID_INPUT | Invalid request payload | One or more fields are missing or have invalid values. |
| 401 | UNAUTHORIZED | Missing or invalid API key | The x-api-key header is missing or incorrect. |
| 403 | FORBIDDEN | Access denied | The authenticated user is not allowed to create quotes. |
| 404 | NOT_FOUND | Resource not found | The requested network or currency does not exist. |
| 500 | SERVER_ERROR | Internal server error | An unexpected error occurred on the server. |
Authorizations
Body
application/json
Was this page helpful?

