Skip to content

Wallet Balance

This endpoint is used to fetch the wallet balance in real time.

Endpoint

GET https://api.lipila.dev/api/v1/merchants/balance

Headers

The following headers are accepted.

HeaderTypeDescriptionRequired
acceptapplication/jsonExpected response formatYes
x-api-keystringWallet API authentication keyYes

Example Request

bash
curl -X 'GET' \
  'https://api.lipila.dev/api/v1/merchants/balance' \
  -H 'accept: application/json' \
  -H 'x-api-key: your_secret_key'
python
import requests

url = "https://api.lipila.dev/api/v1/merchants/balance"

headers = {
    "accept": "application/json",
    "x-api-key": "your_secret_key"
}

response = requests.get(url, headers=headers)
print(response.json())
csharp
using System.Net.Http;

var client = new HttpClient();

client.DefaultRequestHeaders.Add("accept", "application/json");
client.DefaultRequestHeaders.Add("x-api-key", "your_secret_key");

var response = await client.GetAsync(
    "https://api.lipila.dev/api/v1/merchants/balance"
);

Console.WriteLine(await response.Content.ReadAsStringAsync());
javascript
const response = await fetch("https://api.lipila.dev/api/v1/merchants/balance", {
  method: "GET",
  headers: {
    "accept": "application/json",
    "x-api-key": "your_secret_key"
  }
});

const data = await response.json();
console.log(data);
php
<?php

$url = "https://api.lipila.dev/api/v1/merchants/balance";

$headers = [
    "accept: application/json",
    "x-api-key: your_secret_key"
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;

Example Successful Response

Below is an example successful response.

js

{
  "success": true,
  "message": "Wallet balance retrieved successfully.",
  "data": {
    "balance": 80.771
  }
}
HTTP Status CodeError CodeDescription
200SUCCESSFULRequest successful
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENAPI key is inactive or revoked
429TOO MANY REQUESTSRate limit exceeded, slow down requests

Released under the MIT License.