Query Bet Records (By Time Period)
1. Query Bet Records (By Time Period)
Interface Path
- Get
- /api/game/transaction/query
Description
- The query interface uses a pagination mode. For example, if there are 269 records in the time range 1732589000000 - 1732600000000, set 100 records per page
- For the first page, set the start-index parameter to 0 and the page-size parameter to 100
- For the second page, set start-index += 100 to 100, and page-size to 100
- For the third page, set start-index += 100 to 200, and page-size to 100
- And so on
Query Time Description
- Bet records can only be queried for data within the last three months
- The time span between start_time and end_time should be less than 1 day
Interface Frequency Description
- The query bet records API can be called at most once every 5 seconds
Request Parameters
| Parameter | Name | Type | Required | Description |
|---|---|---|---|---|
| agent_id | Merchant ID | string | Required | Merchant ID |
| start_time | Order Update Time, Start Time (inclusive) | string | Required | In milliseconds |
| end_time | Order Update Time, End Time (exclusive) | string | Required | In milliseconds |
| start_index | Pagination Start Index | string | Required | Pagination Start Index |
| page_size | Pagination Page Size | string | Required | Pagination Page Size, value cannot be greater than 5000 |
| timestamp | Current Timestamp | int | Required | Timestamp when calling the interface (in milliseconds, valid for ten minutes) |
| sign | Signature | string | Required | Signature algorithm details in the interface description |
Response Parameters
| Parameter | Name | Type | Description |
|---|---|---|---|
| code | Response Code | int | Error Code |
| message | Response Message | string | Error Message |
| data | Response Data | dict | Response Data Details |
| --start_index | Start Index | int | Start Index |
| --page_size | Orders Per Page | int | Orders Per Page |
| --total | Total Bet Orders in Time Period | int | Total Bet Orders in Time Period |
| --transactions | Bet Order List | List | Bet Order List |
| ----id | Order ID | string | Order ID |
| ----game_id | Game ID | string | Game ID, 101: Baccarat |
| ----user_id | User ID | string | User ID |
| ----inst_id | Table ID | string | Table ID |
| ----shoe_id | Shoe ID | int | Shoe ID |
| ----round_id | Round ID | int | Round ID |
| ----bet_time | Bet Time | int | Bet Time |
| ----settle_time | Settle Time | int | Settle Time |
| ----bet_amount | Bet Amount | string | Bet Amount |
| ----real_bet_amount | Real Bet Amount | string | Real Bet Amount |
| ----valid_bet_turnover | valid bet turnover | string | valid bet turnover |
| ----win_amount | Payout Amount | string | Payout Amount |
| ----currency | Currency | string | Currency |
| ----real_win_amount | Real Win Amount | string | Real Win Amount = Payout Amount - Bet Amount |
| ----bet_detail | Bet Details | dict | Bet Details, the key is the bet item, the value is the bet amount |
| ----win_detail | Win Details | dict | Win Details, the key is the bet item, the value is the win amount |
| ----no_comm | commission free | boolean | commission free |
| ----game_result | Game Result | Array | Game Result |
| ----open_cards | Open Cards | dict | banker: Banker, player: Player, result: game result |
| ----create_time | Order Create Time | int | Order Create Time |
| ----update_time | Order Update Time | int | Order Update Time |
| ----status | Order Status | int | 0- Bet Placed, 1- Settled, 2- User Cancelled, 3- Invalid Order, 4- Settlement Changed to Invalid |
Bet Items Description
| Bet Item | Description |
|---|---|
| Tie | Tie |
| Banker | Banker |
| Player | Player |
| Big | Big |
| Small | Small |
| PlayerPair | Player Pair |
| BankerPair | Banker Pair |
| Super6 | Super 6 |
| PDragonBonus | Player Bonus |
| BDragonBonus | Banker Bonus |
| AnyPair | Any Pair |
| PerfectPair | Prefect Pair |
| PlayerNatural | Player Natural |
| BankerNatural | Banker Natural |
Card Face Description
- The open card face is concatenated into a string in the order of opening
- For example, if the first card of the player is Hearts A, the second card is Clubs 6, and the third card is Diamonds J, the concatenated string is "HeartsA,Clubs6,DiamondsJ"
| Suit | Description |
|---|---|
| Hearts | Hearts |
| Diamonds | Diamonds |
| Clubs | Clubs |
| Spades | Spades |
Request Example
curl --location 'https://staging.aig1234.com/api/game/transaction/query?agent_id=agent001&start_time=1732589000000&end_time=1732600000000&start_index=0&page_size=100×tamp=1734417699302&sign=60694d77140617133bb4143311c25e09' \
--header 'Content-Type: application/json'
Response Example (Baccarat)
{
"code": 200,
"message": "success",
"data": {
"start_index": 0,
"page_size": 100,
"total": 169,
"transactions": [
{
"id": "67453d0923c36d2571d40815",
"user_id": "7797",
"game_id": "101",
"inst_id": "iN95KcYR",
"shoe_id": 10907,
"round_id": 9,
"bet_time": 1732590857359,
"settle_time": 1732590881164,
"bet_amount": "100",
"real_bet_amount": "100",
"valid_bet_turnover": "100",
"win_amount": "200.00",
"real_win_amount": "100.00",
"currency": "USD",
"bet_detail": {
"Banker": 100
},
"win_detail": {
"Banker": "200.00"
},
"no_comm": true,
"game_result": [
"Banker",
"Big"
],
"open_cards": {
"banker": "Spades9,Hearts5",
"player": "Clubs7,Clubs7,DiamondsA"
},
"create_time": 1732590857359,
"update_time": 1732590857359,
"status": 1
}
]
}
}
Response Example(Roulette)
{
"code": 200,
"message": "success",
"data": {
"transactions": [
{
"id": "680a233460cb3650c0aae542",
"user_id": "uid001",
"game_id": "103",
"inst_id": "VaoXMa",
"shoe_id": 13282,
"round_id": 13282,
"bet_time": 1745494836924,
"settle_time": 1745494881014,
"bet_amount": "250",
"real_bet_amount": "250",
"valid_bet_turnover": "250",
"win_amount": "300.00",
"real_win_amount": "50.00",
"currency": "VND2",
"bet_detail": {
"Direct-11": 50,
"Dozen-2": 50,
"Odd": 50,
"Red": 50,
"Small": 50
},
"win_detail": {
"Direct-11": "0.00",
"Dozen-2": "0.00",
"Odd": "100.00",
"Red": "100.00",
"Small": "100.00"
},
"no_comm": false,
"game_result": [
"Red",
"Odd",
"Small",
"Column-1",
"Dozen-1"
],
"open_cards": {
"result": "7"
},
"create_time": 1745494836924,
"update_time": 1745494881014,
"status": 1
}
]
}
}
Error Codes
200 Success
408000 Request Parameter Error
408003 Whitelist Restriction
408004 API Frequency Limit
600100 Invalid Signature
600101 Invalid Parameter
700101 Merchant Does Not Exist
700401 Query Time Error