修訂歷程
| Date | Version | Editor | Change log | 
|---|---|---|---|
| 2025/06/30 | 1.0.28 | Frank | 1. 新增 1.1.4 Key產生器範例程式碼 | 
| 2024/11/27 | 1.0.27 | Alex | 2. 更新語系參數 | 
| 2024/9/30 | 1.0.26 | Alex | 1. 棄用免費遊戲 | 
| 2024/9/4 | 1.0.25 | Tyler | 1. Login API 棄用公告 | 
AgentId 又稱為站長 Id。
不同站別使用 AgentId 用於區分。
建立站長時再與我司同步,建立規則可接受英數混合,包含下底線。
(不建議使用特殊字元)
同一 AgentKey 下不允許重複玩家帳號名稱,即使屬於不同
AgentId。建議營運商在玩家帳號加上前綴作區別。
舉例來說,假如站長 WYZ_ABET 已經創立/登入 (2.1.2 回傳登入網址) 會員
johndoetest123, 那麼另一個站長 WYZ_ZBET 就不再允許創立/登入同樣名為
johndoetest123 的會員。
遊戲列表在上線前由我司商務提供,不附在本文件內。
DB 時區採用 UTC +7 時區。
所有請求需要包含以下參數:
| Parameter | Type | Description | 
|---|---|---|
| AgentId | string | 代理編號 | 
| Key | string | 驗證參數 (產生方式見1.1.2 Key 產生方式) | 
若使用 HTTP POST 請求, 請用 x-www-form-urlencoded 來傳遞參數。
所有回應會包含以下參數:
| Parameter | Type | Description | 
|---|---|---|
| ErrorCode | int | 錯誤代碼 | 
| Message | string | 狀態描述 | 
| Data | Object | 資料資料 | 
遊戲商 的回應皆為 JSON 格式。
Key = {6個任意字元} + MD5(所有請求參數串+ KeyG) + {6個任意字元}
6個任意字元:為隨機產生,前後不需相同,驗證時不看任意字元。
所有請求參數串:依照API參數清單,按順序以key1=value1&key2=value2格式串起
所有 API 的請求參數字串最後都要加上AgentId=xxx
例如: LoginWithoutRedirect (2.1.2 回傳登入網址), 表格列出了 Token, GameId, Lang, HomeUrl,Platform, disableFullScreen
其中後三項不列入加密計算,因此只需要前三項,按照表格所列順序並加上 AgentId,組成以下字串:
Token=Test1&GameId=101&Lang=zh-CN&AgentId=10081
KeyG = MD5(DateTime.Now.ToString("yyMMd") + AgentId + AgentKey)
DateTime.Now = 當下時間(固定採用 UTC-4 時區,不適用日光節約時間), 格式為 yyMMd
America/Puerto_Rico 或 America/Santo_Domingo舉例來說, 查詢當下時間是 UTC+7 時區 2018/9/30 10:00, 換算為 UTC-4
時區為 2018/9/29 23:00, 因此應該採用的時間字串為 180929
請注意日期格式:
例如:2018/2/7 => 18027(7號是 7 不是 07)
2018/2/18 => 180218
以 2.1.2 回傳登入網址 為例
產生KeyG
| Name | Value | 
|---|---|
| AgentKey | be8e08f95357d215921f91c6a533f74d3194de52 | 
| AgentId | abcd_RMB | 
| 加密時間 | 2019/01/01 | 
string now = Datetime.Now.ToString("yyMMd"); // 2019/01/01 => "19011"
string agentId = "abcd_RMB";
string agentKey = "be8e08f95357d215921f91c6a533f74d3194de52";
string keyG = MD5(now + agentId + agentKey);
KeyG  
= MD5("19011abcd_RMBbe8e08f95357d215921f91c6a533f74d3194de52")  
= 9424ffdd6de016a5f90a97a55d99c717
產生Key
| Name | Value | 
|---|---|
| Token | Test006 | 
| GameId | 1 | 
| Lang | zh-CN | 
string keyG = "9424ffdd6de016a5f90a97a55d99c717"
string querystring = "Token=Test006&GameId=1&Lang=zh-CN&AgentId=abcd_RMB";
string md5string = MD5(queryString + keyG);
string randomText1 = "123456"; // Random
string randomText2 = "abcdef"; // Random
string key = randomText1 + md5string + randomText2;
md5string =
MD5("Token=Test006&GameId=1&Lang=zh-CN&AgentId=abcd_RMB9424ffdd6de016a5f90a97a55d99c717")
= 3e4c3b321eac16f20633f683be08d237
Key = "1234563e4c3b321eac16f20633f683be08d237abcdef"
| Name | Result | 
|---|---|
| md5string | 3e4c3b321eac16f20633f683be08d237 | 
| Key | 1234563e4c3b321eac16f20633f683be08d237abcdef | 
| LoginUrl | <API URL>/singleWallet/LoginWithoutRedirect?Token=Test006&GameId=1&Lang=zh-CN&AgentId=abcd_RMB&Key=1234563e4c3b321eac16f20633f683be08d237abcdef  | 
我們提供各種程式語言的 Key產生範例程式碼,協助開發者快速整合:
這些範例包含完整的Key產生邏輯,可依據使用的程式語言選擇對應範例直接參考使用。
| 项目 | 内容 | 
|---|---|
| URL | <API URL>/singleWallet/LoginWithoutRedirect | 
| Method | POST | 
| Return | JSON | 
| Description | 回傳登入網址,不直接導入遊戲。 | 
Request :
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Token | string | Yes | 營運商 api access token (最長 800 字元) | 
| GameId | int | Yes | 遊戲唯一識別值 | 
| Lang | string | Yes | UI語系, 請參考附錄A - 語系參數 | 
| HomeUrl | string | No | 不列入md5加密,遊戲回主頁功能導向位置 | 
| Platform | string | No | 不列入md5加密, 玩家裝置資訊, 請參考 4.2.3 玩家注單 (下注與結算同時發送), 4.2.7 牌局型注單 (下注和結算分別發送) | 
| disableFullScreen | int | No | 不列入md5加密, 帶入1即關閉全螢幕模式 | 
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Data | string | Yes | 遊戲入口網址 P.S. 網址以 JSON 編碼存放於 Data 欄位,須用 JSON 解碼擷取才可使用;此連結只可使用一次。  | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 2 | Invalid Key | Key 驗證失敗 (請參考1.1.2 Key 產生方式 ) | 
| 9 | api auth fail | 向營運商發送 auth 驗證 token 失敗 | 
| 9 | Site master not found | AgentId 不存在 (詳見 0. 設定與注意事項) | 
| 9 | Site master mismatched | 玩家帳號與 AgentId 不匹配 (詳見 0. 設定與注意事項) | 
| 104 | invalid currency from auth | 營運商於 auth 回傳錯誤或禁用的貨幣 | 
Token 值由營運商產生帶入,用於詢問營運商 API (auth,
4.2.2 驗證帳號),進行此次帳號登入驗證並且取回帳號資料,若取回帳號資料為首次都入則會自動建立帳號資料
請求範例
/singleWallet/LoginWithoutRedirect
Token=Test001&GameId=1&Lang=en-US&AgentId=abcd_THB&Key=000000b7caea5de85c5e829bc88b56e15cd6fa000000
回應範例
{
    "ErrorCode": 0,
    "Message": "success",
    "Data": "https://www.xxxxx.com/fish/index.html?ssoKey=e79576885ebfc13084bf46a2e2930b121f31ff37&lang=en-US&gameID=1"
}
| URL | <API URL>/api1/KickMember | 
|---|---|
| Method | POST | 
| Return | JSON | 
| Description | 強制會員從遊戲註銷。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Account | string | Yes | 會員唯一識別值 | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 註銷成功 | 
| 101 | Invalid Member | 會員帳號不存在/不在線上 | 
| Item | Content | 
|---|---|
| URL | <API URL>/api1/KickMemberAll | 
| Method | POST | 
| Return | JSON | 
| Description | 強制會員從遊戲註銷。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| GameId | int | No | 遊戲的唯一識別值 | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 註銷成功 | 
QueryString範例:
// 不傳參數:強制登出所有會員
AgentId=abcd_RMB
// 傳GameId:強制登出在該遊戲內的所有會員
GameId=1&AgentId=abcd_RMB
| 项目 | 内容 | 
|---|---|
| URL | <API URL>/api1/GetGameDetailUrl | 
| Method | POST | 
| Return | JSON | 
| Description | 取得一局遊戲詳細資訊的 URL | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| WagersId | bigint | Yes | 在遊戲內注單唯一值 | 
| Lang | string | NO | 指定語系 P.S. 計算 key 時請忽視  | 
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Url | string | Yes | 遊戲詳細結果 Url | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 查詢成功 | 
| 101 | Record Not Exist | 遊戲紀錄不存在 | 
請求範例
/GetGameDetailUrl
WagersId=987654321&AgentId=abcd_THB&Key=00000027521e5e5f46acb9ad81c129d7f4dd2e000000
回應範例
{
    "ErrorCode": 0,
    "Message": "success",
    "Data": {
        "Url": "https://www.xxxxx.com/en-US/ingame/gamehistory?token=0adf022bc84b549db4a201b8a7bbc2280aaeea41&ri=987654321&li=987654321"
    }
}
| 项目 | 内容 | 
|---|---|
| URL | <API URL>/GetBetRecordSummary | 
| Method | POST | 
| Return | JSON | 
| Description | 取得 時間範圍 內一款遊戲注單統計數值 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| StartTime | DateTime | Yes | 查詢開始時間 | 
| EndTime | DateTime | Yes | 查詢結束時間 | 
| GameId | int | No | 遊戲的唯一識別值 未帶時, 回傳結果為所有遊戲加總 P.S. 計算 key 時請忽視  | 
| Currency | string | No | 查詢貨幣代碼 未帶時, 回傳結果所有幣別都會個別加總 P.S. 計算 key 時請忽視  | 
| FilterAgent | bool | No | 只查詢所帶之代理 (AgentId) 下的注單統計 未帶時, 回傳結果為所有代理加總 P.S. 計算 key 時請忽視  | 
| GroupByGame | int | No | 查詢結果依照遊戲分開統計 0 或不帶 = 不啟用 1 = 啟用 P.S. 計算 key 時請忽視  | 
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| BetAmount | decimal(16,4) | Yes | 投注總金額 | 
| PayoffAmount | decimal(16,4) | Yes | 派彩總金額 | 
| WagersCount | int | Yes | 注單數量 | 
| Currency | string | Yes | 注單幣別 | 
| GameId | int | No | 遊戲的唯一識別值 只使用於 GroupByGame=1 時  | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 查詢成功 | 
| 2 | Invalid Key | 檢查碼錯誤 | 
| 101 | Invalid DateTime | 不正確的時間格式,或開始時間大於結束時間 | 
| 4 | (other failures) | 其他錯誤 | 
Sample : 時間格式請參考下列
 StartTime = '2020-09-02T00:00:00';
 EndTime = '2020-09-02T23:59:59';
