Wallet Data Endpoint
Overview
This API endpoint retrieves cumulative wallet data for an operator, including both active and inactive wallet accounts across multiple wallet types. The endpoint requires authentication via an API key passed in the request headers.
Endpoint Details
URL: (adjust based on your server configuration)
Method:
GETContent-Type:
application/jsonAuthentication: API key required in the
Api-Keyheader
Authentication
Header: Api-Key
Value: A valid API key associated with an operator in the system.
Description: The API key is verified against the operator table in the database. Only operators with delete_status = 0 are considered valid.
If the API key is missing or invalid, the endpoint returns a 401 Unauthorized response.
Request Format
Headers
Api-Key
Yes
The API key for authentication
abc123xyz789
Example Request
GET {BaseURL}/bot/api_v2/account_status.php HTTP/1.1
Host: your.api.domain
Api-Key: abc123xyz789Response Format
The response is returned in JSON format with the following structure:
Success Response
Status Code: 200 OK
{
"status": "success",
"data": {
"active": {
"count": <integer>,
"accounts": [
{
"account_detail": "<string>",
"upi": "<string|null>",
"phone_number": "<string|null>",
"status": "<string>",
"account_no": "<string|null>",
"usage_enable": "<string>",
"usage_volum": "<string|null>",
"limit_volum": "<string|null>",
"rolling_balance": "<string|null>",
"available_limit": <integer|null>
},
...
]
},
"inactive": {
"count": <integer>,
"accounts": [
{
"account_detail": "<string>",
"upi": "<string|null>",
"phone_number": "<string|null>",
"status": "<string>",
"account_no": "<string|null>",
"usage_enable": "<string>",
"usage_volum": "<string|null>",
"limit_volum": "<string|null>",
"rolling_balance": "<string|null>",
"available_limit": <integer|null>
},
...
]
}
}
}Field Descriptions
status
String
Indicates the status of the request (success or error)
data
Object
Contains the wallet data, grouped by active and inactive accounts
active.count
Integer
Number of active wallet accounts
active.accounts
Array
List of active wallet account details
inactive.count
Integer
Number of inactive wallet accounts
inactive.accounts
Array
List of inactive wallet account details
account_detail
String
Primary identifier for the wallet (e.g., UPI ID, account holder name)
upi
String|Null
UPI ID, if applicable
phone_number
String|Null
Phone number associated with the wallet, if applicable
status
String
Wallet status (e.g., Active, Inactive)
account_no
String|Null
Bank account number, if applicable
usage_enable
String
Indicates if usage tracking is enabled (Enabled or Not Enabled)
usage_volum
String|Null
Usage volume, if usage tracking is enabled
limit_volum
String|Null
Limit volume, if usage tracking is enabled
rolling_balance
String|Null
Rolling balance, if usage tracking is enabled
available_limit
Integer|Null
Available limit, calculated as limit_volum - usage_volum - rolling_balance
Empty Response
If no wallets are found for the operator:
Status Code: 200 OK
{
"status": "success",
"data": [],
"message": "No wallets found for the operator"
}Error Responses
401 Unauthorized
{"status": "error", "message": "Api-Key header missing"}
API key is not provided in the header
401 Unauthorized
{"status": "error", "message": "Invalid or unauthorized Api-Key"}
API key is invalid or unauthorized
500 Internal Server Error
{"status": "error", "message": "Database connection failed"}
Database connection issue
Example Success Response
{
"status": "success",
"data": {
"active": {
"count": 2,
"accounts": [
{
"account_detail": "user@upi",
"upi": "user@upi",
"phone_number": "1234567890",
"status": "Active",
"account_no": null,
"usage_enable": "Enabled",
"usage_volum": "100",
"limit_volum": "1000",
"rolling_balance": "200",
"available_limit": 700
},
{
"account_detail": "John Doe",
"upi": null,
"phone_number": null,
"status": "Active",
"account_no": "123456789",
"usage_enable": "Not Enabled",
"usage_volum": null,
"limit_volum": null,
"rolling_balance": null,
"available_limit": null
}
]
},
"inactive": {
"count": 1,
"accounts": [
{
"account_detail": "user2@upi",
"upi": "user2@upi",
"phone_number": "1122334455",
"status": "Inactive",
"account_no": null,
"usage_enable": "Not Enabled",
"usage_volum": null,
"limit_volum": null,
"rolling_balance": null,
"available_limit": null
}
]
}
}
}Notes
Wallet Types: The endpoint aggregates data from multiple wallet tables (e.g.,
wallet_upi,wallet_imps,wallet_bangladesh). Theaccount_detailfield varies by wallet type (e.g., UPI ID forwallet_upi, account holder name forwallet_imps).Usage Tracking: Fields like
usage_volum,limit_volum,rolling_balance, andavailable_limitare only included for wallets withusage_enableset toEnabled.Security: Ensure the API key is transmitted over HTTPS to prevent interception.
Rate Limiting: Not implemented in the current version. Consider adding rate limiting to prevent abuse.
Error Handling: The endpoint assumes a valid database connection and schema. Ensure the database is properly configured.
Last updated