Game Open API (Transfer 接入) (2.1.0)

Download OpenAPI specification:Download

调用 API 方式

REST API

请求方式:GET / POST,依据各接口规格说明

数据格式:JSON

路径前缀:/gameapi/v2

调用示例:

POST /gameapi/v2/create_player HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: <api server>
Connection: close
Content-Length: 255

请求参数:

{
  "merchant_code": "04e17735ba374dcd898746c6ac8118e4",
  "auth_token": "59ddb8dd71f8494485ff200f78bc4dba",
  "username": "merchant.player2",
  "sign": "20fbee96a0f436a6d8386b192a569a27bcc1c689"
}

返回响应:

{
  "success": true,
  "code": 0,
  "detail": {
    "id": 11216,
    "role": 3,
    "username": "o2p1632998628",
    "company": 11198
  }
}

标准返回结果格式:

  • success:布尔值,表示此接口操作成功或失败。如果失败,则 message 字段会提供错误信息。
  • code:返回码,仅用于向后兼容。
  • message:字符串,操作失败(success: false)时返回具体错误信息,详细内容请见错误列表。
  • detail:具体业务返回数据,依据各接口规格定义。

游戏列表

  • 根据受欢迎程度每月更新

大厅

游戏代码 游戏名称
lobby 游戏大厅

经典游戏

游戏代码 游戏标签 英文名称 中文名称 RTP 上月排名 发布日期
football 2 Goal Win 够赢 96% New 2026/04/22
crash2 2 Shadow Rush 暗影突袭 96% New 2026/03/16
road 1 Ice Hop 冰川跳跃 95% ~ 97% New 2025/11/10
crash 1 Crash 暴力弹 98.99% 1 2022/6/30
baccarat 1 Baccarat 百家乐 98.99% 2 2024/12/26
triple 1 Triple 三联爆 96.5% 3 2022/6/30
plinko 1 Plinko 叮咚球 92.3% ~ 96.6% 4 2022/6/30
mine 1 Mine 挖矿弹 96.96% 5 2022/6/30
coin 1 Goal 点球 97% 6 2022/6/30
dice 1 Lucky Beer 幸运啤酒 98% - 2022/6/30
limbo 1 Limbo 凌波弹 94% ~ 95% - 2022/6/30
space-max 2 Space Max 星际探险 98.99% - 2023/5/15
double 1 Double 轮盘 95% - 2022/6/30
keno 1 Keno 基诺球 92% - 2022/6/30
crypto 1 Crypto 宝石 97% - 2022/6/30
hilo 1 Hilo 西洛 98% - 2022/6/30
tower 1 Tower 爬塔 96% - 2022/6/30
bingo 1 Bingo 宾果 92% - 2023/3/1
poker 1 Video Poker 电子扑克 98.37% - 2023/4/1
wheel 1 Wheel 转盘 96% ~ 97% - 2023/6/30
nine 1 Nine 拆弹专家 92% - 2023/10/4
color 1 Color 颜色 95% - 2024/1/3
racing 1 Racing 赛车 95% - 2024/1/26
space 1 Space 星际迷航 95% - 2024/8/8

怪兽系列

游戏代码 游戏标签 英文名称 中文名称 RTP 上月排名 发布日期
m-mine 3 Monster Mine 怪兽扫雷 96.96% 1 2023/9/1
m-plinko 3 Rock Plinko 怪兽弹珠 92.3% ~ 96.6% 2 2023/9/1
m-tower 3 Monster Tower 怪兽爬塔 96% 3 2023/9/1
m-fight 3 Monster Fight 怪兽斗争 97% 4 2023/9/1
m-crypto 3 Monster Crypto 怪兽宝石 97% - 2023/9/1
m-triple 3 Monster Triple 怪兽三联 96.5% - 2023/9/1
m-hilo 3 Monster HiLo 怪兽西洛 98% - 2024/3/1
m-dice 3 Monster Dice 怪兽骰宝 98% - 2024/3/1
m-crash 3 Monster Crash 怪兽飞船 98.99% - 2024/4/9

刮刮乐

