API Documentation

Complete integration guide. One API, 2,500+ casino games across 10 providers.

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.

Base URL https://casino.dhansolution.in
FormatJSON
SecurityHMAC-SHA256 + API Key
CurrencyINR (Indian Rupee)

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:

1

Create an Account

Contact us or use the Master Panel to create your client account. You will receive:

API Key: 16-char alphanumeric
Client Secret: 32-char hex (keep secret!)
2

Test a Game Launch

Use the Launch API with your credentials. See Launch API section.

3

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.

4

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 KeyIdentifies your account. Sent as query parameter or X-API-Key header.
HMAC SignaturePrevents tampering. Signed payload ensures authenticity. 120s expiry prevents replay attacks.
IP WhitelistOptional. Restrict API access to your server IPs via the Master Panel.
Client SecretNever 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.

GET POST 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
balancePlayer's current balance (INR). If omitted, uses the stored value from previous sessions.
tsUnix timestamp in seconds. Required for HMAC.
sigHMAC-SHA256 hex digest. Required for HMAC.
currency_codeINR (Indian Rupee ??? default and only supported currency)
languageen (default), th, vi, id, etc.
formatSet 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.

1. Launch

You call /v1/launch with HMAC signature ??? We create a session with the game provider

???
2. Play

Player is redirected to the game ??? Player bets and plays rounds on the provider's platform

???
3. Callback

Provider sends round result (bet, win, round ID) to our encrypted callback endpoint

???
4. Balance

We update player balance: new = old - bet + win (balance cannot go below 0)

???
5. GGR Deduction

If player lost (bet > win): Commission = Loss ?? (GGR% / 100), deducted from your platform wallet

???
6. Forward Callback

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:

  1. Receives the result from the provider via encrypted callback
  2. Looks up the player's current balance in the database
  3. Calculates new balance: new_balance = max(0, old_balance - bet + win)
  4. Updates the player record with the new balance
  5. 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.

POST 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

  1. Log in to the Master Panel
  2. Navigate to Client Settings ??? Select your client
  3. Find the Provider Config section
  4. Set forward_callback_url to your webhook endpoint (e.g., https://your-platform.com/api/game/callback)
  5. 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_balanceYour main platform wallet. GGR commissions are deducted from this balance.
ggr_balanceYour 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.

GET 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},
    ...
  ]
}
GET 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

JILI
287 games
PGSoft
167 games
Spribe
16 games
Pragmatic Play
736 games
Habanero
250 games
CQ9
322 games
JDB
179 games
FaChai
80 games
Relax Gaming
160 games
Play'n Go
396 games

Error Codes

Missing parameters400Required parameter missing from request
Invalid API Key401API key not found or account is inactive
Invalid signature401HMAC signature verification failed
Signature expired401Timestamp difference > 120 seconds
IP not whitelisted403Your IP is not in the whitelist
Insufficient wallet403GGR is set but platform wallet is empty. Recharge required.
User not found404Pass balance in URL or pre-create the user
Provider error200Check 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.