curl --request GET \
--url https://hpay-api.host-sl.com/api/v1/wallets/wall_123/balance \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
balance = client.wallets.balance("wall_123")
print(balance["balance"], balance["currency"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const balance = await client.wallets.balance("wall_123");
console.log(balance.balance, balance.currency);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/wallets/wall_123/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
{
"wallet_id": "wall_123",
"balance": 150.50,
"currency": "SLE"
}
{
"detail": "Invalid application credentials"
}
{
"detail": "Wallet not found"
}
Wallets
Get Wallet Balance
Retrieve the current balance of a specific wallet
GET
/
api
/
v1
/
wallets
/
{wallet_id}
/
balance
curl --request GET \
--url https://hpay-api.host-sl.com/api/v1/wallets/wall_123/balance \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
balance = client.wallets.balance("wall_123")
print(balance["balance"], balance["currency"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const balance = await client.wallets.balance("wall_123");
console.log(balance.balance, balance.currency);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/wallets/wall_123/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
{
"wallet_id": "wall_123",
"balance": 150.50,
"currency": "SLE"
}
{
"detail": "Invalid application credentials"
}
{
"detail": "Wallet not found"
}
Endpoint
GET /api/v1/wallets/{wallet_id}/balance
Path Parameters
string
required
The unique identifier of the wallet to get the balance for.
Headers
string
required
Your application API key
string
required
Your application secret key
Response
string
The unique identifier of the wallet.
number
The current balance of the wallet.
string
The currency of the wallet balance.
curl --request GET \
--url https://hpay-api.host-sl.com/api/v1/wallets/wall_123/balance \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
balance = client.wallets.balance("wall_123")
print(balance["balance"], balance["currency"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const balance = await client.wallets.balance("wall_123");
console.log(balance.balance, balance.currency);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/wallets/wall_123/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
{
"wallet_id": "wall_123",
"balance": 150.50,
"currency": "SLE"
}
{
"detail": "Invalid application credentials"
}
{
"detail": "Wallet not found"
}