回傳值範例:
{
    "ErrorCode": 0,
    "Message": "",
    "Data": [
        {
            "BetAmount": 3002.5,
            "PayoffAmount": 1.95,
            "Turnover": 3002.5,
            "Preserve": 0,
            "WagersCount": 6,
            "Currency": "THB"
        }
    ]
}
{
    "ErrorCode": 0,
    "Message": "",
    "Data": [
        {
            "BetAmount": 2.5,
            "PayoffAmount": 1.95,
            "Turnover": 2.5,
            "Preserve": 0,
            "WagersCount": 5,
            "Currency": "THB",
            "GameId": 108
        },
        {
            "BetAmount": 3000,
            "PayoffAmount": 0,
            "Turnover": 3000,
            "Preserve": 0,
            "WagersCount": 1,
            "Currency": "THB",
            "GameId": 182
        }
    ]
}
| URL | <API URL>/GetGameList | 
|---|---|
| Method | POST | 
| Return | JSON | 
| Description | 查詢所有遊戲的 GameId、名稱、類型等資訊 | 
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| GameId | int | Yes | 遊戲的唯一識別值 | 
| name | object | Yes | zh-CN:簡體中文名稱 zh-TW:繁體中文名稱 en-US:英文名稱  | 
| GameCategoryId | int | Yes | 遊戲類型: 請參考附錄D - 遊戲類型 | 
| JP | boolean | Yes | true: 此款遊戲內建 JP false: 無內建 JP  | 
請求範例
/GetGameList
AgentId=abcd_THB&Key=0000006b5536a736536e46080b3df80f5cc7aa000000
回應範例
{
    "ErrorCode": 0,
    "Message": "success",
    "Data": [
        {
            "GameId": 1,
            "name": {
                "en-US": "Royal Fishing",
                "zh-CN": "钱龙捕鱼",
                "zh-TW": "錢龍捕魚"
            },
            "GameCategoryId": 5,
            "JP": false
        },
        {
            "GameId": 2,
            "name": {
                "en-US": "Chin Shi Huang",
                "zh-CN": "秦皇传说",
                "zh-TW": "秦皇傳說"
            },
            "GameCategoryId": 1,
            "JP": false
        },
        {
            "GameId": 4,
            "name": {
                "en-US": "God Of Martial",
                "zh-CN": "关云长",
                "zh-TW": "關雲長"
            },
            "GameCategoryId": 1,
            "JP": false
        }
    ]
}
| URL | <API URL>/GetMustHitBy | 
|---|---|
| Method | POST | 
| Return | JSON | 
| Description | 以遊戲ID查詢取得滿額必開資訊 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| GameId | Int | No | 遊戲唯一識別值。不帶值則會回傳全部遊戲的滿額必開資訊。 P.S. 計算 key 時請忽略 GameId  | 
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Currency | String | Yes | 幣別名稱 | 
| Game | String | Yes | 遊戲名稱 | 
| GameId | Int | Yes | 遊戲ID識別值 | 
| MustHitByPool | Decimal | Yes | 滿額必開水箱 | 
| MustHitByValue | Decimal | Yes | 滿額必開數值 | 
Error code:
| Error Code | Message | Description | |
|---|---|---|---|
| 0 | Success | 查詢成功 | |
| 9 | Execution Error | 後端執行錯誤 | |
| 101 | Record Not Exist | 紀錄不存在 | 
請求範例
/GetMustHitBy
AgentId=abcd_THB&Key=000000eb51beeeab91421619241e4d9e6f79a2000000
回應範例
{
    "ErrorCode": 0,
    "Message": "success",
    "Data": [
        {
            "Currency": "THB",
            "Game": "CrazySeven",
            "GameId": 35,
            "MustHitByPool": 2459.8625,
            "MustHitByValue": 3000
        },
        {
            "Currency ": "THB",
            "Game": "Bao boon chin",
            "GameId": 36,
            "MustHitByPool ": 2413.6871,
            "MustHitByValue ": 3000
        },
        {
            "Currency ": "THB",
            "Game": "Dragon Treasure",
            "GameId": 46,
            "MustHitByPool": 3000,
            "MustHitByValue": 3000
        },
        {
            "Currency ": "THB",
            "Game": "SuperAce",
            "GameId": 49,
            "MustHitByPool": 2937.4401,
            "MustHitByValue": 3000
        }
    ]
}
| URL | <API URL>/GetMemberInfo | 
|---|---|
| Method | POST | 
| Return | JSON | 
| Description | 查詢會員帳號當前狀態、現有額度等資訊。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Accounts | string | Yes | 會員唯一識別值 • 查詢多個使用者:用逗號分開 • 查詢單一使用者  | 
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Account | string | Yes | 會員唯一識別值 | 
| Balance | Decimal(16,4) | Yes | 會員錢包餘額 (帳號不存在時為 0)* | 
| Status | int | Yes | 狀態: 1: 線上 2: 離線 3: 帳號不存在  | 
* 回傳的錢包餘額並非即時, 會有數秒的延遲
QueryString範例:
//查詢單一使用者
Accounts=Test001&AgentId=abcd_RMB
//查詢多個使用者:用逗號分開
Accounts=Test001,Test002&AgentId=abcd_RMB
請求範例
/GetMemberInfo
Accounts=Test001&AgentId=abcd_THB&Key=000000446c647a1b506110747564e7a416efeb000000
回應範例
{
    "ErrorCode": 0,
    "Message": "success",
    "Data": [
        {
            "Account": "Test001",
            "Balance": 260.03,
            "Status": 2
        }
    ]
}
| URL | https://wbgame.tadagaming.com/partner-gaming-assets/{game-id}/icon/{image-name}.png | 
|---|---|
| Description | 取得遊戲Icon {game-id}: 遊戲唯一識別值(請參考遊戲列表 ) {image-name}: 遊戲Icon尺寸,目前可用尺寸如下表所示  | 
| 220x290 | 245x245 | 260x380 | 300x220 | 
|---|---|---|---|
| 326x572 | 500x560 | 538x384 | 900x600 | 
| 900x900 | 900x1344 | 
請求範例:
https://wbgame.tadagaming.com/partner-gaming-assets/260/icon/900x600.png
回應範例:
營運商至少需要提供 auth, bet, cancelBet 三支 API,
其他的可與遊戲商討論是否有此需求。
須提供資訊
<api_url> 營運商 API 接口位置
所有請求接使用 HTTP POST
參數傳遞回傳使用 JSON 格式
HTTP request header:
Content-type: application/json
營運商的 response 應為 JSON 格式, 並包含以下共通欄位:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| errorCode | int | Yes | 查詢成功與否的狀態碼, 0 表示成功,  其他值請參考各 API  | 
| message | string | No | 查詢失敗時的錯誤訊息,  查詢成功或不需要時可省略  | 
提示: 營運商可考慮採用 UUID, MD5
或是任何可以產生不重複字串的演算法來產生 token。
Token有效期限由營運商自行決定。
| URL | <API URL>/auth | 
|---|---|
| Method | POST | 
| Return | JSON | 
| Description | 驗證是否為合法玩家 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| reqId | string | Yes | 請求的識別唯一代碼,用於後續追查 API 呼叫狀況 | 
| token | string | Yes | 營運商 api access token (最長 800 字元) | 
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| username | string | Yes | 帳號唯一識別名稱 | 
| currency | string | Yes | 身上持有貨幣種名稱, 請參考附錄B - 貨幣代碼 | 
| balance | double | Yes | 持有貨幣量 | 
| token | string | No | 營運商 api access token 若有更新需要以此欄位回傳  | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 查詢成功 | 
| 4 | Token expired | Api access token 已過期或無效 | 
| 5 | Other error | 其他錯誤 (詳情請放到 message 欄位) | 
範例 Post Body
{
    "reqId": "0af0c835-c37b-5da0-9e4e-25463e6ed14d",
    "token": "6f6d63331c1173c8367e43b5fe6c49dd"
}
回應範例
{
    "errorCode": 0,
    "message": "success",
    "username": "testUser",
    "currency": "USD",
    "balance": 1000,
    "token": "6f6d63331c1173c8367e43b5fe6c49dd"
}
本節所述的 bet 用於老虎機和魚機遊戲,押分機遊戲請參考 4.2.7 牌局型注單 (下注和結算分別發送)
| Item | Content | 
|---|---|
| URL | <API URL>/bet | 
| Method | POST | 
| Return | JSON | 
| Description | 傳送一筆玩家注單給營運商。此注單之中包含了結算。 若因為網路或其他因素而未獲得營運商的回應, 遊戲商可以: 1. 取消該注單 (請見 4.2.5 取消注單 (回滾下注及結算)); 2. 或重送該注單 (請見 4.2.6 重送注單)。 預設會發送取消。營運商可要求遊戲商重送該注單,不過當達到重送次數上限之後,遊戲商仍會發送取消。營運商與遊戲商應事先約定好要採取哪一種行動。  | 
請使用以下公式來處理注單請求:
If 下注前餘額 >= betAmount then
	下注後餘額 = 下注前餘額 – betAmount + winloseAmount
