Gamblly Logo
Copied to clipboard!

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. hee4b2 for Prod).

V1: Seamless Wallet

How it works

  1. You call /v1/gameLaunch.php to get the game URL.
  2. User plays the game.
  3. For every action (Bet/Win), Provider calls YOUR callback_url via our /v1/callback.php gateway.
  4. 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

Security Warning:

This endpoint has undefined variables and SSL verification disabled.

POST /getWithdraw.php

Critical Security Issue:

No amount validation - withdraws entire balance without verification.

POST /callback.php

Note:

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
Code Message Recommended Solution
0 Success Transaction successful. Update local balance.
10002 Agency not exist Verify your agency_uid is correct.
10004 payload error Invalid JSON or missing required fields.
10005 System error Internal server error. Contact support.
10008 The game does not exist Check game_uid is valid and active.
10011 Player currencies do not match User currency must match Agency currency.
10012 Player name already exists Username conflict. Use a unique suffix.
10013 Currency is not supported The requested currency is not enabled.
10014 PlayerName is incorrect Invalid characters in username.
10015 Player account format invalid Only a-z and 0-9 allowed.
10016 Account frozen Contact administrator to unfreeze.
10017 Manufacturer not exist Game provider ID is invalid.
10018 Line currency not supported API Line config issue.
10020 Carrier no currency Carrier configuration missing currency.
10022 Incorrect parameters Check all required fields.
10023 Player name too short Must be at least 3 characters.
10024 Wallet mode mismatch Agent configured for different wallet type.
10025 Insufficient wallet balance Recharge account (Min 100 for launch).
10026 Transfer failed Database or logic error during transfer.
10027 Transfer order exists Duplicate transfer_id used.
10028 Date empty Start/End date parameters missing.
10029 Date range invalid Start and end dates must be same day.
10030 Too many requests Rate limit exceeded. Retry later.
10031 Data too old Query limit: last 60 days.
10032 End date invalid End date > Start date required.
10033 home_url invalid URL cannot contain '?'.
10034 System Maintenance System is currently under maintenance.
10035 Provider Error Upstream provider returned an error.