#小游戏服务 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-错误处理