游戏代码 游戏标签 英文名称 中文名称 RTP 发布日期
3001 10 Happy Farm 快乐农场 95% 2024/1/25
3002 10 Opportunity 10 机会 10 92% 2024/1/25
3003 10 Ultra 777 超级 777 93% 2024/1/25
3004 10 Gem Bomb 宝石炸弹 92% 2024/1/25
3005 10 Mad Scientist 疯狂科学家 93% 2024/1/25
3006 10 Beach NiuNiu 海滩牛牛 92% 2024/1/25

老虎机

游戏代码 游戏标签 英文名称 中文名称 RTP 发布日期
7001 30 Molten Dragon 熔火幼龙 94.04% 2024/9/12
7002 30 Magic Girl 小魔女 92% ~ 95% 2024/9/12
7003 30 Jungle Travel 丛林旅行 92% ~ 95% 2024/9/12
7005 30 Hash Tiger 哈希老虎 92% ~ 95% 2026/6/18
7007 30 Hash Rabbit 哈希兔兔 92% ~ 95% 2026/6/18
7008 30 Pyramid Paws 神殿萌爪 92% ~ 95% 2026/9/3
7009 30 Wild Fox 荒野狐狸 92% ~ 95% 2026/9/3

彩票

游戏代码 游戏标签 英文名称 中文名称 RTP 发布日期
lottery_lobby 20 Lottery Lobby 彩票大厅 95% 2025/12/15
5001 20 Lotinha Lotinha 95% 2025/12/15
5002 20 Quininha Quininha 95% 2025/12/15
5003 20 Seninha Seninha 95% 2025/12/15
5011 20 60s 5D 1分时时彩 95% 2025/12/15
5012 20 300s 5D 5分时时彩 95% 2025/12/15
5013 20 600s 5D 10分时时彩 95% 2025/12/15
5016 20 60s PK10 1分赛车 95% 2025/12/15
5017 20 300s PK10 5分赛车 95% 2025/12/15
5018 20 600s PK10 10分赛车 95% 2025/12/15
5021 20 60s K3 1分快3 95% 2025/12/15
5022 20 300s K3 5分快3 95% 2025/12/15
5023 20 600s K3 10分快3 95% 2025/12/15
5036 20 60s HK6 1分六合彩 95% 2025/12/15
5037 20 300s HK6 5分六合彩 95% 2025/12/15
5038 20 600s HK6 10分六合彩 95% 2025/12/15
5041 20 60s WinGo 1分WinGo 95% 2025/12/15
5042 20 300s WinGo 5分WinGo 95% 2025/12/15
5043 20 600s WinGo 10分WinGo 95% 2025/12/15
5046 20 Hash28 60s 1分哈希28 95% 2025/12/15
5047 20 Hash28 300s 5分哈希28 95% 2025/12/15
5048 20 Hash28 600s 10分哈希28 95% 2025/12/15
5051 20 VN North 60s 越南北部1分彩 95% 2025/12/15
5052 20 VN North 300s 越南北部5分彩 95% 2025/12/15
5053 20 VN North 600s 越南北部10分彩 95% 2025/12/15
5056 20 VN Central 60s 越南中部1分彩 95% 2025/12/15
5057 20 VN Central 300s 越南中部5分彩 95% 2025/12/15
5058 20 VN Central 600s 越南中部10分彩 95% 2025/12/15
5061 20 VN South 60s 越南南部1分彩 95% 2025/12/15
5062 20 VN South 300s 越南南部5分彩 95% 2025/12/15
5063 20 VN South 600s 越南南部10分彩 95% 2025/12/15
5066 20 SicBo 60s 1分骰宝 95% 2025/12/15
5067 20 SicBo 300s 5分骰宝 95% 2025/12/15
5068 20 SicBo 600s 10分骰宝 95% 2025/12/15

错误列表

