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-AMOY'},
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-AMOY"
},
"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-AMOY"
},
"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-AMOY'},
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-AMOY'
],
'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-AMOY\"\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-AMOY\"\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-AMOY"
],
"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-AMOY\"\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-AMOY\"\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-AMOY"
}
},
"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"
}Create Quote (Offramp)
Create a quote for converting cryptocurrency to fiat currency
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-AMOY'},
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-AMOY"
},
"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-AMOY"
},
"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-AMOY'},
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-AMOY'
],
'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-AMOY\"\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-AMOY\"\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-AMOY"
],
"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-AMOY\"\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-AMOY\"\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-AMOY"
}
},
"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"
}đ§ The Ramp API is currently under construction. Endpoints and features described here are subject to change. Do not use in production until this notice is removed.
Create Quote (Off Ramp)
This endpoint creates a quote for converting a cryptocurrency (crypto-to-fiat) in an off-ramp scenario. The data generated includes calculated rates, fees, and applicable transaction limits.New to the Ramp API? Read How meCash Ramp Works for the full lifecycle, both transaction flows, and integration considerations. See Supported Ramp Assets & Destinations for supported fiat corridors and transaction limits.
Endpoint
POST{{baseURL}}/v1/ramp/quote
Header
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
x-api-key | YOUR_API_KEY | Yes |
Example Request Body
curl --location --request POST '{{baseURL}}/v1/ramp/quote' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"paymentChannel": "BANK_TRANSFER",
"source": {
"amount": 5000,
"symbol": "USDC",
"blockchain": "MATIC"
},
"target": {
"country": "NG",
"currency": "NGN"
}
}'
const quoteDetails = {
paymentChannel: 'BANK_TRANSFER',
source: {
amount: 5000,
symbol: 'USDC',
blockchain: 'MATIC'
},
target: {
country: 'NG',
currency: 'NGN'
}
};
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((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "{{baseURL}}/v1/ramp/quote"
payload = {
"paymentChannel": "BANK_TRANSFER",
"source": {
"amount": 5000,
"symbol": "USDC",
"blockchain": "MATIC"
},
"target": {
"country": "NG",
"currency": "NGN"
}
}
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers, timeout=30)
response.raise_for_status()
print(response.json())
const axios = require('axios');
const quoteDetails = {
paymentChannel: 'BANK_TRANSFER',
source: {
amount: 5000,
symbol: 'USDC',
blockchain: 'MATIC'
},
target: {
country: 'NG',
currency: 'NGN'
}
};
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));
Note: Gas fee level defaults to
MEDIUM.Success Response 200 OK
{
"message": "quote successfully created",
"status": "success",
"data": {
"id": "92da6ea0-79fe-4000-971d-xxxxxxxxxx",
"source": {
"currency": "USDC",
"symbol": "USDC",
"addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
"amount": 0.12,
"type": "CRYPTOCURRENCY",
"network": {
"id": "24d4025f-46fb-4021-b0c4-xxxxxxxxxx",
"name": "USDC",
"blockchain": "MATIC"
}
},
"target": {
"currency": "NGN",
"country": "NG",
"amount": 117.30,
"type": "FIAT"
},
"rate": 0.00102300,
"fees": {
"amount": 0.00
},
"rules": [
{
"category": "LIMIT",
"appliedCurrency": "NGN",
"appliedCountry": "NG",
"transaction": {
"minimum": 10.00,
"maximum": 2000000.00
},
"invoice": 2000000.00
}
],
"gasFee": {
"feeLevel": {
"type": "MEDIUM",
"fee": {
"name": "USDC",
"symbol": "USDC",
"amount": 0.02440458
}
}
},
"summary": {
"total": 0.12
}
}
}
Response Fields Breakdown
| Field | Type | Description |
|---|---|---|
message | string | Result message. |
status | string | Status of the request (e.g., success). |
data.id | string | Unique identifier for the created quote. |
Source Object
| Field | Type | Description |
|---|---|---|
data.source.currency | string | Name of the source currency (e.g., USDC). |
data.source.symbol | string | Symbol of the source currency (e.g., USDC). |
data.source.addressRegex | string | Regular expression to validate addresses. |
data.source.amount | number | Amount of the source asset. |
data.source.type | string | Type of the source asset (e.g., CRYPTOCURRENCY). |
data.source.network.id | string | Unique ID of the source network. |
data.source.network.name | string | Name of the source network (e.g., USDC). |
data.source.network.blockchain | string | Blockchain name (e.g., MATIC). |
Target Object
| Field | Type | Description |
|---|---|---|
data.target.currency | string | Target currency (e.g., NGN). |
data.target.country | string | Country code of the target (e.g., NG). |
data.target.amount | number | Amount in the target currency. |
data.target.type | string | Type of the target asset (FIAT or CRYPTOCURRENCY). |
Rate and Fees
| Field | Type | Description |
|---|---|---|
data.rate | number | Conversion rate from source to target. |
data.fees.amount | number | Fee amount applied to the transaction. |
Rules Array
| Field | Type | Description |
|---|---|---|
data.rules[].category | string | Rule category (e.g., LIMIT). |
data.rules[].appliedCurrency | string | Currency to which the rule is applied. |
data.rules[].appliedCountry | string | Country where the rule is applied. |
data.rules[].transaction.minimum | number | Minimum allowable transaction amount. |
data.rules[].transaction.maximum | number | Maximum allowable transaction amount. |
data.rules[].invoice | number | Invoice amount limit. |
Gas Fee Object
| Field | Type | Description |
|---|---|---|
data.gasFee.feeLevel.type | string | Selected gas fee level (e.g., MEDIUM). |
data.gasFee.feeLevel.fee.name | string | Name of the token used for gas fee (e.g., USDC). |
data.gasFee.feeLevel.fee.symbol | string | Symbol of the gas fee token. |
data.gasFee.feeLevel.fee.amount | number | Gas fee amount in the token. |
Summary
| Field | Type | Description |
|---|---|---|
data.summary.total | number | Total amount to be sent by the user. |
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?
âI

