4.9 Win/Lose Detail Report
Use these APIs to build the two report pages of one member that the back office shows:
- Page A – Ticket list: every settled ticket of a member in a date range, with stake, valid amount and win/lose.
- Page B – Ticket actions: opened from "Detail (n item.)" on a ticket. Lists every bet / payout / cancel action inside that ticket, with the credit before and after each action.
Call order: 4.9.1 get the ticket list → take preCalId of a ticket → 4.9.2 get its actions → for a "Bet Details" link, call 3.4 Game Detail with values from the action row. Provider display names come from 3.1 Get Provider Prefix List.
*username must be a member directly under your agent. It is not case-sensitive.
*Set a request timeout on your side (for example 15 seconds) and show a retry message when it is reached.
4.9.1 Get Win/Lose Ticket List (Common)
Use for Merchant get the settled tickets of one member (Page A)
Method : [Post]
Path : {{domain}}/ext/reportWinLoseDetailByUsername/{{prefix}}/{{agentUsername}}
Content-Type : application/json
Request Body
{
"agentUsername": "{{agentUsername}}",
"key": "{{key}}",
"username": "{{agentUsername}}ninemb01",
"betType": ["normal","comboStep","step","Casino","Slot","Lotto","Keno","Trade","Card","Poker","Esport","Cock","Sbo","Saba","Plb","Vsb","Fbs","Umb","Afb","Lali","Wss","Dbs","M8","Ufa","Obx","Pdx"],
"startDate": "16-11-2026",
"endDate": "17-11-2026",
"page": 1,
"limit": 100,
"gameName": [],
"web": "{{whiteLabel}}"
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| agentUsername | String | testag | The agent's username. |
| key | String | tnyENKDWvOkBXpvm6UZVa | The agent's unique key. |
| username | String | testagninemb01 | Member to report, directly under the agent. Not case-sensitive. |
| betType | Array | ["Slot","Casino"] | Ticket types to include (see the list below). Must be an array; an empty array returns nothing. Case-sensitive. |
| startDate | String | 16-11-2026 | DD-MM-YYYY, GMT+7, inclusive. |
| endDate | String | 17-11-2026 | DD-MM-YYYY, GMT+7, exclusive. For one day send the next day (16-11 → 17-11). |
*Send startDate / endDate exactly as DD-MM-YYYY. Another format is not always rejected: it can be read as a different date and return the wrong tickets without an error (for example 2026-11-01 is read as 20-11-2001). | page | Number | 1 | Page number, starts at 1. | | limit | Number | 100 | Rows per page, maximum 100 (larger values are cut to 100). | | gameName | Array | ["FOOTBALL"] | Optional. Only for Askmebet sport tickets: filter by sport type. Leave out or send [] for no filter. | | web | String | sportbook101 | Active websites. |
betType values
| betType | Ticket |
|---|---|
| normal | Askmebet sport, single bet |
| step | Askmebet sport, parlay |
| comboStep | Askmebet sport, combo |
| Sbo, Saba, Plb, Vsb, Fbs, Umb, Afb, Lali, Wss, Dbs, M8, Ufa, Obx, Pdx | Third-party sportsbooks |
| Casino, Slot, Card, Keno, Trade, Poker, Esport, Cock | Casino and games |
| Lotto | Lotto |
gameName values (sport type of Askmebet sport tickets): FOOTBALL, BASKETBALL, VOLLEYBALL, BOXING, RUGBY, HANDBALL, ICEHOCKEY, TENNIS, BULLFIGHT, BASEBALL, AMERICAN, SNOOKER, BADMINTON, TABLETENNIS.
Which tickets are returned
- Only settled tickets:
statusisdoneorcancelled. Running tickets are never returned. - Only tickets whose win/lose calculation has finished. A ticket that has just settled can take a few minutes to appear.
- The date range is matched against the settlement time (
updateDate), not the bet time. - Sorted by
updateDate, newest first.
Response
{
"code": 0,
"msg": "success",
"data": {
"docs": [
{
"_id": "6738a1f0c2b54e0012a3f0b1",
"betId": "{{hash}}#1794829800977IL45854",
"preCalId": "{{preCalId}}",
"memberId": "6738a1f0c2b54e0012a30001",
"username": "testagninemb01",
"currency": "THB",
"type": "Slot",
"betType": "Slot",
"provider": "RPG",
"gameName": "Bonanza Gold",
"gameId": ["{{gameId}}"],
"ref1": "{{ref1}}", "ref2": "{{ref2}}", "ref3": "{{ref3}}",
"betAmt": { "$numberDecimal": "-168" },
"validAmt": { "$numberDecimal": "-168" },
"winLose": { "$numberDecimal": "-133" },
"commAmt": 0,
"commRate": 0,
"stake": 12,
"status": "done",
"ip": "2001:44c8:4091:e6cc:dc8e:6495:8065:7101",
"device": "mobile",
"os": "ios",
"browser": "safari",
"createDate": "2026-11-16T11:50:00.000Z",
"updateDate": "2026-11-16T11:50:00.000Z"
}
],
"totalDocs": 7,
"limit": 100,
"page": 1,
"totalPages": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}
| Key | Type | Description |
|---|---|---|
| data.docs | Array | Tickets of this page. |
| data.totalDocs / totalPages / page / limit | Number | Paging. Request the next page with page + 1 while hasNextPage is true. |
| betId | String | Ticket ID. Show the part after # (copy the full value). Lotto: show the full value. |
| preCalId | String | Key for 4.9.2 (ticket actions). |
| type | String | Ticket type (same values as betType in the request). Decides how every column is built. |
| betType | String | Sub type. Askmebet sport: same as type. Lotto: lotto kind (thailotto, yeekeelotto, pingponglotto, zodiaclotto, ...). |
| provider | String | Provider code. Look it up in 3.1 Get Provider Prefix List (case-insensitive) for providerName and detailStatus. |
| gameName | String | Game name. Lotto: the draw (round). |
| gameId | Array | Game ID(s). |
| ref1 / ref2 / ref3 | String | Provider references (Sbo/Saba round ID is ref2). |
| betAmt | Decimal | Stake, negative. Show -betAmt. |
| validAmt | Decimal | Valid amount (turnover), negative. Show -validAmt. |
| winLose | Decimal | Member win/lose including commission. |
| commAmt | Number | Commission paid to the member. |
| commRate | Number | Commission rate, %. |
| stake | Number | Number of bet actions inside this ticket ("Detail (n item.)"). |
| status | String | done or cancelled. |
| remark | String | Reason, for cancelled tickets. |
| ip / device / os / browser | String | Member's last login when the bet arrived. unknown when not captured. |
| createDate | Date | First bet time of the ticket (UTC). |
| updateDate | Date | Settlement time (UTC). |
| sport | Array | Askmebet sport legs (normal has 1 leg, step / comboStep have several). |
| sboInfo | Array | Sbo match detail. |
| sabaInfo | Array | Saba match detail, one entry per leg. |
| lotto | Object | Lotto detail: type (position), betPosition (numbers), result (JSON string). |
betAmt, validAmt and winLose are returned as {"$numberDecimal": "..."}. Convert them to numbers before you calculate. Times are UTC; convert to GMT+7 (or the member's time zone) for display.
Error Code
| Value | msg |
|---|---|
| 0 | Success |
| 100001 | Missing 'agent Username' field. |
| 100002 | Agent username is type string. |
| 100003 | Missing 'key' field. |
| 100004 | Key is type string. |
| 100005 | Missing 'username' field. |
| 100006 | Username is type string. |
| 100012 | Key not found. |
| 100013 | Agent not found. |
| 100014 | Member not found. (no such username, or not directly under the agent) |
| 100042 | betType is not array. |
| 50010 | Something went wrong please try again. (startDate / endDate cannot be read as a date, or a temporary error: try again) |
| 106 | missing 'page' field |
| 103 | missing 'limit' field |
4.9.2 Get Ticket Actions By PreCalId (Common)
Use for Merchant get every action inside one ticket (Page B)
Method : [Post]
Path : {{domain}}/ext/winLoseFindByPreCalId/{{prefix}}/{{agentUsername}}
Content-Type : application/json
Request Body
{
"agentUsername": "{{agentUsername}}",
"key": "{{key}}",
"username": "{{agentUsername}}ninemb01",
"id": "{{preCalId}}",
"web": "{{whiteLabel}}"
}
| Key | Type | Example Value | Description |
|---|---|---|---|
| agentUsername | String | testag | The agent's username. |
| key | String | tnyENKDWvOkBXpvm6UZVa | The agent's unique key. |
| username | String | testagninemb01 | Owner of the ticket, 5–24 characters, directly under the agent. |
| id | String | {{preCalId}} | preCalId of a ticket from 4.9.1 of the same member. |
| web | String | sportbook101 | Active websites. |
- There is no paging: every action of the ticket is returned in one response.
- An
idthat does not exist returnscode: 0with an emptydataarray. - Sort the rows by
d, newest first, as the back office does. Do not rely on the order returned.
Response
{
"code": 0,
"msg": "SUCCESS",
"data": [
{
"u": "testagninemb01",
"t": "{{preCalId}}",
"p": "{{paymentId}}",
"d": "2026-11-16T11:50:24.000Z",
"l": ["PAYOUT", "{{refId}}", "{{ref1}}", "{{ref2}}", "{{ref3}}", "2026-11-16T11:50:24.000Z", 0, 10000.49, 10000.49, "RPG", "Bonanza Gold", "Slot", "{{gameId}}"]
},
{
"u": "testagninemb01",
"t": "{{preCalId}}",
"p": "{{paymentId}}",
"d": "2026-11-16T11:50:24.000Z",
"l": ["BET", "{{refId}}", "{{ref1}}", "{{ref2}}", "{{ref3}}", "2026-11-16T11:50:24.000Z", -28, 10028.49, 10000.49, "RPG", "Bonanza Gold", "Slot", "{{gameId}}"]
}
]
}
| Key | Description |
|---|---|
| u | Member username. |
| pf | Site prefix. |
| t | preCalId of the ticket. |
| p | Payment reference. |
| d | Time the action was recorded (UTC). Use it for the Date - Time column and for sorting. |
| l[0] | Action: BET, PAYOUT, CANCEL, WL, ... |
| l[1] | Provider reference ID (refId). |
| l[2] | ref1, for 3.4 Game Detail. |
| l[3] | ref2, for 3.4 Game Detail. |
| l[4] | ref3, for 3.4 Game Detail. |
| l[5] | Bet time sent by the provider, for 3.4 Game Detail (betTime). |
| l[6] | Amount of this action: negative = bet, positive or 0 = payout. |
| l[7] | Credit before the action. |
| l[8] | Credit after the action. |
| l[9] | Provider. |
| l[10] | Game name. |
| l[11] | Ticket type (Slot, Casino, Sbo, ...). |
| l[12] | Game ID, for 3.4 Game Detail (gameId). |
Newer rows can carry more items after l[12]. Ignore indexes you do not use.
Error Code
| Value | msg |
|---|---|
| 0 | Success |
| 100001 | Missing 'agent Username' field. |
| 100002 | Agent username is type string. |
| 100003 | Missing 'key' field. |
| 100004 | Key is type string. |
| 100005 | Missing 'username' field. |
| 100006 | Username is type string. |
| 100009 | Your username must be between 5 and 24 character. |
| 100012 | Key not found. |
| 100013 | Agent not found. |
| 100014 | Member not found. |
| 5044 | Permission denied (the member is not under this agent). |
| 999 | Data not found. (the log service did not answer normally; try again) |
| 998 | System error. |
4.9.3 How To Build The Pages
All amounts are shown with 2 decimals. The back office cuts extra decimals instead of rounding (12.349 → 12.34). Negative amounts are shown in red.
Page A – Ticket list
| Column | How to build it |
|---|---|
| No. | (page - 1) * limit + index + 1 |
| Information | Line 1: ticket ID = part of betId after # (Lotto: full betId), with a copy button that copies the full betId.Line 2: Sbo / Saba: Round ID: ref2 and Action Time: updateDate. Other types: label Bet Time for Slot, Card and Casino, Settle Time for the rest; value updateDate (dd/MM HH:mm:ss).Line 3: Info: ip plus device, os, browser (icons or text). |
| Event | See "Event by type" below. |
| Detail | See "Detail by type" below. |
| Status | See "Status by type" below. |
| Amount | Top: -betAmt (stake). Below, smaller: -validAmt (valid amount). |
| Member – Win Lose | winLose - commAmt |
| Member – Comm | commAmt and (commRate %) |
| Member – Total | winLose |
| Footer | Sum of the rows on the current page: -betAmt, -validAmt and winLose. |
Event by type
| type | Show |
|---|---|
| normal | sport[0].leagueName[lang]; teams sport[0].matchName[lang].h vs .a; match time sport[0].gameDate (dd/MM/yyyy HH:mm). The back office shows the team named in sport[0].ahd (h = home, a = away) in red and the other team in blue. lang is th, en, cn or tw. |
| step, comboStep | Same as normal for the first leg sport[0]. All legs are in sport[]. |
| Sbo | sboInfo[0].league, sboInfo[0].match, sboInfo[0].kickOffTime. If sboInfo[0].sportType is Mix Parlay, show only "Mix Parlay". Provider: providerName. |
| Saba | sabaInfo[0].leagueName, homeName vs awayName, matchDateTime. Provider: providerName. |
| Lotto | Provider: provider (AMBLOTTO → "Askmelotto"); lotto kind: betType; draw: gameName; result: JSON.parse(lotto.result), an object of position → numbers. |
| Trade | Game: gameName. Provider: providerName, or "Askmetrade" when not found. |
| Slot, Casino, Card, Keno, Poker, Esport, Cock, Plb, Fbs, Umb, Vsb, Dbs, Lali, Afb, Wss, M8, Ufa, Obx, Pdx | Game: gameName. Provider: providerName. |
providerName = the entry of 3.1 Get Provider Prefix List whose provider equals the ticket's provider, compared case-insensitively. Keep its detailStatus too: Page B needs it. If no entry matches, show the provider code.
Detail by type
| type | Show |
|---|---|
| Slot, Casino, Card, Keno, Trade, Poker, Esport, Cock, Plb, Fbs, Umb, Vsb, Dbs, Lali, Afb, Wss, M8, Ufa, Obx, Pdx | Link Detail (stake item.) that opens Page B with preCalId (4.9.2), and start: createDate (dd-MM-yyyy HH:mm:ss). |
| normal | Sport: sport[0].sportType.Selection: for betType ou / ou1st, option 0 = Over, 1 = Under; for oe / oe1st, 0 = Odd, 1 = Even; for the other markets, 0 = home team, 1 = away team, 2 = Draw.Stake: x -betAmt.Market: sport[0].betType: ah = HDP, ou = Over/Under, oe = Odd/Even, x12 = 1x2, ml = ML. The …1st variants are first half ("HT"); ah, ou, oe, x12 are full time ("FT").Line: [value] (not for x12, oe).Odds: Odd price plus the odds type: oddsType 0 = MY, 1 = HK, 2 = EU, 3 = ID; x12 and ml are always EU.Live bets: when table is live, add live @ info.lt (info.h : info.a), the score when the bet was placed.Cancelled ticket: strike the text through and show remark. |
| step, comboStep | "Askmebet", (Parlay) for step or (Combo) for comboStep, then x -betAmt. Clicking it shows every leg of sport[] with the same rules as normal. Total odds = product of sport[].price. |
| Sbo | sboInfo[0].sportType, sboInfo[0].betOption x -betAmt, and a Detail link: call 3.4 Game Detail with gameId: gameId[0], ref1 and ref2: ref2 without the SBO_ prefix, ref3: ref3 or "", username. |
| Saba | sabaInfo[0].sportTypeName.Single bet ( sabaInfo has 1 item): betChoice x -betAmt.Parlay (more than 1 item): (Parlay), which shows every leg of sabaInfo[] (league, home vs away, matchDateTime, betTypeName, betChoice, odds), then x -betAmt. Total odds = product of sabaInfo[].odds.Then: sabaInfo[0].betTypeName and (live) when sabaInfo[0].isLive.Odds: single bet sabaInfo[0].odds; parlay the total odds. |
| Lotto | Numbers: lotto.betPosition (for zodiaclotto: comma separated zodiac names); position: lotto.type (top3, bottom2, row2, ...); discount: commRate %. |
Status by type
| type | Show |
|---|---|
| normal, step, comboStep | Cancelled when status is cancelled. Otherwise Win when winLose > 0, Draw when = 0, Lose when < 0. You can add the final score from sport[0].result (periodScores: first half / full time / quarters). |
| Sbo, Saba, Plb, Umb, Fbs, Vsb, Afb, Dbs, Lali, Wss, M8, Ufa, Obx, Pdx | Payout when betAmt is 0, Bet when betAmt < 0. |
Lotto with betType yeekeelotto, thailotto or pingponglotto | Win when winLose >= 0, otherwise Lose. |
| Everything else | - |
Page B – Ticket actions
Call 4.9.2 with the ticket's preCalId and sort the rows by d, newest first.
| Column | How to build it |
|---|---|
| No. | Row number. |
| Date - Time | d (dd-MM-yyyy HH:mm:ss). |
| Action | l[0] in title case: BET → Bet, PAYOUT → Payout, CANCEL → Cancel. |
| Game / Provider | l[10] (l[9]) |
| Game Detail | A Bet Details link when any of these is true:• l[0] is WL• l[0] is PAYOUT and the ticket's provider has detailStatus: true in 3.1 Get Provider Prefix List• l[11] is one of Sbo, Saba, Plb, Vsb, Fbs, Umb, M8, Ufa, Obx, Pdx• l[1] starts with PDX_The link calls 3.4 Game Detail with gameId: l[12], ref1: l[2], ref2: l[3], ref3: l[4], betTime: l[5], username: u and opens data.url in a new tab. Success is code: "0000" (a string); otherwise show description. |
| Bet / Payout | l[6], red when negative, blue otherwise. |
| Before Credit | l[7] |
| After Credit | l[8] |
| Total | Sum of l[6]. It normally equals Member – Win Lose of the ticket on Page A (winLose - commAmt). |
The currency of every amount is the ticket's currency.