curl --request GET \
--url https://hpay-api.host-sl.com/api/v1/wallets/user_123/ \
--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")
wallet = client.wallets.get("user_123")
print(wallet["balance"], wallet["currency"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const wallet = await client.wallets.get("user_123");
console.log(wallet.balance, wallet.currency);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/wallets/user_123/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
{
"id": "wall_123",
"user_id": "user_123",
"balance": 150.50,
"currency": "SLE",
"is_active": true
}
{
"detail": "Invalid application credentials"
}
{
"detail": "Wallet not found for this user"
}
Wallets
Get Wallet
Retrieve the wallet details for a specific user
GET
/
api
/
v1
/
wallets
/
{user_id}
/
curl --request GET \
--url https://hpay-api.host-sl.com/api/v1/wallets/user_123/ \
--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")
wallet = client.wallets.get("user_123")
print(wallet["balance"], wallet["currency"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const wallet = await client.wallets.get("user_123");
console.log(wallet.balance, wallet.currency);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/wallets/user_123/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
{
"id": "wall_123",
"user_id": "user_123",
"balance": 150.50,
"currency": "SLE",
"is_active": true
}
{
"detail": "Invalid application credentials"
}
{
"detail": "Wallet not found for this user"
}
Endpoint
GET /api/v1/wallets/{user_id}/
Path Parameters
string
required
The unique identifier of the user whose wallet to retrieve.
Headers
string
required
Your application API key
string
required
Your application secret key
Response
string
The unique identifier of the wallet.
string
The ID of the user who owns the wallet.
number
The current balance of the wallet.
string
The currency of the wallet balance.
boolean
Whether the wallet is currently active.
curl --request GET \
--url https://hpay-api.host-sl.com/api/v1/wallets/user_123/ \
--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")
wallet = client.wallets.get("user_123")
print(wallet["balance"], wallet["currency"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const wallet = await client.wallets.get("user_123");
console.log(wallet.balance, wallet.currency);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/wallets/user_123/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
{
"id": "wall_123",
"user_id": "user_123",
"balance": 150.50,
"currency": "SLE",
"is_active": true
}
{
"detail": "Invalid application credentials"
}
{
"detail": "Wallet not found for this user"
}