API Overview
Base URL
https://game.gambllyapi.com/production/
All endpoints are relative to this base URL (e.g., /v1/gameLaunch.php or /v2/gameLaunch.php).
Gamblly provides two flexible integration models: V1 Seamless Wallet (where balance stays on your side) and V2 Transfer Wallet (where balance is deposited and withdrawn from the provider). Choose the model that fits your architecture.
V1: Seamless Wallet
Provider calls your callback_url for every bet and win. Zero latency balance updates. You control the funds.
V2: Transfer Wallet
Deposit funds on game launch. Withdraw funds when session ends. Simple integration with less real-time dependency.
Authentication
All requests must include your agency_uid (API Key). Responses are standard JSON.
- Use POST for all endpoints.
- Content-Type:
application/json. - Member accounts must use the correct prefix (e.g.
hee4b2for Prod).
V1: Seamless Wallet
How it works
- You call
/v1/gameLaunch.phpto get the game URL. - User plays the game.
- For every action (Bet/Win), Provider calls YOUR
callback_urlvia our/v1/callback.phpgateway. - You respond with the user's new balance.
POST /v1/gameLaunch.php
Launch a game in Seamless mode.
Request
{
"member_account": "user123",
"game_uid": "pgsoft_mahjong-ways-2",
"credit_amount": "0",
"currency_code": "INR",
"language": "en",
"api_key": "YOUR_AGENCY_UID",
"home_url": "https://your-site.com/lobby"
}
Response
{
"success": true,
"game_url": "https://game.gambllyapi.com/production/v1/launch.php?...",
"transfer_id": "TR_6578a...",
"msg": "Game launched successfully"
}
CALLBACK Your Endpoint
We will send this JSON to your callback_url. You must process the balance change and return the new balance.
Scenario 1: Bet (Deduct Money)
// Request (Action: bet)
{
"player_uid": "user123",
"bet_amount": 10.0,
"win_amount": 0,
"action": "bet",
"game_uid": "pgsoft_mahjong"
}
// Response
{
"status": true,
"balance": 990.0
}
Scenario 2: Win (Add Money)
// Request (Action: win)
{
"player_uid": "user123",
"bet_amount": 0,
"win_amount": 50.0,
"action": "win",
"game_uid": "pgsoft_mahjong"
}
// Response
{
"status": true,
"balance": 1040.0
}
V2: Transfer Wallet
Base URL
https://game.gambllyapi.com/production/v2/
All endpoints use POST method with JSON request bodies.
POST /gameLaunch.php
Request
{
"agency_uid": "your_api_key",
"member_account": "hee4b2_player123_suffix",
"game_uid": "pgsoft_123",
"timestamp": 1698755432000,
"credit_amount": 100.0,
"currency_code": "USD",
"language": "en",
"platform": "web",
"home_url": "https://yourdomain.com",
"transfer_id": "txn_game_abc123"
}
Response
{
"code": 0,
"msg": "Succeed",
"payload": {
"game_launch_url": "https://game.gambllyapi.com/game-launch?success=true"
}
}
POST /getBalance.php
This endpoint has undefined variables and SSL verification disabled.
POST /getWithdraw.php
No amount validation - withdraws entire balance without verification.
POST /callback.php
Exposes API key in response - requires immediate fix.
Security Analysis
| Endpoint | Issues | Recommendations |
|---|---|---|
| Game Launch | AES-ECB, SSL disabled | Use AES-GCM, enable SSL |
| Get Balance | Undefined variables | Fix config variables |
| Get Withdraw | No amount validation | Add verification |
| Callback | API key exposure | Remove sensitive data |
Testing Guide
Using cURL
curl -X POST https://game.gambllyapi.com/production/v2/gameLaunch.php \
-H "Content-Type: application/json" \
-d '{
"agency_uid": "your_api_key",
"member_account": "hee4b2_test_suffix",
"game_uid": "demo_game_001",
"timestamp": 1698755432000,
"credit_amount": 100.0,
"currency_code": "USD",
"language": "en",
"platform": "web",
"home_url": "https://yourdomain.com",
"transfer_id": "test_txn_001"
}'
Using JavaScript
const response = await fetch('https://game.gambllyapi.com/production/v2/gameLaunch.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
agency_uid: 'your_api_key',
member_account: 'hee4b2_test_suffix',
game_uid: 'demo_game_001',
timestamp: Date.now(),
credit_amount: 100.0,
currency_code: 'USD',
language: 'en',
platform: 'web',
home_url: 'https://yourdomain.com',
transfer_id: 'test_txn_001'
})
});
Error Codes
| Code | Message | Solution |
|---|