Introduction
Welcome to the Wallet API documentation! This comprehensive guide provides developers with all the necessary information to seamlessly integrate our API into their applications.
Our API uses a unique single-endpoint architecture where all requests are sent to the same URL,
and the module parameter determines which operation is performed.
Key Features
- 🔄 Single endpoint for all operations
- 🎯 Module-based routing system
- 🔒 Secure authentication with accessId and accessToken
- 💳 Complete wallet management functionality
- 🎮 Game provider integration
- 📊 Transaction history and reporting
Getting Started
Quick Start Guide
-
Generate your credentials:
Navigate to the Wallet backoffice Manage API page to generate your unique
accessIdandaccessToken. -
Set up authentication:
Include your credentials in every API request body.
-
Make your first request:
Send a POST request to
/api/v1/index.phpwith the appropriate module parameter. -
Test in development:
Test your integration thoroughly in a development environment before moving to production.
-
Launch your application:
Monitor your application's performance and API usage.
Authentication
Authentication Requirements
All API requests require authentication using two credentials:
- accessId: Your unique identifier (integer)
- accessToken: Your secure access token (string)
These credentials must be included in the request body of every API call.
Example Authentication
{
"accessId": 12345,
"accessToken": "your-secure-token-here",
"module": "/users/getUserDetail",
// ... other parameters
}
API Operations
All operations use the same endpoint with different module parameters:
POST https://your-domain.com/api/v1/index.php
Perform manual Ang Pao (red packet) distribution to users.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/users/manualAngPao" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| userId | integer | Required | Target user ID |
| amount | float | Required | Amount to distribute (must include decimals, e.g., 10.00) |
| promotionId | integer | Required | Associated promotion ID |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=/users/manualAngPao" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "userId=19011169123" \ -F "amount=10.00" \ -F "promotionId=65433"
Response
200 OKSuccessful operation response
{
"status": "SUCCESS",
"data": null,
"timestamp": "2025-09-08T09:37:10+00:00"
}
Retrieve the manual Ang Pao amount for a user.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/users/getManualAngpaoAmount" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| userId | integer | Required | Target user ID |
| promotionId | integer | Required | Associated promotion ID |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \
-H "Content-Type: multipart/form-data" \
-F "module=/users/getManualAngpaoAmount" \
-F "accessId=12345" \
-F "accessToken=your-token-here" \
-F "userId=123" \
-F "promotionId=123" \
Response
200 OKReturns the manual Ang Pao amount
{
"status": "SUCCESS",
"data": 0,
"timestamp": "2025-09-08T09:37:10+00:00"
}
Retrieve all transactions for the merchant.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/transactions/getAllTransactions" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| pageIndex | integer | Number of Page | |
| sDate | string | Transaction Start Date Time | |
| eDate | string | Transaction End Date Time | |
| userId | integer | Target user ID | |
| id | integer | Target Transaction ID | |
| type | string | Enum: DEPOSIT, WITHDRAW, BONUS |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=/users/getAllTransaction" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "userId=123" \ -F "id=123" \ -F "type=DEPOSIT" \ -F "pageIndex=0" \ -F "sDate=2021-02-22T00:00:00Z" \ -F "eDate=2021-02-22T00:00:00Z"
Response
200 OKReturns all transactions for the merchant
{
"status": "SUCCESS",
"data": {
"transactions": [
{
"id": "1",
"merchantId": "5",
"adminId": "12",
"type": "DEPOSIT",
"details": "{\"method\":\"Manual\",\"bank\":\"CITIUS\",\"amount\":1}",
"cash": "1.00",
"createdDateTime": "2025-09-08T00:19:03+00:00",
"processedDateTime": "2025-09-08T00:19:03+00:00",
"endDateTime": "2025-09-08T00:19:03+00:00",
"status": "COMPLETED",
"bankId": "1",
"bank": {
"id": "1",
...
},
"user": {
"id": "1",
...
}
}
],
"totalDeposit": 0,
"netDeposit": 0,
"totalCount": "1",
"totalAmount": "00.00",
"totalPage": 1
},
"timestamp": "2025-09-08T08:26:59+00:00"
}
Register a new user in the system.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/member/register" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| username | string | Required | Your system Unqiue Id |
| name | string | Your new user name | |
| referrerCode | string | ReferrerCode for this User | |
| password | string | Your New User Authentication Key |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=register" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "username=123456" \ -F "password=securepassword" -F "name=newuser123" \ -F "referrerCode=newuser123"
Response
200 OKReturns the newly created user details
{
"status": "SUCCESS",
"data": {
"id": 123
},
"timestamp": "2025-09-08T10:15:14+00:00"
}
Retrieve detailed information about a user.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/users/getAllUsers" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| id | integer | Target User Id | |
| name | string | Target User Name or Username | |
| mobile | string | Target User Mobile | |
| bank | string | Bank Account Number | |
| status | string | Enum: ACTIVE, INACTIVE | |
| pageIndex | string | Number of Page | |
| sortBy | string | Enum: register, login | |
| sortType | string | Enum: ASC, DESC | |
| includeBetInfo | integer | Get User Min withdraw and total bet |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=getUserDetail" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "id=19011169123" \ -F "name=test" \ -F "bank=19011169123" \ -F "mobile=01901123" \ -F "bank=19011169123" \ -F "status=ACTIVE" \ -F "pageIndex=0" \ -F "sortBy=register" \ -F "sortType=ASC" \ -F "includeBetInfo=1"
Response
200 OKReturns user details including balance, status, and profile information
{
"status": "SUCCESS",
"data": {
"users": [
{
"id": "1",
"username": "1",
"name": "1",
"cash": "0.00",
"referrerId": "123",
...
}
...
],
"totalPage": 1
},
"timestamp": "2025-09-08T08:17:16+00:00"
}
Transfer credits between users.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/member/setScore" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| username | string | Required | Target Username |
| amount | float | Required | Amount Postive = Deposit, Negtive = Withdraw |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=transfer" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "username=19011169123" \ -F "amount=50.00"
Response
200 OKReturns transfer confirmation and updated balances
{
"status": "SUCCESS",
"data": {
"transactionId": "138"
},
"timestamp": "2025-09-08T10:12:12+00:00"
}
Retrieve the list of available game providers.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/games/getGameCategory" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| type | string | Enum: SLOT, LIVE, SPORTSBOOK, 4D, OTHER |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=/games/getGameCategory" \ -F "accessId=12345" \ -F "accessToken=your-token-here"
Response
200 OKReturns list of available game providers
{
"status": "SUCCESS",
"data": [
{
"type": "SLOT",
"name": "SLOT GAME",
"sites": [
{
"site": "test",
"productId": "1",
"name": "test",
"image": "",
"hasGameList": false
}
]
},
{
"type": "LIVE",
"name": "LIVE CASINO",
"sites": [...]
},
{
"type": "SPORTSBOOK",
"name": "SPORTSBOOK",
"sites": [...]
},
{
"type": "4D",
"name": "4D",
"sites": [...]
},
{
"type": "OTHER",
"name": "OTHER",
"sites": [...]
}
],
"timestamp": "2025-10-30T08:08:14+00:00"
}
Get a list of available games.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/games/getGameList" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| site | string | Traget Game Site | |
| product | integer | Required | Traget Game Product |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=/games/getGameList" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "product=0" \ -F "site=test"
Response
200 OKReturns list of available games
{
"status": "SUCCESS",
"data": [
{
"GameType": "SLOT",
"GameName": "Crash X",
"GameCode": "crash",
"GameImageUrl": ""
}
],
"timestamp": "2025-09-08T10:50:46+00:00"
}
Launch a game for a user.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/users/getGameURL" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| username | string | Required | Your Traget Username |
| site | string | Your Traget Site | |
| product | string | Your Traget Product | |
| game | string | Your Traget Game |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=/users/getGameURL" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "username=19011169123" \ -F "game=test" \ -F "product=test" \ -F "site=test"
Response
200 OKReturns game launch URL and session information
Retrieve betting history for users.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/transactions/getBetHistory" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| userId | int | Required | Target UserId |
| sTime | string | Bet History Start Date Time | |
| eTime | string | Bet History End Date Time | |
| pageIndex | string | Number of Page |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=getBetHistory" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "userId=19011169123" \ -F "sTime=2021-02-22T00:00:00Z" \ -F "eTime=2021-02-22T00:00:00Z" \ -F "pageIndex=0"
Response
200 OKReturns betting history with details of each bet
{
"status": "SUCCESS",
"data": {
"history": [],
"totalRecords": "0",
"totalPages": 0,
"currentPage": 0,
"pageSize": 10,
"stats": {
"totalRound": "0",
"totalAmount": null,
"totalResult": null
}
},
"timestamp": "2025-09-08T10:18:58+00:00"
}
Decrypt encrypted data to plain text.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/tool/decryptDataToPlainText" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| data | string | Required | Your data for Decrypt |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=decryptDataToPlainText" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "data=base64_encrypted_string_here"
Response
200 OKReturns the decrypted plain text data
{
"status": "SUCCESS",
"data": "12343",
"timestamp": "2025-09-08T10:11:12+00:00"
}
Decrypt encrypted data to plain text.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/users/getPromotionList" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| userId | integer | Required | Your Traget UserId |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=/users/getPromotionList" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "userId=123"
Response
200 OKReturns the Promotion List
{
"status": "SUCCESS",
"data": [
{
"id": "1",
"name": "promotion name",
"description": "{\"Description\":\"\",\"DescQuillEditor\":{\"ops\":[{\"attributes\":{\"list\":\"bullet\"},\"insert\":\"\\n\"}]},\"DescQuillHTML\":\"\"}",
"amount": "",
"message": ""
},
],
"timestamp": "2025-09-08T10:50:46+00:00"
}
Decrypt encrypted data to plain text.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| module | string | Required | Must be "/merchants/getLeaderboard" |
| accessId | integer | Required | Your API access ID |
| accessToken | string | Required | Your API access token |
| key | string | Required | Your Leaderboard Key |
| date | string | Required | Your Leaderboard Date |
cURL Example
curl -X POST https://your-domain.com/api/v1/index.php \ -H "Content-Type: multipart/form-data" \ -F "module=/merchants/getLeaderboard" \ -F "accessId=12345" \ -F "accessToken=your-token-here" \ -F "key=SITE^ALL" \ -F "date=2025-11-14"
Response
200 OKReturns the Leaderboard
{
"status": "SUCCESS",
"data": [
{
"user": {
"id": "1"
},
"mobile": "60******123",
"value": "1",
"data": "{\"site\":\"MEGA888\",\"bet\":1,\"win\":1}"
}
],
"timestamp": "2025-11-14T09:46:07+00:00"
}
Code Examples
JavaScript/Node.js Example
Here's how to integrate the Wallet API using JavaScript:
class WalletAPIClient {
constructor(baseURL, accessId, accessToken) {
this.baseURL = baseURL;
this.endpoint = '/api/v1/index.php';
this.accessId = accessId;
this.accessToken = accessToken;
}
async request(module, additionalData = {}) {
const url = `${this.baseURL}${this.endpoint}`;
const formData = new FormData();
formData.append('module', module);
formData.append('accessId', this.accessId);
formData.append('accessToken', this.accessToken);
// Add additional parameters
Object.keys(additionalData).forEach(key => {
formData.append(key, additionalData[key]);
});
try {
const response = await fetch(url, {
method: 'POST',
body: formData
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
} catch (error) {
console.error('API request failed:', error);
throw error;
}
}
// Convenience methods for each module
async manualAngPao(userId, amount, promotionId) {
return this.request('/users/manualAngPao', {
userId,
amount,
promotionId
});
}
async getUserDetail(userId) {
return this.request('getUserDetail', { userId });
}
async transfer(fromUserId, toUserId, amount) {
return this.request('transfer', {
fromUserId,
toUserId,
amount
});
}
async launchGame(userId, gameId) {
return this.request('launchGame', {
userId,
gameId
});
}
}
Usage Example
// Initialize the client
const client = new WalletAPIClient(
'https://your-domain.com',
12345, // Your accessId
'your-token-here' // Your accessToken
);
// Example: Send manual Ang Pao
async function sendAngPao() {
try {
const result = await client.manualAngPao(
19011169123, // userId
10.00, // amount (with decimals)
65433 // promotionId
);
console.log('Ang Pao sent successfully:', result);
} catch (error) {
console.error('Failed to send Ang Pao:', error);
}
}
// Example: Get user details
async function fetchUserDetails() {
try {
const user = await client.getUserDetail(19011169123);
console.log('User details:', user);
} catch (error) {
console.error('Failed to fetch user details:', error);
}
}
// Execute examples
sendAngPao();
fetchUserDetails();
Python Example
import requests
import json
class WalletAPIClient:
def __init__(self, base_url, access_id, access_token):
self.base_url = base_url
self.endpoint = '/api/v1/index.php'
self.access_id = access_id
self.access_token = access_token
def request(self, module, additional_data=None):
url = f"{self.base_url}{self.endpoint}"
data = {
'module': module,
'accessId': self.access_id,
'accessToken': self.access_token
}
if additional_data:
data.update(additional_data)
response = requests.post(url, data=data)
if response.status_code == 200:
return response.json()
else:
raise Exception(f"API request failed: {response.status_code}")
def manual_ang_pao(self, user_id, amount, promotion_id):
return self.request('/users/manualAngPao', {
'userId': user_id,
'amount': amount,
'promotionId': promotion_id
})
# Usage
client = WalletAPIClient(
'https://your-domain.com',
12345,
'your-token-here'
)
# Send Ang Pao
result = client.manual_ang_pao(19011169123, 10.00, 65433)
print(result)