Get Wallet Balance
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance \
--header 'x-api-key: <api-key>'import requests
url = "https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const url = 'https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance';
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
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/wallet/{walletId}/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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.get("https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyimport Foundation
let url = URL(string: "https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["x-api-key": "<api-key>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val request = Request.Builder()
.url("https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance")
.get()
.addHeader("x-api-key", "<api-key>")
.build()
val response = client.newCall(request).execute()falsepackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"message": "wallet balance fetched successfully",
"data": {
"balance": "9.68262075",
"symbol": "USDC",
"blockchain": "MATIC-AMOY"
}
}{
"message": "Invalid API key",
"status": "failed"
}{
"status": "error",
"message": "Invalid Wallet Address"
}{
"message": "Server failed to process request.",
"status": "failed"
}Get Wallet Balance
Get the current balance of a specific cryptocurrency wallet.
GET
/
v1
/
ramp
/
wallet
/
{walletId}
/
balance
Get Wallet Balance
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance \
--header 'x-api-key: <api-key>'import requests
url = "https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const url = 'https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance';
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
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/wallet/{walletId}/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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.get("https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyimport Foundation
let url = URL(string: "https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["x-api-key": "<api-key>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val request = Request.Builder()
.url("https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance")
.get()
.addHeader("x-api-key", "<api-key>")
.build()
val response = client.newCall(request).execute()falsepackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.me-cash.com/v1/ramp/wallet/{walletId}/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"message": "wallet balance fetched successfully",
"data": {
"balance": "9.68262075",
"symbol": "USDC",
"blockchain": "MATIC-AMOY"
}
}{
"message": "Invalid API key",
"status": "failed"
}{
"status": "error",
"message": "Invalid Wallet Address"
}{
"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.
Endpoint
GET {{baseURL}}/v1/ramp/wallet/{{walletId}}/balance
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. |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
walletId | string | Yes | Unique identifier of the wallet. |
Request Example
# Replace YOUR_WALLET_ID with the actual wallet ID
curl --location '{{baseURL}}/v1/ramp/wallet/YOUR_WALLET_ID/balance' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json'
const walletId = 'YOUR_WALLET_ID';
fetch(`{{baseURL}}/v1/ramp/wallet/${walletId}/balance`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
})
.then(res => res.json())
.then(console.log)
.catch(console.error);
import requests
wallet_id = "YOUR_WALLET_ID"
url = f"{{baseURL}}/v1/ramp/wallet/{wallet_id}/balance"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
const axios = require('axios');
const walletId = 'YOUR_WALLET_ID';
axios.get(`{{baseURL}}/v1/ramp/wallet/${walletId}/balance`, {
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);
});
Success Response 200 OK
{
"message": "fetch wallet balance successfully",
"status": "success",
"data": {
"token": [
{
"id": "f761603e-e2af-4abf-b669-6fa709413a66",
"name": "USDC",
"symbol": "USDC",
"address": "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",
"decimals": 6,
"balance": 115,
"pendingBalance": 112.5113391,
"blockChain": "MATIC-AMOY"
}
]
}
}
Response Breakdown
| Field | Type | Description |
|---|---|---|
message | string | Status message of the request. |
status | string | Status of the request ("success" or "error"). |
data | object | Object containing the token balances array. |
data.token | array | List of cryptocurrency token details and balances. |
data.token[].id | string | Unique identifier of the token in the database. |
data.token[].name | string | The name of the token (e.g., "USDC", "Polygon"). |
data.token[].symbol | string | The symbol of the token (e.g., "USDC", "POL"). |
data.token[].address | string | The token smart contract address. |
data.token[].decimals | number | Decimal places used by the token. |
data.token[].balance | number | Available balance of the token in the wallet. |
data.token[].pendingBalance | number | Pending/unconfirmed balance of the token. |
data.token[].blockChain | string | Blockchain network (e.g., "MATIC-AMOY", "ETH"). |
Error Responses
| HTTP Status | Error Code | Message | Description |
|---|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key | The x-api-key header is missing or incorrect. |
| 404 | NOT_FOUND | Wallet not found | The specified wallet ID does not exist. |
| 500 | SERVER_ERROR | Internal server error | An unexpected error occurred on the server. |
Authorizations
Path Parameters
The unique identifier of the wallet to fetch balance for.
Was this page helpful?
⌘I

