Skip to main content

Sub-Merchant Bet Records (Fetch Latest)

1. Sub-Merchant Bet Records (Fetch Latest)

Interface Path

  • Get
  • /api/game/transaction/sub/latest

Description

  • Query the latest bet orders of sub-merchants under the main merchant
  • Fetch the latest bet orders by the last time
  • A maximum of 1000 records can be fetched at a time
  • Bet orders are sorted by "update time"
  • Please use the "update time" of the last record from the previous fetch as the starting time for the next search
  • Note: If no orders are fetched in a certain fetch, set the next fetch time to one minute before the current time

Interface Frequency Description

  • The query bet records API can be called at most once every 5 seconds

Request Parameters

ParameterNameTypeRequiredDescription
agent_idMerchant IDstringRequiredMain merchant ID, used to verify the signature
sub_agent_idSub-Merchant IDstringOptionalSpecify a sub-merchant ID; if not passed, returns bet orders of all direct sub-merchants
last_timeLast TimestringRequiredIn milliseconds
timestampCurrent Timestampint64RequiredTimestamp when calling the interface (in milliseconds, valid for ten minutes)
signSignaturestringRequiredSignature algorithm details in the interface description

Description

  • agent_id is the main merchant ID, required, used to verify the whitelist and signature
  • When sub_agent_id is passed, the interface verifies whether the sub-merchant belongs to agent_id; a non-direct sub-merchant will return a parameter error
  • When sub_agent_id is not passed, returns bet orders of all direct sub-merchants under agent_id
  • sub_agent_id participates in the signature calculation (must be included in the signature when it has a value)

Response Parameters

ParameterNameTypeDescription
codeResponse CodeintError Code
messageResponse MessagestringError Message
dataResponse DatadictResponse Data Details
--transactionsBet Order ListListBet Order List
----idOrder IDstringOrder ID
----game_idGame IDstringGame ID, 101: Baccarat
----user_idUser IDstringUser ID
----inst_idTable IDstringTable ID
----shoe_idShoe IDint64Shoe ID
----round_idRound IDint64Round ID
----bet_timeBet Timeint64Bet Time
----settle_timeSettle Timeint64Settle Time
----bet_amountBet AmountstringBet Amount
----real_bet_amountReal Bet AmountstringReal Bet Amount
----valid_bet_turnovervalid bet turnoverstringvalid bet turnover
----win_amountPayout AmountstringPayout Amount
----real_win_amountReal Win AmountstringReal Win Amount = Payout Amount - Bet Amount
----currencyCurrencystringCurrency
----bet_detailBet DetailsdictBet Details, the key is the bet item, the value is the bet amount
----win_detailWin DetailsdictWin Details, the key is the bet item, the value is the win amount
----no_commcommission freebooleancommission free
----game_resultGame ResultArrayGame Result
----open_cardsOpen Cardsdictbanker: Banker, player: Player, result: game result
----create_timeOrder Create Timeint64Order Create Time
----update_timeOrder Update Timeint64Order Update Time
----statusOrder Statusint320- Bet Placed, 1- Settled, 2- Unsettled Order Changed to Invalid, 3- Invalid Order, 4- Settled Changed to Invalid

Bet Items Description

Bet ItemDescription
TieTie
BankerBanker
PlayerPlayer
BigBig
SmallSmall
PlayerPairPlayer Pair
BankerPairBanker Pair
Super6Super 6
PDragonBonusPlayer Bonus
BDragonBonusBanker Bonus
AnyPairAny Pair
PerfectPairPrefect Pair
PlayerNaturalPlayer Natural
BankerNaturalBanker 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"
SuitDescription
HeartsHearts
DiamondsDiamonds
ClubsClubs
SpadesSpades

Request Example (Specified Sub-Merchant)

curl --location 'https://staging.aig1234.com/api/game/transaction/sub/latest?agent_id=agent001&sub_agent_id=sub001&last_time=1732589000000&timestamp=1734417236278&sign=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json'

Request Example (All Direct Sub-Merchants)

curl --location 'https://staging.aig1234.com/api/game/transaction/sub/latest?agent_id=agent001&last_time=1732589000000&timestamp=1734417236278&sign=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json'

Response Example

{
"code": 200,
"message": "success",
"data": {
"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",
"currency": "USD",
"real_win_amount": "100.00",
"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
}
]
}
}

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