代码 错误信息 (Message) 说明
1 InvalidSignature 无效的签名
2 InvalidMerchantCode 无效的商户号
3 InvalidSecureKey 无效的安全密钥
4 InvalidAuthToken 无效的授权书识别符
5 InvalidGamePlatformId 无效的游戏平台识别码
6 InvalidUsername 无效的用户名
7 InvalidPassword 无效的密码
8 DuplicateUsername 用户名重复
9 InvalidExtraInfo 无效的额外信息
10 InvalidGamePlatformSettings 无效的游戏平台配置
11 InvalidBetLimit 无效的限注配置
12 InvalidActionType 无效的动作类型
13 InvalidAmount 无效的金额
14 DuplicateExternalTransId 外部交易识别码重复
15 NoEnoughBalance 余额不足
16 InvalidFromDateTime 无效的开始时间
17 InvalidToDateTime 无效的结束时间
18 InvalidExternalTransId 无效的外部交易识别码
19 SecureKeyNotAllowed 不允许此安全密钥
20 BonusRequired 需要奖金组
21 InvalidBonus 无效的奖金组
22 InvalidRebate 无效的返点比例
23 AccountDuplicated 账号用户名重复
24 SubAccountNotFound 未找到指定子账号
25 InvalidParent 无效的上级代理
26 RequestDataRequired 需要请求资料
27 RequestTooFast 请求频率过快
28 TransactionIdRequired 请传入交易号或外部交易号
29 PlayerNotFound 未找到指定玩家
30 InvalidGameCode 游戏代码无效
31 BetNotFound 未找到注单

安全模式

服务器域名或 IP

隐藏对外服务器域名或 IP,请勿直接暴露给玩家。

IP 白名单

服务器上需设置 IP 白名单。

测试环境需在管理后台增加访问游戏前端的 IP 白名单。

商户号与安全密钥

均为 32 位字符(字母与数字),由邮件发送提供。

测试密钥:dd35aPO0bd186dc6ace6We2e0fb48s70

签名密钥

均为 32 位字符(字母与数字),由邮件发送提供。

测试密钥:dd35aPO0bd186dc6ace6We2e0fb48s70

参数签名规则

  1. 所有参数默认编码为 UTF-8。
  2. 忽略参数名为 sign 的字段、值为空或类型为 object 的字段。
  3. 所有有效参数名按字母升序排序。
  4. 将排序后的所有非空参数值(不含 key)依次拼接成一个字符串,在末尾拼接上签名密钥,最后使用 SHA1 加密算法生成签名。

签名示例:

假设商户的签名密钥为 SIGN_KEY_EXAMPLE,需要对以下参数对象进行签名:

{
  "b": 1.1,
  "a": 1,
  "d": "some string",
  "e": "",
  "c": true,
  "sign": "abcdefg",
  "g": {
    "x": 1,
    "y": 2
  },
  "f": null
}

计算签名步骤如下:

  1. 忽略值为空、类型为 object 及 key 为 sign 的字段,得到:

    {
      "b": 1.1,
      "a": 1,
      "d": "some string",
      "c": true
    }
    
  2. 将 key 按字母升序排序,得到:

    {
      "a": 1,
      "b": 1.1,
      "c": true,
      "d": "some string"
    }
    
  3. 将 value(不需 key)依次拼接,并在末尾拼接签名密钥,得到签名之前的字符串:

    11.1truesome stringSIGN_KEY_EXAMPLE
    
  4. 对该字符串进行 SHA1 加密,得到最终签名值:

    91bef33b208ba98ac2d889b9c4e996651ca58146
    

身份认证

  • 使用 merchant_code(商户号)和 secure_key(安全密钥)调用登录接口获取 auth_token。
  • 每次调用业务 API 时,均需在请求参数中带上此 auth_token。

身份验证

生成 Token

使用商户号和安全秘钥生成 token

  • timeout在600之内时,会生成返回新的auth token,并刷新过期时间
Request Body schema: application/json
merchant_code
required
string
secure_key
required
string
sign
required
string

参数签名,依据安全模式的签名规则

Responses

Request samples

Content type
application/json
{
  • "merchant_code": "string",
  • "secure_key": "string",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}

玩家

创建玩家账号

创建玩家游戏账号

Request Body schema: application/json
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
username
required
string [ 6 .. 100 ] characters

玩家用户名

sign
required
string

参数签名,依据安全模式的签名规则

Responses

Request samples

Content type
application/json
{
  • "auth_token": "stringstringstringstringstringst",
  • "merchant_code": "string",
  • "username": "string",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}

