> ## Documentation Index
> Fetch the complete documentation index at: https://developer.me-cash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Wallet Balance

> Get the current balance of a specific cryptocurrency wallet.

<Warning>
  🚧 **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.
</Warning>

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

| **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

<CodeGroup>
  ```bash cURL theme={null}
  # 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'
  ```

  ```js JavaScript (fetch) theme={null}
  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);
  ```

  ```python Python (requests) theme={null}
  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())
  ```

  ```js Node.js (axios) theme={null}
  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);
    });
  ```
</CodeGroup>

***

## Success Response 200 OK

```json theme={null}
{
    "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.     |


## OpenAPI

````yaml get /v1/ramp/wallet/{walletId}/balance
openapi: 3.0.3
info:
  title: meCash API
  version: 3.0.3
  description: >-
    API for meCash services, including FIAT and Ramp operations. This is the
    OpenAPI specification for the meCash API, covering all available endpoints
    for wallet management, currency quotes, and payouts.


    It follows a design-first approach based on OpenAPI 3.0.


    Authentication is handled via an API key passed in the `x-api-key` header.
    Replace `YOUR_API_KEY` with your actual key when making requests.


    Some useful links:

    - [meCash Documentation](https://docs.me-cash.com/)

    - [Authentication Guide](https://docs.me-cash.com/authentication)
servers:
  - url: https://sandboxapi.me-cash.com
    description: Sandbox Server for Testing
security:
  - ApiKeyAuth: []
tags:
  - name: Wallet
    description: Wallet management operations
  - name: Quote
    description: Currency quote operations
  - name: Payout
    description: Payout operations
  - name: Transaction
    description: Transaction management
  - name: Virtual Account
    description: Virtual account operations for static and dynamic accounts
  - name: Bank
    description: Bank account and list operations
  - name: Ramp
    description: Ramp operations for crypto
  - name: Miscellaneous
    description: Utility and miscellaneous operations
  - name: Collection
    description: Mobile money and wallet funding operations
  - name: Bulk Payout
    description: >-
      Bulk transfer operations for sending to multiple beneficiaries in a single
      request
paths:
  /v1/ramp/wallet/{walletId}/balance:
    get:
      tags:
        - Ramp
      summary: Get Wallet Balance
      description: Get the current balance of a specific cryptocurrency wallet.
      operationId: getRampWalletBalance
      parameters:
        - name: walletId
          in: path
          required: true
          description: The unique identifier of the wallet to fetch balance for.
          schema:
            type: string
            format: uuid
          example: bb438dfd-535f-4d5c-a9a7-cceb0988d4b3
      responses:
        '200':
          description: Wallet balance retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                    example: wallet balance fetched successfully
                  data:
                    type: object
                    properties:
                      balance:
                        type: string
                        example: '9.68262075'
                      symbol:
                        type: string
                        example: USDC
                      blockchain:
                        type: string
                        example: MATIC-AMOY
        '401':
          $ref: '#/components/responses/PayoutUnauthorized'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/PayoutInternalServerError'
components:
  responses:
    PayoutUnauthorized:
      description: Unauthorized. The provided API key is invalid or missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PayoutFailedResponse'
          example:
            message: Invalid API key
            status: failed
    NotFoundError:
      description: >-
        Not Found. The requested resource, like a specific wallet, could not be
        found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Invalid Wallet Address
    PayoutInternalServerError:
      description: Internal Server Error. The server failed to process the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PayoutFailedResponse'
          example:
            message: Server failed to process request.
            status: failed
  schemas:
    PayoutFailedResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message.
        status:
          type: string
          example: failed
      required:
        - message
        - status
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          description: A human-readable error message.
        data:
          nullable: true
          description: Optional data payload, often null in case of an error.
          example: null
      required:
        - status
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````