Else
	下注失敗
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| reqId | string | Yes | 請求識別碼。同一注單重送請求時會與前次不同。 (長度最長50) | 
| token | string | Yes | 營運商 api access token | 
| currency | string | Yes | 貨幣名稱 | 
| game | int | Yes | 遊戲代碼 | 
| round (*) | bigint | Yes | 注單唯一識別值 (等同 3.1.3 取得注單詳細結果連結 WagersId) | 
| wagersTime | bigint | Yes | 注單結帳時間戳記 | 
| betAmount | double | Yes | 押注金額 | 
| winloseAmount | double | Yes | 派彩金額 | 
| userId | string | No | 玩家帳號唯一值 (依營運商需求帶入) | 
| transactionId | bigint | No | 魚機遊戲大單號 (依營運商需求帶入) | 
| platform | string | No | 玩家裝置資訊 (依營運商需求帶入; 營運商須在 LoginWithoutRedirect 2.1.2 回傳登入網址 帶入) | 
| statementType | int | No | 注單類型 (依營運商需求帶入; 請參考附錄C - 注單類型 | 
| gameCategory | int | No | 遊戲類型 (依營運商需求帶入; 請參考附錄D - 遊戲類型 | 
round 參數是玩家注單的唯一識別值。取消注單也是以此識別。
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| username | string | Yes | 帳號唯一識別名稱 | 
| currency | string | Yes | 身上持有貨幣種名稱 | 
| balance | double | Yes | 持有貨幣量 | 
| txId | bigint | No | 營運商承認注單後提供的交易識別唯一值 (注單已承認也請附上)  | 
| token | string | No | 營運商 api access token 若有更新需要以此欄位回傳  | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 注單成功 | 
| 1 | Already accepted | 該注單已承認 | 
| 2 | Not enough balance | 玩家餘額不足 | 
| 3 | Invalid parameter | 參數無效 (詳情請放到 message 欄位) | 
| 4 | Token expired | Api access token 已過期或無效 | 
| 5 | Other error | 其他錯誤 (詳情請放到 message 欄位) | 
請求範例 Post Body
{
    "reqId": "9177b749-cf37-585b-b17c-cfd5024ca6e2",
    "token": "6f6d63331c1173c8367e43b5fe6c49dd",
    "currency": "USD",
    "game": 1,
    "round": 17238050501001102002,
    "wagersTime": 1592559162,
    "betAmount": 10,
    "winloseAmount": 5
}
回應範例
{
    "errorCode": 0,
    "message": "success",
    "username": "testUser",
    "currency": "USD",
    "balance": 995,
    "txId": 108430126,
    "token": "6f6d63331c1173c8367e43b5fe6c49dd"
}
本節所述的 cancelBet 用於老虎機和魚機遊戲,押分機遊戲請參考4.2.8 取消牌局型注單 (回滾一筆下注)
| URL | <API URL>/cancelBet | 
|---|---|
| Method | POST | 
| Return | JSON | 
| Description | 取消一筆注單。玩家的下注額應退回,而派獎則要扣除。 遊戲商應持續發送直到獲得營運商回應。 此項請求可於玩家離線時發送, token 可能已經失效, 因此除了玩家最後一次使用的 token 之外還會帶上 userId, 營運商可自行選擇使用 userId 或 token 來識別玩家身分。  | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| reqId | string | Yes | 請求識別碼。同一取消重送請求時會與前次不同。 (長度最長50) | 
| currency | string | Yes | 貨幣名稱 | 
| game | int | Yes | 遊戲代碼 | 
| round (*) | bigint | Yes | 注單唯一識別值 (等同 4.2.3 玩家注單 (下注與結算同時發送) round) | 
| betAmount | double | Yes | 押注金額 | 
| winloseAmount | double | Yes | 派彩金額 | 
| userId | string | Yes | 玩家帳號唯一值 | 
| token | string | Yes | 該注單發生時的 token | 
round 參數是玩家注單的唯一識別值。取消注單也是以此識別。
請使用以下公式來處理取消:
取消後餘額 = 取消前餘額 + betAmount – winloseAmount
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| username | string | Yes | 帳號唯一識別名稱 | 
| currency | string | Yes | 身上持有貨幣種名稱 | 
| balance | double | Yes | 持有貨幣量 | 
| txId | bigint | No | 營運商取消注單後提供的交易識別唯一值 (注單已取消也請附上)  | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 取消成功 | 
| 1 | Already canceled | 該注單已取消 | 
| 2 | Round not found | 注單無效 | 
| 3 | Invalid parameter | 參數無效 (詳情請放到 message 欄位) | 
| 5 | Other error | 其他錯誤 (詳情請放到 message 欄位) | 
| 6 | Already accepted and cannot be canceled | 注單已成立不可取消 | 
請求範例 Post Body
/cancelBet
{
    "reqId": "9177b749-cf37-585b-b17c-cfd5024ca6e2",
    "currency": "USD",
    "game": 1,
    "round": 17238050501001102002,
    "betAmount": 10,
    "winloseAmount": 5,
    "userId": "3368799_2679638",
    "token": "6f6d63331c1173c8367e43b5fe6c49dd"
}
回應範例
{
    "errorCode": 0,
    "message": "success",
    "username": "testUser",
    "currency": "USD",
    "balance": 1000,
    "txId": 108430126
}
許多原因都可能導致注單未能正確獲得營運商的回應,
例如網路延遲導致連線逾時或線路品質不良而的遺失封包。如果營運商允許,
遊戲商可重送注單。
重送注單依照以下規則進行:
如果仍未獲得回應, 遊戲商會再嘗試重送。連同第一次發送,
同一筆注單最多發送 3 次。此次數可依營運商需求調整;
若 3 次都未獲得回應, 則依照 4.2.5 取消注單 (回滾下注及結算) 向營運商取消該筆注單;
當營運商收到一筆已經認可的注單時, 回應中的 error code 可以是 0
也可以是 1, 前者表示成功而後者表示該注單已經認可過 (請參考 4.2.3 玩家注單 (下注與結算同時發送));
回應中仍需要有該玩家所持有的餘額。
回應範例
{
    "errorCode": 1,
    "message": "already accepted",
    "username": "testUser",
    "currency": "USD",
    "balance": 995,
    "txId": 108430126,
    "token": "6f6d63331c1173c8367e43b5fe6c49dd"
}
牌局型遊戲又稱為桌上遊戲,包含押分機、賓果等類型,有些可以多人共玩而有些只有單人進行遊戲。不論是哪一類型,同一局的每個玩家會有一個獨一無二的局號
(sessionId);一局之中玩家可能有一次或多次下注,以及唯一的一次結算。每個下注或結算都有一個獨一無二的交易序號
(round)。
Bet
{
    "token": "token_player_a",
    "sessionId": 111001,
    "round": 23004,
    "type": 1
}
Settle
{
    "token": "token_player_a",
    "sessionId": 111001,
    "round": 23007,
    "type": 2
}
| URL | <API URL>/sessionBet | 
|---|---|
| Method | POST | 
| Return | JSON | 
| Description | 傳送一筆牌局型玩家注單給營運商, 用於有開牌結算的遊戲。 分成下注及結算兩類型。 若因為網路或其他因素而未獲得營運商的回應, 遊戲商會採取以下行為: 1. 結算前,取消當筆下注並中止牌局,然後進行結算; 2. 結算後會將派彩發送給營運商,若不成功須持續發送; 達到n次不成功 (預設n=10) 時,遊戲商應立即通知營運商進行處理。 取消牌局型注單請參考 4.2.8 取消牌局型注單 (回滾一筆下注)。 P.S. 由於結算有可能發生在玩家離線之後, 因此牌局型注單會有參數 userId, 營運商可自行選擇用 token 或 userId 識別玩家身分。 另一種方式是使用離線模式 (非必要)。  | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| reqId | string | Yes | 請求識別碼。同一結算重送請求時會與前次不同。 (長度最長50) | 
| token | string | Yes | 營運商 api access token | 
| currency | string | Yes | 貨幣名稱 | 
| game | int | Yes | 遊戲代碼 | 
| round (*) | bigint | Yes | 下注/結算請求唯一識別值。等同於交易序號。 | 
| offline | boolean | No | 請參考離線模式 (非必要) | 
| wagersTime | bigint | Yes | 時間戳記 (依 type 不同為下注時間或結帳時間) | 
| betAmount | double | Yes | 押注金額 | 
| winloseAmount | double | Yes | 派彩金額 | 
| sessionId (**) | bigint | Yes | 牌局唯一識別值 (所有下注及結算共用同一值, 等同 3.1.3 取得注單詳細結果連結 WagersId) | 
| type | int | Yes | 注單類型: 1=下注 2=結算  | 
| userId | string | No | 玩家帳號唯一值。結算 (type=2) 時必帶; 下注 (type=1) 時依營運商需求帶入。 | 
| turnover | double | Yes | 有效投注金額, 結算才會帶入 (請參考Turnover (有效投注額) 一節), 無 turnover 設定 0 | 
| preserve | double | Yes | 預扣金額 (僅用於有預先扣款機制的遊戲,SSS目前無此類遊戲), 無 preserve 設定 0 | 
| platform | string | No | 玩家裝置資訊 (依營運商需求帶入; 營運商須在 LoginWithoutRedirect 2.1.2 回傳登入網址 帶入) | 
| sessionTotalBet | double | No | 牌局全部下注總和 (依營運商需求帶入; 只在結算時帶入) | 
| statementType | int | No | 注單類型 (依營運商需求帶入; 請參考附錄C - 注單類型 | 
| gameCategory | int | No | 遊戲類型 (依營運商需求帶入; 請參考附錄D - 遊戲類型 | 
表格註解
依照 preserve 的使用與否,遊戲可分成兩種類型:
無 preserve
下注: preserve = 0, betAmount > 0, winloseAmount = 0
下注後餘額 = 下注前餘額 – betAmount
結算: preserve = 0, betAmount = 0, winloseAmount >= 0
結算後餘額 = 結算前餘額 + winloseAmount
有 preserve
下注: preserve > 0, betAmount = 0, winloseAmount = 0
下注後餘額 = 下注前餘額 – preserve
結算: preserve > 0, betAmount >= 0, winloseAmount >= 0
結算後餘額 = 結算前餘額 + preserve – betAmount + winloseAmount
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| username | string | Yes | 帳號唯一識別名稱 | 
| currency | string | Yes | 身上持有貨幣種名稱 | 
| balance | double | Yes | 持有貨幣量 | 
| txId | bigint | No | 營運商承認注單後提供的交易識別唯一值 (注單已承認也請附上)  | 
| token | string | No | 營運商 api access token 若有更新需要以此欄位回傳  | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 注單成功 | 
| 1 | Already accepted | 該注單已承認 | 
| 2 | Not enough balance | 玩家餘額不足 | 
| 3 | Invalid parameter | 參數無效 (詳情請放到 message 欄位) | 
| 4 | Token expired | Api access token 已過期或無效 | 
| 5 | Other error | 其他錯誤 (詳情請放到 message 欄位) | 
範例:
下注請求 Post Body (無 preserve)
/sessionBet
{
    "reqId": "b682cf4c-4de8-433c-92aa-8c03f7daf002",
    "token": "6f6d63331c1173c8367e43b5fe6c49dd",
    "currency": "INR",
    "game": 72,
    "round": 1709179916462815072,
    "wagersTime": 1714107576,
    "betAmount": 10,
    "winloseAmount": 0,
    "sessionId": 1709179916462705072,
    "type": 1,
    "preserve": 0
}
結算請求 Post Body (無 preserve)
/sessionBet
{
    "reqId": "d8729e34-36c7-4750-87c1-0d0283f7ace7",
    "token": "6f6d63331c1173c8367e43b5fe6c49dd",
    "currency": "INR",
    "game": 72,
    "round": 1709179916462915072,
    "wagersTime": 1714107599,
    "betAmount": 0,
    "winloseAmount": 55,
    "sessionId": <span class="mark">1709179916462705072</span>,
    "type": 2,
    "turnover": 22,
    "preserve": 0
}
下注請求 Post Body (有 preserve)
/sessionBet
{
    "reqId": "e4034252-86ca-40dc-9e29-8a9beb24f28c",
    "token": "ae97a7179a4bc47a99c753704a340f82",
    "currency": "THB",
    "game": 94,
    "round": 1654662770005413094,
    "wagersTime": 1655192382,
    "betAmount": 0,
    "winloseAmount": 0,
    "sessionId": <span class="mark">1654662770005303094</span>,
    "type": 1,
    "preserve": 12800
}
結算請求 Post Body (有 preserve)
/sessionBet
{
    "reqId": "63b3e8ba-53fe-48e6-b2c3-ac218b89a1c7",
    "token": "ae97a7179a4bc47a99c753704a340f82",
    "currency": "THB",
    "game": 94,
    "round": 1654662770005513094,
    "wagersTime": 1655192471,
    "betAmount": 912,
    "winloseAmount": 18240,
    "sessionId": <span class="mark">1654662770005303094</span>,
    "type": 2,
    "turnover": 912,
    "preserve": 12800
}
回應
{
    "errorCode": 0,
    "message": "success",
    "username": "testUser",
    "currency": "USD",
    "balance": 995,
    "txId": 108430126,
    "token": "6f6d63331c1173c8367e43b5fe6c49dd"
}
如果營運方並未依照玩家投注額給予返水,請忽略 turnover 欄位。
Turnover 並不意味著牌局中的投注額——儘管在大多數遊戲中,這個數值與玩家的整局的投注額 (betAmount) 總和相等。如果營運方依照玩家的投注額給予玩家某個比率的返水(如下圖),那麼營運商應該考慮使用 turnover 作為返水的計算依據而非 betAmount。
請考慮以下情境: 某款骰子遊戲中,玩家可同時押大和小,而兩邊的賠率都是 2倍。如果玩家每次都對大和小各押 100,那麼每一局玩家都可獲得 200 的派獎,以及營運商給予的返水。
玩家可以持續每次下注 200 並獲得 210!
為了防止這種套利行為,這類的遊戲我們提供不同於 betAmount 的 turnover
如下:
𝑡𝑢𝑟𝑛𝑜𝑣𝑒𝑟 = min(𝑏𝑒𝑡𝐴𝑚𝑜𝑢𝑛𝑡, |𝑤𝑖𝑛𝑙𝑜𝑠𝑒𝐴𝑚𝑜𝑢𝑛𝑡 − 𝑏𝑒𝑡𝐴𝑚𝑜𝑢𝑛𝑡|)
套用在前一個例子上,turnover = min(200, |200-200|) = 0。當營運方以 turnover 作為依據來計算返水時,此例中的返水會是 0。
牌局型注單的結算 (/sessionBet with type=2) 或取消 (/cancelSession) 送出時所帶的 token
可能已過期,營運商可要求遊戲商使用離線模式。
離線模式預設並不啟用。此模式下會帶 offline 參數 (其值恆為 true) 及離線 token
營運商需要先給予遊戲商離線token 金鑰,營遊戲商藉此用以下公式產生離線 token:
SHA224(<離線 token 金鑰> + <round id> + <session id> + '_' + <user id>)
舉例來說, 當離線 token 金鑰為 AAAA-BBBB-CCCC-DDDD, 若 round=26727840008124608, sessionId=26727838908124090, userId=APLAYER 以離線模式發送結算, 則 token 為:
SHA224(AAAA-BBBB-CCCC-DDDD2672784000812460826727838908124090_APLAYER) = 1cb22d550f2d7e755631435c28b9a08b08519f49f6fba46095f755b6
遊戲商將發送以下請求給營運商:
{
    "reqId": "0d8098b1-1ee2-47cb-b159-9149e2fb945b",
    "token": "1cb22d550f2d7e755631435c28b9a08b08519f49f6fba46095f755b6",
    "currency": "USD",
    "game": 124,
    "round": 26727840008124608,
    "offline": true,
    "wagersTime": 1687348800,
    "betAmount": 0,
    "winloseAmount": 0,
    "sessionId": 26727838908124090,
    "type": 2,
    "turnover": 60
}
請注意離線模式下 offline 的值為 true 且不會帶 userId。
| URL | <API URL>/cancelSessionBet | 
|---|---|
| Method | POST | 
| Return | JSON | 
| Description | 取消一筆牌局型注單。 遊戲商應持續發送直到獲得營運商回應。此項請求可於玩家離線時發送, token 可能已經失效, 因此除了玩家最後一次使用的 token 之外還會帶上 userId, 營運商可自行選擇使用 userId 或 token 來識別玩家身分。  | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| reqId | string | Yes | 請求識別碼。同一請求重送時會與前次不同。 (長度最長50) | 
| currency | string | Yes | 貨幣名稱 | 
| game | int | Yes | 遊戲代碼 | 
| round (*) | bigint | Yes | 下注請求唯一識別值 (等同 4.2.7 牌局型注單 (下注和結算分別發送) round) | 
| offline | boolean | No | 請參考離線模式 | 
| betAmount | double | Yes | 押注金額 type=1 為該筆投注金額,  | 
| winloseAmount | double | Yes | 派彩金額。此請求中恆為 0。 | 
| userId | string | Yes* | 玩家帳號唯一值 | 
| token | string | Yes | 該注單發生時的 token 或離線模式的 token | 
| sessionId | bigint | Yes | 牌局唯一識別值 (等同 4.2.7 牌局型注單 (下注和結算分別發送) sessionId) | 
| type | int | Yes | 注單類型: 1=下注  | 
| preserve | double | No | 預扣金額 (等同 4.2.7 牌局型注單 (下注和結算分別發送) preserve) | 
表格註解
請以下列公式來取消牌局型注單的下注:
無 preserve
取消後餘額 = 取消前餘額 + betAmount
有 preserve
取消後餘額 = 取消前餘額 + preserve
Response:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| username | string | Yes | 帳號唯一識別名稱 | 
| currency | string | Yes | 身上持有貨幣種名稱 | 
| balance | double | Yes | 持有貨幣量 | 
| txId | bigint | No | 營運商取消注單後提供的交易識別唯一值 (注單已取消也請附上)  | 
Error code:
| Error Code | Message | Description | 
|---|---|---|
| 0 | Success | 取消成功 | 
| 1 | Already canceled | 該注單已取消 | 
| 2 | Round not found | 注單無效 | 
| 3 | Invalid parameter | 參數無效 (詳情請放到 message 欄位) | 
| 5 | Other error | 其他錯誤 (詳情請放到 message 欄位) | 
說明:
牌局型注單的特性是,必須等前一筆下注成功了才會進行下一筆,下注都成功後會進行結算,或是某一筆下注失敗後中止牌局也進行結算。
取消下注 (type=1):
成功時只會取消單筆下注,同局的其他下注不受影響。正常情況下,只會取消最後一筆下注,而且必須是還未結算的牌局。
接受取消後,這一局就不可再接受任何下注,只會有結算。之後遊戲商對同一局發送的下注無效。
有可能因為網路延遲或其他因素,導致營運商在收到下注前就收到取消,對營運商來說是取消一筆不存在的下注,這時營運商應注記該局為失敗,之後同一局的下注均無效。
正常情況遊戲商不會在結算後發送 type 1
取消。但有可能因為網路延遲或其他因素,導致營運商在結算後才收到 type
1 的取消。若營運商收到此種 type 1
取消,應取消該筆下注,原因是遊戲商是以該筆下注失敗為前提進行結算。
遊戲商不會對結算 (type=2) 發送取消。
| 語系 | 代碼 | 
|---|---|
| 英文 | en-US | 
| Currency ID | Currency | Description | Notes | 
|---|---|---|---|
| 81 | GC | Gold Coins | |
| 80 | SC | Sweep Coins | USD to SC = 1:1 | 
※ 以上為TaDa Games目前提供的貨幣,如有其他需求請向我司客服人員提出,謝謝。
| 代碼 | 注單類型 | |
|---|---|---|
| 1 | 一般下注 | |
| 11 | 道具卡 | |
| 12 | 購買 bonus | |
| 17 | 滿額必開 (下注) | |
| 18 | 滿額必開 (開獎) | 
| 代碼 | 遊戲類型 | 
|---|---|
| 1 | 電子 | 
| 2 | 棋牌 | 
| 3 | 遊戲大廳 | 
| 5 | 捕魚 | 
| 8 | 押分機 (含賓果) | 
本節列出目前可用的 HTTP 驗證。
HTTP Basic Authentication 是由 username 與 password 組成並作 Base64
運算得到簡易認證碼,
請參考維基百科獲取更多資訊;
username 和 password 由營運商提供。
範例如下:
HTTP request header:
Authorization: Basic YWJjOmFiYzEyMw==
以下為一個帶有 http basic authentication 的完整 auth 請求 (4.2.2 驗證帳號):
Header:
Authorization: Basic YWJjOmFiYzEyMw==
Content-Type: application/json
Body:
{
    "reqId": "011d3624-90cd-477b-bf05-b8b2c623ee45",
    "token": "dc7b7f79187bbc17cc2994965a736a9c"
}
測試工具由游戲商提供,通過此工具可對營運商提供API (4.2 API)進行測試。提供查詢範例以及實際呼叫營運商API的功能。僅限測試環境中執行。
<API URL> 游戲商API接口位置
所有回應會包含以下參數:
| Parameter | Type | Description | 
|---|---|---|
| ErrorCode | int | 錯誤代碼 | 
| Message | string | 狀態描述 | 
| Data | Object | 資料資料 | 
Data内會包含以下資料
| Parameter | Type | Description | 
|---|---|---|
| Request Header | Object | 傳送的HTTP請求的Header | 
| [Authorization] HTTP Basic Authentication | Object | HTTP驗證的範例 | 
| Request Body | Object | 游戲商傳送的HTTP請求 | 
| Response | Object | 營運商 API 回傳的HTTP回應 | 
{
    "Request Header": {
        "Content-type": "application/json",
        "(Optional) Authorization": "Basic ZGVtbzpwQDU1dzByZA=="
    },
    "[Authorization] HTTP Basic Authentication": {
        "Format": "username:password",
        "Encoding": "Base64 encoded",
        "Sample": "demo:p@55w0rd",
        "Sample Encoded String": "ZGVtbzpwQDU1dzByZA=="
    }
}
查詢每支API的請求與回應範例,僅供營運商參考,並非實際傳送請求。
| URL | <API URL>/sample/auth | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 查詢auth API範例。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Token | string | No | 營運商 api access token (最長 800 字元) 若沒帶入則顯示範例Token  | 
{
    "Request Body": {
        "reqId": "0af0c835-c37b-5da0-9e4e-25463e6ed14d",
        "token": "{Player's Token}"
    },
    "Response": {
        "errorCode": 0,
        "message": "success",
        "username": "{Player's Username}",
        "currency": "{Player's Currency}",
        "balance": 1000,
        "token": "{Player's Token}"
    }
}
| URL | <API URL>/sample/bet | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 查詢bet API範例。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Token | string | No | 營運商 api access token (最長 800 字元) 若沒帶入則顯示範例Token  | 
{
    "Request Body": {
        "reqId": "9177b749-cf37-585b-b17c-cfd5024ca6e2",
        "token": "{Player's Token}",
        "currency": "{Player's Currency}",
        "game": 9,
        "round": 1723805050100110200,
        "wagersTime": 1592559162,
        "betAmount": 10,
        "winloseAmount": 5,
        "userId": "{Player's UserID}",
        "transactionId": 1630891368000155009
    },
    "Response": {
        "errorCode": 0,
        "message": "success",
        "username": "{Player's Username}",
        "currency": "{Player's Currency}",
        "balance": 1000,
        "txId": 108430126,
        "token": "{Player's Token}"
    }
}
| URL | <API URL>/sample/cancelBet | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 查詢cancelBet API範例。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Token | string | No | 營運商 api access token (最長 800 字元) 若沒帶入則顯示範例Token  | 
{
    "Request Body": {
        "reqId": "e4034252-86ca-40dc-9e29-8a9beb24f28c",
        "currency": "{Player's Currency}",
        "game": 9,
        "round": 1723805050100110200,
        "betAmount": 10,
        "winloseAmount": 5,
        "userId": "{Player's User ID}",
        "token": "{Player's Token}"
    },
    "[Bet Request Body]": {
        "reqId": "9177b749-cf37-585b-b17c-cfd5024ca6e2",
        "token": "{Player's Token}",
        "currency": "{Player's Currency}",
        "game": 9,
        "round": 1723805050100110200,
        "wagersTime": 1592559162,
        "betAmount": 10,
        "winloseAmount": 5,
        "userId": "{Player's UserID}",
        "transactionId": 1630891368000155009
    },
    "Response": {
        "errorCode": 0,
        "message": "success",
        "username": "{Player's Username}",
        "currency": "{Player's Currency}",
        "balance": 1000,
        "txId": 108430126,
    }
}
| URL | <API URL>/sample/sessionBet | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 查詢sessionBet API範例 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Token | string | No | 營運商 api access token (最長 800 字元) 若沒帶入則顯示範例Token  | 
| Type | int | No | 注單類型: 1=下注 2=結算 若沒帶入則顯示下注類型  | 
| Preserve | double | No | 預扣金額 | 
{
    "Request Body": {
        "reqId": "e4034252-86ca-40dc-9e29-8a9beb24f28c",
        "token": "{Player's Token}",
        "currency": "{Player's Currency}",
        "game": 94,
        "round": 1654662770005413094,
        "wagersTime": 1655192382,
        "betAmount": 100,
        "winloseAmount": 0,
        "sessionId": 1654662770005303094,
        "type": 1,
        "userId": "{Player's UserID}",
        "turnover": 0,
        "preserve": 1000
    },
    "Response": {
        "errorCode": 0,
        "message": "success",
        "username": "{Player's Username}",
        "currency": "{Player's Currency}",
        "balance": 1000,
        "txId": 108430126,
        "token": "{Player's Token}"
    }
}
| URL | <API URL>/sample/cancelSessionBet | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 查詢cancelSessionBet API範例。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| Token | string | No | 營運商 api access token (最長 800 字元) 若沒帶入則顯示範例Token  | 
| Preserve | double | No | 預扣金額 | 
{
    "Request Body": {
        "reqId": "9177b749-cf37-585b-b17c-cfd5024ca6e2",
        "currency": "{Player's Currency}",
        "game": 94,
        "round": 1654662770005413094,
        "betAmount": 0,
        "winloseAmount": 0,
        "userId": "{Player's User ID}",
        "token": "{Player's Token}",
        "sessionId": 1654662770005303094,
        "type": 1,
        "preserve": 1000
    },
    "[Session Bet Request Body]": {
        "reqId": "e4034252-86ca-40dc-9e29-8a9beb24f28c",
        "token": "{Player's Token}",
        "currency": "{Player's Currency}",
        "game": 94,
        "round": 1654662770005413094,
        "wagersTime": 1655192382,
        "betAmount": 100,
        "winloseAmount": 0,
        "sessionId": 1654662770005303094,
        "type": 1,
        "userId": "{Player's UserID}",
        "turnover": 0,
        "preserve": 1000
    },
    "Response": {
        "errorCode": 0,
        "message": "success",
        "username": "{Player's Username}",
        "currency": "{Player's Currency}",
        "balance": 1000,
        "txId": 108430126,
    }
}
呼叫營運商API傳送HTTP請求,並從營運商API取得回傳值。營運商須接收並回應游戲商傳送的HTTP請求。營運商呼叫此測試工具時須帶入Token、AgentID及Key,以進行加解密動作。
| URL | <API URL>/test/auth | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 實際呼叫營運商auth API進行測試。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| AgentId | string | Yes | 代理編號 | 
| Key | string | Yes | 驗證參數 (產生方式見 1.1.2 Key 產生方式) | 
| Token | string | Yes | 營運商 api access token (最長 800 字元) | 
{
    "Request Body": {
        "reqId": "71d19bc8-90ec-4f25-8472-d6cb0361ab46",
        "token": "793a4f6faf057353d44ee70cb6596cb5"
    },
    "Response": {
        "errorCode": 0,
        "message": "token verify success",
        "username": "test_user_id",
        "currency": "THB",
        "balance": 101400,
        "token": "793a4f6faf057353d44ee70cb6596cb5"
    }
}
| URL | <API URL>/test/bet | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 實際呼叫營運商bet API進行測試。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| AgentId | string | Yes | 代理編號 | 
| Key | string | Yes | 驗證參數 (產生方式見 1.1.2 Key 產生方式) | 
| Token | string | Yes | 營運商 api access token (最長 800 字元) | 
| UserId | string | No | 玩家帳號唯一值,若沒帶入則采用測試工具預設值 | 
{
    "Request Body": {
        "reqId": "dc996964-31ff-4002-a408-4800adc859ee",
        "token": "52adb8d42ec8241dc3bd3e80d6227a87",
        "currency": "THB",
        "game": 9,
        "round": 1699426561000030052,
        "wagersTime": 1699426561,
        "betAmount": 10,
        "winloseAmount": 5
    },
    "Response": {
        "errorCode": 0,
        "message": "user bet success",
        "username": "test_user_id",
        "currency": "THB",
        "balance": 101400,
        "txId": 1699426561000030052,
        "token": "52adb8d42ec8241dc3bd3e80d6227a87"
    }
}
| URL | <API URL>/test/cancelBet | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 實際呼叫營運商cancelBet API進行測試。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| AgentId | string | Yes | 代理編號 | 
| Key | string | Yes | 驗證參數 (產生方式見 1.1.2 Key 產生方式) | 
| Token | string | Yes | 營運商 api access token (最長 800 字元) | 
| UserId | string | No | 玩家帳號唯一值,若沒帶入則采用測試工具預設值 | 
{
    "Request Body": {
        "reqId": "dc996964-31ff-4002-a408-4800adc859ee",
        "currency": "THB",
        "game": 9,
        "round": 1699426769000040045,
        "betAmount": 10,
        "winloseAmount": 5,
        "userId": "test_userId",
        "token": "52adb8d42ec8241dc3bd3e80d6227a87"
    },
    "[Bet Request Body]": {
        "reqId": "b1efe8f5-3fed-4445-8fee-f86d43e66e50",
        "token": "52adb8d42ec8241dc3bd3e80d6227a87",
        "currency": "THB",
        "game": 9,
        "round": 1699426769000040045,
        "wagersTime": 1699426769,
        "betAmount": 10,
        "winloseAmount": 5
    },
    "Response": {
        "errorCode": 0,
        "message": "Cancel bet success",
        "username": "test_user_id",
        "currency": "THB",
        "balance": 101400,
        "txId": 1699426561000030052
    }
}
| URL | <API URL>/test/sessionBet | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 實際呼叫營運商sessionBet API, 傳送下注及結算請求進行測試。 若有多筆下注機制, 會傳送兩筆下注請求。  | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| AgentId | string | Yes | 代理編號 | 
| Key | string | Yes | 驗證參數 (產生方式見 1.1.2 Key 產生方式) | 
| Token | string | Yes | 營運商 api access token (最長 800 字元) | 
| GameType | int | Yes | 游戲類型: 1. 賓果類  | 
| UserId | string | No | 玩家帳號唯一值,若沒帶入則采用測試工具預設值 | 
{
    "Request Body (Bet 1)": {
        "reqId": "efbe63b0-b2d0-457a-ab75-12dc63349084",
        "token": "52adb8d42ec8241dc3bd3e80d6227a87",
        "currency": "THB",
        "game": 199,
        "round": 1699428150000120079,
        "wagersTime": 1699428150,
        "betAmount": 100,
        "winloseAmount": 0,
        "sessionId": 1699428150000110079,
        "type": 1,
        "userId": "test_user_id",
        "turnover": 0
    },
    "Response (Bet 1)": {
        "errorCode": 0,
        "message": "user bet success",
        "username": "test_user_id",
        "currency": "THB",
        "balance": 101400,
        "txId": 1699428150000120079,
        "token": "52adb8d42ec8241dc3bd3e80d6227a87"
    },
    "Request Body (Settle)": {
        "reqId": "b2da30b2-9c97-4763-8923-2bc6e9ce7aa8",
        "token": "52adb8d42ec8241dc3bd3e80d6227a87",
        "currency": "THB",
        "game": 199,
        "round": 1699428408000170072,
        "wagersTime": 1699428408,
        "betAmount": 100,
        "winloseAmount": 200,
        "sessionId": 1699428150000110079,
        "type": 2,
        "userId": "test_user_id",
        "turnover": 0
    },
    "Response (Settle)": {
        "errorCode": 0,
        "message": "user bet success",
        "username": "test_user_id",
        "currency": "THB",
        "balance": 101500,
        "txId": 1699428408000170072,
        "token": "52adb8d42ec8241dc3bd3e80d6227a87"
    }
}
| URL | <API URL>/test/cancelSessionBet | 
|---|---|
| Method | GET | 
| Return | JSON | 
| Description | 實際呼叫營運商cancelSessionBet API進行測試。 | 
Request:
| Parameter | Type | Require | Description | 
|---|---|---|---|
| AgentId | string | Yes | 代理編號 | 
| Key | string | Yes | 驗證參數 (產生方式見 1.1.2 Key 產生方式) | 
| Token | string | Yes | 營運商 api access token (最長 800 字元) | 
| GameType | int | Yes | 游戲類型: 1. 賓果類  | 
| UserId | string | No | 玩家帳號唯一值,若沒帶入則采用測試工具預設值 | 
{
    "Request Body": {
        "reqId": "efbe63b0-b2d0-457a-ab75-12dc63349084",
        "currency": "THB",
        "game": 216,
        "round": 1699428150000120079,
        "betAmount": 100,
        "winloseAmount": 0,
        "userId": "test_user_id",
        "token": "52adb8d42ec8241dc3bd3e80d6227a87",
        "sessionId": 1699428150000110079,
        "type": 1
    },
    "[Session Bet Request Body]": {
        "reqId": "b2da30b2-9c97-4763-8923-2bc6e9ce7aa8",
        "token": "52adb8d42ec8241dc3bd3e80d6227a87",
        "currency": "THB",
        "game": 216,
        "round": 1699428150000120079,
        "wagersTime": 1699428408,
        "betAmount": 100,
        "winloseAmount": 0,
        "sessionId": 1699428150000110079,
        "type": 1,
        "userId": "test_user_id",
        "turnover": 0
    },
    "Response (Settle)": {
        "errorCode": 0,
        "message": "Cancel bet success",
        "username": "test_user_id",
        "currency": "THB",
        "balance": 101500,
        "txId": 1699428408000170072
    }
}