Webhook Configuration
Configure webhooks to receive real-time notificationsতোমার platform এ game events (bet/win/balance) real-time পেতে নিচের URL টি তোমার system এ configure করো:
CALLBACK URL
https://api.trusheme.info/callback.php
API Endpoints
Use these endpoints to integrate with our gaming API Game Launch URL
LAUNCH
POST
Integration Example
Step 1 — Define credentials in GetGameUrl.php:
define('RESELLER_API_TOKEN', 'vk_live_337dd0f739a78c285c346b5ec0ee60633d5876b4'); define('RESELLER_SECRET_KEY', 'YOUR_SECRET_KEY'); // Credentials page থেকে নাও define('RESELLER_PREFIX', 'VRS5F0DDF');
Step 2 — PHP cURL Example:
$ch = curl_init('https://api.trusheme.info/zynverse.php'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ 'userId' => '12345', 'gameCode' => 'game_code_here', 'vendorCode' => 20, 'userBalance' => 1000.00, 'language' => 0, 'phonetype' => 0, 'returnUrl' => 'https://yoursite.com' ])); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'X-API-Token: ' . RESELLER_API_TOKEN, 'X-Secret-Key: ' . RESELLER_SECRET_KEY ]); $response = curl_exec($ch); $result = json_decode($response, true); // Game URL: $result['data']['url']
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | Required | তোমার system এ player এর unique ID |
| gameCode | string | Required | Game এর code (e.g. vs20fruitsw) |
| vendorCode | integer | Optional | Provider vendor code, default: 18 |
| userBalance | float | Required | Player এর current balance |
| language | integer | Optional | Language code, 0 = default |
| phonetype | integer | Optional | Device type, 0 = default |
| returnUrl | string | Optional | Game শেষে redirect URL |
{
"success": true,
"data": {
"url": "https://games.provider.com/launch?token=eyJ...",
"session_id": "sess_abc123",
"game_name": "Sweet Bonanza",
"provider": "Pragmatic Play",
"game_code": "vs20fruitsw",
"balance": 1000.00,
"currency": "INR"
},
"timestamp": "2026-07-07T10:00:00+06:00"
}{
"success": false,
"error": "Insufficient wallet balance to launch game.",
"code": "INSUFFICIENT_BALANCE",
"timestamp": "2026-07-07T10:00:00+06:00"
}Wallet & Bet Endpoints
POST
https://api.trusheme.info/v1/bet/place
Place a bet for a player
Example Request
{
"player_id": "player123",
"game_id": "slot_mega_fortune",
"amount": 10.00,
"currency": "INR",
"transaction_id": "txn_12345"
}Test Results
Success
{
"success": true,
"data": {
"balance": 1250.5,
"currency": "INR",
"player_id": "player123",
"transaction_id": "txn_12345"
},
"timestamp": "2026-07-07T10:20:11+06:00"
}
POST
https://api.trusheme.info/v1/bet/settle
Settle a bet with win amount
Example Request
{
"transaction_id": "txn_12345",
"win_amount": 25.00,
"status": "won"
}Test Results
Success
{
"success": true,
"data": {
"balance": 1275.5,
"currency": "INR",
"player_id": "player123",
"transaction_id": "txn_12345",
"status": "won",
"win_amount": 25.00
},
"timestamp": "2026-07-07T10:21:36+06:00"
}
GET
https://api.trusheme.info/v1/bets/history?player_id=player123&limit=50
Retrieve betting history
| Parameter | Type | Required | Description |
|---|---|---|---|
| player_id | string | Optional | Specific player filter |
| limit | integer | Optional | Results per page, default: 50, max: 200 |
| page | integer | Optional | Page number, default: 1 |
Success
{
"success": true,
"data": {
"bets": [
{
"id": 42,
"player_id": "player123",
"action": "debit",
"amount": 10.00,
"game_code": "slot_mega_fortune",
"transaction_id": "txn_12345",
"balance_before": 1260.5,
"balance_after": 1250.5,
"status": "success",
"processed_at": "2026-07-07 10:20:11"
}
],
"total": 87,
"page": 1,
"limit": 50,
"total_pages": 2
},
"timestamp": "2026-07-07T10:22:01+06:00"
}
GET
https://api.trusheme.info/v1/balance?player_id=player123
Get current balance for a player
Success
{
"success": true,
"data": {
"balance": 1250.5,
"currency": "INR",
"player_id": "player123"
},
"timestamp": "2026-07-07T10:21:12+06:00"
}Your API Credentials
Full Credentials Page
RESELLER_API_TOKEN
vk_live_337dd0f739a78c285c346b5ec0ee60633d5876b4
RESELLER_PREFIX
VRS5F0DDF
BASE_URL
https://api.trusheme.info
Secret key টি সব সময় server-side এ রাখো। কখনো client/browser এ expose করো না।
Integration Examples
// GetGameUrl.php — ZynVerse style credentials define('RESELLER_API_TOKEN', 'vk_live_337dd0f739a78c285c346b5ec0ee60633d5876b4'); define('RESELLER_SECRET_KEY', 'YOUR_SECRET_KEY'); define('RESELLER_PREFIX', 'VRS5F0DDF'); function callVerseApi(string $method, string $path, array $body = []): array { $ch = curl_init('https://api.trusheme.info' . $path); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => $method, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-Token: ' . RESELLER_API_TOKEN, 'X-Secret-Key: ' . RESELLER_SECRET_KEY, ], ]); if ($body) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); $res = json_decode(curl_exec($ch), true); curl_close($ch); if (!($res['success'] ?? false)) throw new RuntimeException($res['error'] ?? 'API Error'); return $res['data'] ?? []; } // ── Game Launch ── $ch = curl_init('https://api.trusheme.info/zynverse.php'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ 'userId' => '12345', 'gameCode' => 'game_code_here', 'vendorCode' => 20, 'userBalance' => 1000.00, 'language' => 0, 'phonetype' => 0, 'returnUrl' => 'https://yoursite.com' ])); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'X-API-Token: ' . RESELLER_API_TOKEN, 'X-Secret-Key: ' . RESELLER_SECRET_KEY ]); $response = curl_exec($ch); $result = json_decode($response, true); // Game URL: $result['data']['url'] header("Location: {$result['data']['url']}"); exit; // ── Get Balance ── $bal = callVerseApi('GET', '/v1/balance?player_id=player123'); echo $bal['balance']; // 1250.5 // ── Place Bet ── $bet = callVerseApi('POST', '/v1/bet/place', [ 'player_id' => 'player123', 'game_id' => 'slot_mega_fortune', 'amount' => 10.00, 'currency' => 'INR', 'transaction_id' => 'txn_12345', ]); // ── Settle Bet ── $settle = callVerseApi('POST', '/v1/bet/settle', [ 'transaction_id' => 'txn_12345', 'win_amount' => 25.00, 'status' => 'won', ]);
const RESELLER_API_TOKEN = 'vk_live_337dd0f739a78c285c346b5ec0ee60633d5876b4'; const RESELLER_SECRET_KEY = 'YOUR_SECRET_KEY'; const BASE_URL = 'https://api.trusheme.info'; async function callVerseApi(method, path, body = null) { const res = await fetch(BASE_URL + path, { method, headers: { 'X-API-Token': RESELLER_API_TOKEN, 'X-Secret-Key': RESELLER_SECRET_KEY, 'Content-Type': 'application/json' }, body: body ? JSON.stringify(body) : undefined }); const data = await res.json(); if (!data.success) throw new Error(data.error); return data.data; } // Game Launch const launch = await callVerseApi('POST', '/zynverse.php', { userId: '12345', gameCode: 'game_code_here', vendorCode: 20, userBalance: 1000.00, language: 0, phonetype: 0, returnUrl: 'https://yoursite.com' }); window.open(launch.url, '_blank'); // $result['data']['url'] // Get Balance const bal = await callVerseApi('GET', '/v1/balance?player_id=player123'); console.log(bal.balance); // 1250.5 // Place Bet const bet = await callVerseApi('POST', '/v1/bet/place', { player_id: 'player123', game_id: 'slot_mega_fortune', amount: 10.00, currency: 'INR', transaction_id: 'txn_12345' }); // Settle Bet const settle = await callVerseApi('POST', '/v1/bet/settle', { transaction_id: 'txn_12345', win_amount: 25.00, status: 'won' });
import requests RESELLER_API_TOKEN = "vk_live_337dd0f739a78c285c346b5ec0ee60633d5876b4" RESELLER_SECRET_KEY = "YOUR_SECRET_KEY" RESELLER_PREFIX = "VRS5F0DDF" BASE_URL = "https://api.trusheme.info" HEADERS = { "X-API-Token": RESELLER_API_TOKEN, "X-Secret-Key": RESELLER_SECRET_KEY, "Content-Type": "application/json", } def call_verse_api(method, path, body=None): res = requests.request(method, BASE_URL + path, headers=HEADERS, json=body) data = res.json() if not data.get("success"): raise Exception(data.get("error", "API Error")) return data.get("data", {}) # Game Launch launch = call_verse_api("POST", "/zynverse.php", { "userId": "12345", "gameCode": "game_code_here", "vendorCode": 20, "userBalance": 1000.00, "language": 0, "phonetype": 0, "returnUrl": "https://yoursite.com" }) print(f"Game URL: {launch['url']}") # $result['data']['url'] # Get Balance bal = call_verse_api("GET", "/v1/balance?player_id=player123") print(bal["balance"]) # Place Bet bet = call_verse_api("POST", "/v1/bet/place", { "player_id": "player123", "game_id": "slot_mega_fortune", "amount": 10.00, "currency": "INR", "transaction_id": "txn_12345" }) # Settle Bet settle = call_verse_api("POST", "/v1/bet/settle", { "transaction_id": "txn_12345", "win_amount": 25.00, "status": "won" })
import 'package:http/http.dart' as http; import 'dart:convert'; const apiToken = 'vk_live_337dd0f739a78c285c346b5ec0ee60633d5876b4'; const secretKey = 'YOUR_SECRET_KEY'; const baseUrl = 'https://api.trusheme.info'; Map<String, String> get _headers => { 'X-API-Token': apiToken, 'X-Secret-Key': secretKey, 'Content-Type': 'application/json', }; Future<Map> callVerseApi(String method, String path, {Map? body}) async { final uri = Uri.parse('$baseUrl$path'); final res = method == 'GET' ? await http.get(uri, headers: _headers) : await http.post(uri, headers: _headers, body: jsonEncode(body)); final data = jsonDecode(res.body); if (!(data['success'] as bool)) throw Exception(data['error']); return data['data'] ?? {}; } // Game Launch final launch = await callVerseApi('POST', '/zynverse.php', body: { 'userId': '12345', 'gameCode': 'game_code_here', 'vendorCode': 20, 'userBalance': 1000.00, 'language': 0, 'phonetype': 0, }); // launch['url'] — WebView এ open করো // Get Balance final bal = await callVerseApi('GET', '/v1/balance?player_id=player123');
Error Codes
| HTTP | Code | কারণ |
|---|---|---|
| 401 | MISSING_AUTH | X-API-Token বা X-Secret-Key header নেই |
| 401 | INVALID_TOKEN | API token ভুল অথবা account suspended |
| 401 | INVALID_SECRET | Secret key ভুল |
| 403 | IP_NOT_WHITELISTED | Server IP whitelist এ নেই। Admin কে জানাও। |
| 402 | INSUFFICIENT_BALANCE | Wallet এ পর্যাপ্ত balance নেই |
| 422 | MISSING_FIELDS | Required field missing |
| 502 | LAUNCH_FAILED | Upstream game server এ launch fail হয়েছে |
| 503 | API_NOT_CONFIGURED | Admin এখনো API configure করেননি |