查询玩家信息

查询玩家信息

query Parameters
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
username
required
string [ 6 .. 100 ] characters

玩家用户名

sign
required
string

参数签名,依据安全模式的签名规则

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}

踢出玩家

剔除玩家

Request Body schema: application/json
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
username
required
string [ 6 .. 100 ] characters

玩家用户名

sign
required
string

参数签名,依据安全模式的签名规则

Responses

Request samples

Content type
application/json
{
  • "auth_token": "stringstringstringstringstringst",
  • "merchant_code": "string",
  • "username": "string",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": "ok"
}

禁用玩家

禁用玩家

Request Body schema: application/json
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
username
required
string [ 6 .. 100 ] characters

玩家用户名

sign
required
string

参数签名,依据安全模式的签名规则

Responses

Request samples

Content type
application/json
{
  • "auth_token": "stringstringstringstringstringst",
  • "merchant_code": "string",
  • "username": "string",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}

启用玩家

启用玩家

Request Body schema: application/json
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
username
required
string [ 6 .. 100 ] characters

玩家用户名

sign
required
string

参数签名,依据安全模式的签名规则

Responses

Request samples

Content type
application/json
{
  • "auth_token": "stringstringstringstringstringst",
  • "merchant_code": "string",
  • "username": "string",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}

区块链游戏

启动游戏

启动游戏

query Parameters
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
game_code
required
string

参考游戏列表的 Game Code 值

传入 lobby 时启动游戏大厅

username
required
string [ 6 .. 100 ] characters

玩家用户名

language
required
string
Enum: "en" "zh" "vi" "th" "id" "pt" "ar" "de" "es-MX" "es" "fr" "hu" "it" "ro" "ko" "ja" "tr" "ru"
值 语系 mini 刮刮乐 slot lottery
en 英文 o o o o
zh 简体中文 o o o o
vi 越南文 o o
th 泰文 o o (not available to 3001) o
id 印尼文 o o (not available to 3001) o
pt 葡萄牙文 o o (not available to 3001) o
ar 阿拉伯语 o o
de 德语 o o
es-MX 墨西哥文 o o
es 西班牙文 o o
fr 法文 o o
hu 匈牙利语 o o
it 意大利语 o o
ro 罗马尼亚语 o o
ko 韩文 o o (not available to 3001) o
ja 日文 o o (not available to 3001) o
tr 土耳其语 o o (not available to 3001) o
ru 俄语 o o
sign
required
string

参数签名,依据安全模式的签名规则

home_link
string

如果传入,则游 戏页面会显示一个可以导向此网址的按钮

trial
boolean

是否启动试玩页面

  • 传 true 时会启动试玩页面
  • 不传入、或是传 false 时,启动正常游戏页面
  • 试玩页面的玩家独立于原玩家,有2000试玩金,不可转入和转出,试玩的游戏记录不提供拉取

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}

转账交易

玩家资金转账

玩家存款或提款

Request Body schema: application/json
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
username
required
string [ 6 .. 100 ] characters

玩家用户名

action_type
required
string
Enum: "deposit" "withdraw"

存入或提出

amount
required
number

金额,总是正数

external_trans_id
required
string <= 64 characters

外部交易号

sign
required
string

参数签名,依据安全模式的签名规则

Responses

Request samples

Content type
application/json
{
  • "auth_token": "stringstringstringstringstringst",
  • "merchant_code": "string",
  • "username": "string",
  • "action_type": "deposit",
  • "amount": 0,
  • "external_trans_id": "string",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}

查询交易记录

和 external_trans_id 至少需要传一个

query Parameters
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
sign
required
string

参数签名,依据安全模式的签名规则

transaction_id
integer

转账接口返回的 transaction_id

external_trans_id
string

调用转账接口时传入的外部订单号

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}

查询玩家余额

查询玩家余额

query Parameters
auth_token
required
string 32 characters

来自身份 认证 API

merchant_code
required
string
username
required
string [ 6 .. 100 ] characters

玩家用户名

sign
required
string

参数签名,依据安全模式的签名规则

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "code": 0,
  • "detail": {
    }
}