Overview
DhanSolution is a white-label casino game aggregation API. We connect your platform to 10+ game providers (Pragmatic Play, PGSoft, JILI, Spribe, Habanero, and more) through a single, unified API.
https://casino.dhansolution.in
How It Works
1. You create a player on your platform and initiate a game session via our Launch API.
2. We establish a secure session with the game provider (HUIDU) and return a game URL.
3. Your player plays the game on the provider's platform inside a redirect or iframe.
4. When a round completes, the provider sends us a callback with bet/win results.
5. We update the player's balance, calculate GGR commission (if the player lost), and forward the result to your webhook URL.
6. Your system processes the forwarded callback as the source of truth for balances.
Getting Started
Go live in minutes. Follow these steps:
Create an Account
Contact us or use the Master Panel to create your client account. You will receive:
Test a Game Launch
Use the Launch API with your credentials. See Launch API section.
Set Your Forward Callback URL
Provide your webhook URL in the Master Panel ??? Client Settings ??? Forward Callback URL to receive game results in real-time. See Forward Callback URL section.
Go Live
Launch games from your platform using the Launch API. Process incoming callbacks to update player balances.
Authentication
Every request to the Launch API requires an API Key and an HMAC-SHA256 signature using your Client Secret.
HMAC Signature
Generate a signature for every launch request. The signature is valid for 120 seconds.
// Data to sign (pipe-separated) data = api_key + "|" + user_id + "|" + game_uid + "|" + balance + "|" + ts // HMAC-SHA256 hex digest sig = hash_hmac('sha256', data, client_secret)
Send ts (unix timestamp in seconds) and sig as query parameters.
Security Layers
| API Key | Identifies your account. Sent as query parameter or X-API-Key header. |
| HMAC Signature | Prevents tampering. Signed payload ensures authenticity. 120s expiry prevents replay attacks. |
| IP Whitelist | Optional. Restrict API access to your server IPs via the Master Panel. |
| Client Secret | Never share or expose client-side. Used only for HMAC signing on your backend. |
IP Whitelist (Optional)
If enabled, only requests from whitelisted IPs are accepted. HMAC signature is still recommended even with IP whitelist enabled.
Launch API
Creates a game session and returns the game URL. Use this to redirect the player to the game or embed it on your site.
https://casino.dhansolution.in/v1/launch
Parameters
| api_key * | Your client API key |
| user_id * | Unique player identifier on your platform |
| game_uid * | Game UID from the Game Catalog |
| balance | Player's current balance (INR). If omitted, uses the stored value from previous sessions. |
| ts | Unix timestamp in seconds. Required for HMAC. |
| sig | HMAC-SHA256 hex digest. Required for HMAC. |
| currency_code | INR (Indian Rupee ??? default and only supported currency) |
| language | en (default), th, vi, id, etc. |
| format | Set format=json to receive JSON response instead of an HTTP redirect. |
Success Response
// HTTP 302 redirect to game URL (default) Location: https://jsgame.live/game/gamesUrl?id=... // OR with ?format=json: { "ok": true, "game_url": "https://jsgame.live/game/gamesUrl?id=...", "request_id": "huidu_req_abc123" }
cURL Example
curl "https://casino.dhansolution.in/v1/launch?api_key=YOUR_KEY&user_id=player1&game_uid=YOUR_GAME_UID&balance=100&ts=$(date +%s)&sig=YOUR_SIG&format=json"
Transaction Flow
End-to-end lifecycle of a game round from launch to callback forwarding.
You call /v1/launch with HMAC signature ??? We create a session with the game provider
Player is redirected to the game ??? Player bets and plays rounds on the provider's platform
Provider sends round result (bet, win, round ID) to our encrypted callback endpoint
We update player balance: new = old - bet + win (balance cannot go below 0)
If player lost (bet > win): Commission = Loss ?? (GGR% / 100), deducted from your platform wallet
We POST the result (including all fields + GGR data) to your forward_callback_url
Player Balance
Two ways to manage player balances:
Option 1: Pass Balance in URL
Pass the player's current balance with every launch request. We update our records automatically.
/v1/launch?api_key=...&balance=100.50
Recommended for most integrations. Always sends the latest balance.
Option 2: Pre-created Users
Create users in the Master Panel or via the API. We track their balance across sessions. Callbacks update balances automatically.
Balance After Callback
When a round completes, our system:
- Receives the result from the provider via encrypted callback
- Looks up the player's current balance in the database
- Calculates new balance:
new_balance = max(0, old_balance - bet + win) - Updates the player record with the new balance
- Forwards the result (including balance snapshot) to your webhook URL
Your system should use the forwarded callback as the source of truth for player balances.
Callbacks & Webhooks
After every game round, we forward the result to your configured callback URL in real-time. Set your Forward Callback URL in the Master Panel under Client Settings ??? Provider Config ??? Forward Callback URL.
YOUR_FORWARD_CALLBACK_URL
Forwarded Payload (Corrected)
{
// Original provider data
"serial_number": "245876c4-f717-76d2-b143-3453dac191c7",
"game_uid": "e794bf5717aca371152df192341fe68b",
"game_round": "RND123456789",
"member_account": "player1", // Prefix stripped
"bet_amount": 100.00,
"win_amount": 0.00,
"currency_code": "INR", // Always INR
"timestamp": "1712345678000",
// System fields (inf_ prefix)
"inf_request_id": "huidu_req_abc123",
"inf_balance": 900.00, // Player balance AFTER processing
"inf_net_amount": -100.00, // win - bet (negative = loss)
// GGR fields (only present if player lost)
"ggr_commission": 10.00, // Actual GGR deducted from your wallet
"ggr_percentage": 10, // Your configured GGR %
// Derived fields
"credit_amount": 900.00, // Same as inf_balance (next balance)
}
ggr_commission is the actual amount deducted from your platform wallet.
ggr_percentage is your configured GGR rate. Both appear only when the player lost (bet > win).
Expected Response
Your server must respond with HTTP 200. The response body is ignored.
HTTP 200 OK
??? Important
A non-200 response will not be retried. Ensure your endpoint is reliable and always returns 200.
Forward Callback URL
The Forward Callback URL is where we send game result data after processing. This is a per-client setting stored in your Provider Config in the Master Panel.
How to Set It
- Log in to the Master Panel
- Navigate to Client Settings ??? Select your client
- Find the Provider Config section
- Set
forward_callback_urlto your webhook endpoint (e.g.,https://your-platform.com/api/game/callback) - Save the settings
What Gets Forwarded
Every game round result is forwarded as a POST request with Content-Type: application/json.
The payload includes all fields shown in the Callbacks section above.
GGR Commission
Gross Gaming Revenue (GGR) is our revenue model. A commission is deducted from your platform wallet on every player loss. No deduction is made when the player wins or breaks even.
How GGR Works
1. Player places a bet of ???100 and loses the round.
2. Loss amount = Bet - Win = 100 - 0 = ???100.
3. With your GGR rate of 10%: Commission = 100 ?? (10 / 100) = ???10.
4. This ???10 is deducted from your platform wallet balance.
5. The transaction is logged in both client_balance_changes and ggr_transactions for audit.
Calculation
Commission = (Bet ??? Win) ?? (GGR% / 100)
Bet: ???100, Win: ???0, GGR: 10% ??? Commission = ???10
Bet: ???100, Win: ???50, GGR: 10% ??? Commission = ???5
Bet: ???100, Win: ???200, GGR: 10% ??? No deduction (player won)
Bet: ???100, Win: ???100, GGR: 10% ??? No deduction (break-even)
Wallet Balances
| wallet_balance | Your main platform wallet. GGR commissions are deducted from this balance. |
| ggr_balance | Your configured GGR percentage (e.g., 10.00 = 10%). Set in the Master Panel. |
You can view your current wallet balance and GGR percentage in your dashboard.
Game Catalog
Browse available providers and games. Requires your API key.
https://casino.dhansolution.in/api/v1/providers?api_key=YOUR_KEY
{
"ok": true,
"count": 10,
"providers": [
{"name": "JILI", "games_count": 287},
{"name": "PGSoft", "games_count": 167},
...
]
}
https://casino.dhansolution.in/api/v1/games?api_key=YOUR_KEY&provider=ID
{
"ok": true,
"count": 287,
"games": [
{"game_uid": "3978", "name": "Sweet Bonanza"},
{"game_uid": "4001", "name": "Gates of Olympus"}
]
}
Available Providers
287 games
167 games
16 games
736 games
250 games
322 games
179 games
80 games
160 games
396 games
Error Codes
| Missing parameters | 400 | Required parameter missing from request |
| Invalid API Key | 401 | API key not found or account is inactive |
| Invalid signature | 401 | HMAC signature verification failed |
| Signature expired | 401 | Timestamp difference > 120 seconds |
| IP not whitelisted | 403 | Your IP is not in the whitelist |
| Insufficient wallet | 403 | GGR is set but platform wallet is empty. Recharge required. |
| User not found | 404 | Pass balance in URL or pre-create the user |
| Provider error | 200 | Check provider_code and provider_msg in response |
Provider errors return HTTP 200 with ok: false. Check the provider_code and provider_msg fields for details.
Code Examples
Full working examples for generating the HMAC signature and launching a game.
PHP
<?php // Your credentials (keep secret!) $apiKey = 'YOUR_API_KEY'; $clientSecret = 'YOUR_CLIENT_SECRET'; $userId = 'player123'; $gameUid = 'YOUR_GAME_UID'; $balance = '100.00'; $ts = time(); // Build HMAC payload $payload = "$apiKey|$userId|$gameUid|$balance|$ts"; $sig = hash_hmac('sha256', $payload, $clientSecret); // Build launch URL $url = "https://casino.dhansolution.in/v1/launch?api_key=" . urlencode($apiKey) . "&user_id=" . urlencode($userId) . "&game_uid=" . urlencode($gameUid) . "&balance=" . urlencode($balance) . "&ts=" . $ts . "&sig=" . $sig . "&format=json"; // Send request $response = json_decode(file_get_contents($url), true); if ($response['ok'] ?? false) { header("Location: " . $response['game_url']); } else { echo "Error: " . ($response['error'] ?? 'Unknown'); }
Python
# Your credentials api_key = "YOUR_API_KEY" secret = "YOUR_CLIENT_SECRET" user_id = "player123" game_uid = "YOUR_GAME_UID" balance = "100.00" ts = str(int(time.time())) # HMAC-SHA256 payload = f"{api_key}|{user_id}|{game_uid}|{balance}|{ts}" sig = hmac.new(secret.encode(), payload.encode(), hashlib.sha256).hexdigest() # Launch request params = urllib.parse.urlencode({ "api_key": api_key, "user_id": user_id, "game_uid": game_uid, "balance": balance, "ts": ts, "sig": sig, "format": "json" }) url = f"https://casino.dhansolution.in/v1/launch?{params}" resp = requests.get(url).json() if resp.get("ok"): print(f"Game URL: {resp['game_url']}") else: print(f"Error: {resp.get('error')}")
Node.js
// Your credentials const apiKey = 'YOUR_API_KEY'; const secret = 'YOUR_CLIENT_SECRET'; const userId = 'player123'; const gameUid = 'YOUR_GAME_UID'; const balance = '100.00'; const ts = Math.floor(Date.now() / 1000); // HMAC-SHA256 const payload = `${apiKey}|${userId}|${gameUid}|${balance}|${ts}`; const sig = crypto.createHmac('sha256', secret) .update(payload).digest('hex'); // Launch request const params = new URLSearchParams({ api_key: apiKey, user_id: userId, game_uid: gameUid, balance, ts, sig, format: 'json' }); const url = `https://casino.dhansolution.in/v1/launch?${params}`; https.get(url, res => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { const resp = JSON.parse(data); if (resp.ok) console.log('Game URL:', resp.game_url); else console.log('Error:', resp.error); }); });
cURL
#!/bin/bash API_KEY="YOUR_API_KEY" SECRET="YOUR_CLIENT_SECRET" USER_ID="player123" GAME_UID="YOUR_GAME_UID" BALANCE="100" TS=$(date +%s) SIG=$(echo -n "${API_KEY}|${USER_ID}|${GAME_UID}|${BALANCE}|${TS}" | \ openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}') curl -s "https://casino.dhansolution.in/v1/launch?api_key=${API_KEY}&user_id=${USER_ID}&game_uid=${GAME_UID}&balance=${BALANCE}&ts=${TS}&sig=${SIG}&format=json"
Integration Checklist
Follow this checklist to ensure a smooth integration.