Wallet Balance
This endpoint returns current wallet balances for the given merchant PID. It requires HMAC signature verification and X-Api-Key.
Endpoint
POST {baseURL}/api/v2/wallet_balance.php
Content-Type: application/json; charset=utf-8Authorization
All API requests must include the X-Api-Key header. API Key verification is mandatory for every request and cannot be bypassed. Requests without a valid key will be rejected with 401 Unauthorized .
Request must be authenticated by including a signature parameter in the JSON body.
The logic for creating this signature is identical for all V2 endpoints. Please follow the detailed instructions on our central guide:
➡️ V2 API Signature Generation
Required Headers
Content-Type
Must be application/json; charset=utf-8
Yes
X-Api-Key
Must be included in every request
Yes
Request Body
pid
string
Merchant Partner ID
Yes
{
"pid": "your_merchant_pid",
"signature": "generated_hmac_signature"
}Response
Successful response contains user_balance (integers in smallest currency unit).
Success Response
{
"status": "success",
"message": "Balance fetched successfully",
"user_balance": {
"pid": "your_merchant_pid",
"payin_balance": 25000,
"payout_balance": 18500,
"payin_matured_balance": 22000
}
}
Response Fields
status
string
"success" or "error"
message
string
Description message
user_balance.pid
string
Merchant PID
user_balance.payin_balance
integer
Payin wallet (smallest unit)
user_balance.payout_balance
integer
Payout wallet (smallest unit)
user_balance.payin_matured_balance
integer
Payin withdrawable/matured wallet (smallest unit)
Error Responses
Common error responses and HTTP status codes.
400
pid not provided
Required 'pid' missing
400
signature not provided
Required 'signature ' missing
401
Invalid signature
Signature verification failed
400
Invalid PID
PID not found in system
403
IP not allowed: [IP]
IP not whitelisted
401
X-Api-Key header is required
Returned when the X-Api-Key passed in header is missing or invalid
401
Invalid API key
API key mismatch
429
Rate limit exceeded
Too many requests (rate-limited)
Examples
Quick example requests to test the API.
curl -X POST "{baseURL}/api/v2/wallet_balance.php" \
-H "Content-Type: application/json; charset=utf-8" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"pid":"your_pid","signature":"generated_signature"}'
<?php
$payload = ['pid' => 'your_pid', 'signature' => 'generated_signature'];
$ch = curl_init('{baseURL}/api/v2/wallet_balance.php');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json; charset=utf-8', 'X-Api-Key: YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
echo $res;
?>Last updated