#小遊戲服務 REST API 參考
本文檔描述了小遊戲軟體服務API。
版本:1.0 基礎URL:{{API_BASE_URL}}/api/minigame 方案:HTTPS
#端點
#1. 列出注單
端點:GET /games/sw/tickets
摘要:根據查詢參數列出注單。
權限:minigame.sw.tickets.list
產生:application/json
安全:BearerAuth(授權:承載abcde12345)
#請求
CURL:
curl -X GET "{{API_BASE_URL}}/api/minigame/games/sw/tickets?id=ticket-uuid-123&betTimeFrom=2025-01-25T00:00:00.000+01:00&betTimeTo=2025-01-26T00:00:00.000+01:00&page=1&size=10" \
-H "Authorization: Bearer abcde12345" \
-H "Accept: application/json"
參數:
- 查詢:
id(字串,可選):UUIDbetTimeFrom(字串,可選):ISO 日期時間betTimeTo(字串,可選):ISO 日期時間page(整數,可選):頁碼size(整數,可選):頁面大小
#回應
200 好 描述:注單列表 類型:數組 Schema:
{ id: string; accountId: string; username: string; ccy: string; timeBet: string; totalBetAmt: number; totalBetUnit: number; totalWonAmt: number; totalWonUnit: number; totalPayoutAmt: number; betItems: { betLocation: string; betAmt: number; wonAmt: number; }[]; status: string; issueId: string; result: string; scheduler: string; createdAt: string; }[]關於 BCR
betItems[].betLocation值,請參閱投注類型。對於status,請參閱投注/注單狀態。關於result,請參閱百家樂結果格式。範例:
[ { "id": "ticket-uuid-123", "accountId": "account-uuid-123", "username": "testuser", "ccy": "PHP", "timeBet": "2025-01-25T00:00:00.000+01:00", "totalBetAmt": 100.00, "totalBetUnit": 1, "totalWonAmt": 200.00, "totalWonUnit": 1, "totalPayoutAmt": 300.00, "betItems": [ { "betLocation": "LIVE_BCR_PLAYER", "betAmt": 100.00, "wonAmt": 200.00 } ], "status": "WON", "issueId": "BCR_MB550-250711-0236", "result": "33,37-29,29", "scheduler": "BCR_MB550", "createdAt": "2025-01-25T00:00:00.000+01:00" } ]有關錯誤狀態(4xx、5xx),請參閱 API 錯誤處理
#2.透過ID取得注單
端點:GET /games/sw/tickets/{id}
總結:根據 ID 取得注單。
權限:minigame.sw.tickets.get
產生:application/json
安全:BearerAuth(授權:持有者abcde12345)
#請求
CURL:
curl -X GET "{{API_BASE_URL}}/api/minigame/games/sw/tickets/ticket-uuid-123" \
-H "Authorization: Bearer abcde12345" \
-H "Accept: application/json"
參數:
- 路徑:id(必填,類型:字串):注單 ID
#回應
200 好 描述:注單詳細信息 類型:對象 Schema:
{ id: string; accountId: string; username: string; ccy: string; timeBet: string; totalBetAmt: number; totalBetUnit: number; totalWonAmt: number; totalWonUnit: number; totalPayoutAmt: number; betItems: { betLocation: string; betAmt: number; wonAmt: number; }[]; status: string; issueId: string; result: string; scheduler: string; createdAt: string; }有關 BCR
betItems[].betLocation值,請參閱投注類型。對於status,請參閱投注/注單狀態。關於result,請參閱百家樂結果格式。範例:
{ "id": "ticket-uuid-123", "accountId": "account-uuid-123", "username": "testuser", "ccy": "PHP", "timeBet": "2025-01-25T00:00:00.000+01:00", "totalBetAmt": 100.00, "totalBetUnit": 1, "totalWonAmt": 200.00, "totalWonUnit": 1, "totalPayoutAmt": 300.00, "betItems": [ { "betLocation": "LIVE_BCR_PLAYER", "betAmt": 100.00, "wonAmt": 200.00 } ], "status": "WON", "issueId": "BCR_MB550-250711-0236", "result": "33,37-29,29", "scheduler": "BCR_MB550", "createdAt": "2025-01-25T00:00:00.000+01:00" }有關錯誤狀態(4xx、5xx),請參閱 API-錯誤處理