Skip to main content
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));
{
  "status": "success",
  "message": "wallet balance fetched successfully",
  "data": {
    "balance": "9.68262075",
    "symbol": "USDC",
    "blockchain": "MATIC-AMOY"
  }
}
This endpoint retrieves the token balances (including available and pending balances) for a specific cryptocurrency wallet.

Endpoint

GET {{baseURL}}/v1/ramp/wallet/{{walletId}}/balance

Headers

HeaderValueRequiredDescription
Content-Typeapplication/jsonYesSpecifies that the request body is JSON.
x-api-keyYOUR_API_KEYYesAPI key for authentication.

Path Parameters

ParameterTypeRequiredDescription
walletIdstringYesUnique 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'

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

FieldTypeDescription
messagestringStatus message of the request.
statusstringStatus of the request ("success" or "error").
dataobjectObject containing the token balances array.
data.tokenarrayList of cryptocurrency token details and balances.
data.token[].idstringUnique identifier of the token in the database.
data.token[].namestringThe name of the token (e.g., "USDC", "Polygon").
data.token[].symbolstringThe symbol of the token (e.g., "USDC", "POL").
data.token[].addressstringThe token smart contract address.
data.token[].decimalsnumberDecimal places used by the token.
data.token[].balancenumberAvailable balance of the token in the wallet.
data.token[].pendingBalancenumberPending/unconfirmed balance of the token.
data.token[].blockChainstringBlockchain network (e.g., "MATIC-AMOY", "ETH").

Error Responses

HTTP StatusError CodeMessageDescription
401UNAUTHORIZEDMissing or invalid API keyThe x-api-key header is missing or incorrect.
404NOT_FOUNDWallet not foundThe specified wallet ID does not exist.
500SERVER_ERRORInternal server errorAn unexpected error occurred on the server.

Authorizations

x-api-key
string
header
required

Path Parameters

walletId
string<uuid>
required

The unique identifier of the wallet to fetch balance for.

Response

Wallet balance retrieved successfully.

status
string
Example:

"success"

message
string
Example:

"wallet balance fetched successfully"

data
object