Merchant API
Integrate GameHub into your player-facing site.
Base URL
https://your-domain.com/api/public/v1Authentication
Every request is a JSON POST with these top-level fields:
operator_code— yourop_coderequest_time— Unix seconds (string)sign—md5(operator_code + request_time + method + secret_key)
Method strings: launchgame, gamelist, playerbalance, wagerlist.
Node sample
import { createHash } from "crypto";
const OP = "YOUR_OP_CODE";
const SECRET = "YOUR_SECRET_KEY";
const t = Math.floor(Date.now()/1000).toString();
function sign(method) {
return createHash("md5").update(OP + t + method + SECRET).digest("hex");
}
const res = await fetch("https://your-domain.com/api/public/v1/game/launch", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
operator_code: OP,
request_time: t,
sign: sign("launchgame"),
member_account: "player123",
product_code: "PR-SLOT",
game_code: "moreturkeyv10000",
language: "en",
}),
});
console.log(await res.json());PHP sample
$op = "YOUR_OP_CODE";
$secret = "YOUR_SECRET_KEY";
$t = (string) time();
$sign = md5($op . $t . "launchgame" . $secret);
$body = json_encode(compact("op","t","sign") + [
"operator_code" => $op, "request_time" => $t, "sign" => $sign,
"member_account" => "player123", "product_code" => "PR-SLOT",
]);
$ch = curl_init("https://your-domain.com/api/public/v1/game/launch");
curl_setopt_array($ch, [CURLOPT_POST=>1, CURLOPT_POSTFIELDS=>$body,
CURLOPT_HTTPHEADER=>["Content-Type: application/json"], CURLOPT_RETURNTRANSFER=>1]);
echo curl_exec($ch);Endpoints
POST
/game/launchmethod = launchgameRequest body
{ "member_account": "player123", "product_code": "PR-SLOT", "game_code": "moreturkeyv10000", "language": "en" }Response
{ "code": 0, "data": { "url": "https://..." } }POST
/game/listmethod = gamelistRequest body
{ }Response
{ "code": 0, "data": [{ "product_code": "PR-SLOT", "game_code": "...", "game_name": "..." }] }POST
/player/balancemethod = playerbalanceRequest body
{ "member_account": "player123" }Response
{ "code": 0, "member_account": "player123", "balance": 1250.0000, "currency": "USD" }POST
/wager/listmethod = wagerlistRequest body
{ "start_time": 1730000000, "end_time": 1730100000, "page": 1, "size": 100 }Response
{ "code": 0, "total": 42, "page": 1, "size": 100, "data": [ ... ] }Response codes
| Code | Meaning |
|---|---|
0 | OK |
1 | Internal error |
2 | Member not found |
3 | Insufficient balance |
4 | Duplicate transaction |
5 | Invalid signature |
6 | Invalid operator |
Wallet flow
When a player launches a game, GameHub relays wallet operations to your player's balance automatically. You do not implement any callback — bets and wins settle in real time inside GameHub against your merchant credit.