Action 20: Side Bet
Side Bet: a player’s additional wager placed alongside the main game. This API is the bet-and-settle flow of a side bet (bet and payout completed in one call).
Function Description
- This API is called when a player places a side bet, informing you of the side bet result and completing bet and settlement in one call.
- A side bet belongs to the same spin as the main game, but it is an independent bet and settlement; it does not affect the main game bet or settlement. Each has its own history ID.
- The side bet balance check is based on “the balance at the moment the spin started − the main game bet”. Since the main game has already been settled, the current balance includes the main game win; please subtract
mainWinfirst before confirming whether the player’s balance is sufficient, and after deducting or adding funds with netWin, return the remaining amount to the player.- If the player’s balance minus
mainWinis greater than or equal to |bet|, this request should be processed. - If the player’s balance minus
mainWinis less than |bet|, please return error code 6006.
- If the player’s balance minus
betis always negative;netWin=win+bet(can be positive or negative).- The following cases are considered retryable transaction failures. The request is resent with the same
transferIdusing exponential backoff for up to about 1 hour. See Transaction Flow below for the exact schedule:- The response times out, or the HTTP status is not 200.
- The HTTP status is 200, but the response is empty, is not valid JSON, or is missing required response parameters.
- The response
statusis not0000,6006, or9007.
9007means Unknown action. It terminates resending immediately and is not added to the failed transaction list. Return this status only when Action 20 has not been integrated correctly.
Idempotency (must implement): this request uses transferId as the idempotency key.
- If the
transferIdwas already charged successfully → return the previous result (0000) and do not charge again. - If the
transferIdhas not been charged successfully yet (previous attempt failed / incomplete) → process this request normally (this is a retry, not a duplicate).
Transaction Flow
Resend schedule
- The first resend happens immediately after the failed attempt.
- The interval then doubles each time: 1, 2, 4, 8, 16 and 32 minutes.
- Counting from the moment the compensation starts, the attempts land at roughly T+0, T+1, T+3, T+7, T+15, T+31 and T+63 minutes, up to 7 attempts in total.
- These times are approximate and are not guaranteed to fall on exact minute marks.
- Resending stops after an overall window of about 1 hour.
Request Parameter
| Parameter | Format | Description |
|---|---|---|
| action | Integer | 20 |
| ts | Long | Current system time |
| transferId | Long | Idempotency key, Transfer ID; the same value is sent on retries, deduplicate by it |
| historyId | String(200) | Side bet history ID in the format sidebet_{gameHistoryId}; used for side bet history and report correlationSee Explanation of historyId |
| gameHistoryId | String(200) | Main game history ID; used to correlate the main game round |
| uid | String(50) | Player ID, only allow a-z & 0-9 and underscores (_) and hyphens (-) |
| gType | Integer | Game types See Game Provider |
| mType | Integer | Machine Type |
| reportDate | String(10) | Report Date (dd-MM-yyyy) |
| gameDate | String(19) | Game Date (dd-MM-yyyy HH:mm:ss) |
| currency | String(10) | Please refer to: Currency Code |
| isBuyFeature | Boolean | Whether the main game of this spin is in BuyFeature mode |
| isExtraBet | Boolean | Whether the main game of this spin is in ExtraBet mode |
| bet | Double | Total side bet amount (always negative) |
| win | Double | Total side bet win |
| netWin | Double | Total Net Win = win + bet |
| mainBet | Double | Main game bet amount of this spin (always negative) |
| mainWin | Double | Main game win of this spin; subtract this amount first when checking the balance |
| mainNetWin | Double | Main game net win of this spin = mainWin + mainBet |
| lastModifyTime | String(19) | Last Modified Time (dd-MM-yyyy HH:mm:ss) |
Request Example
{
"action": 20,
"ts": 1747452951820,
"transferId": 987654321,
"historyId": "sidebet_5250145705663",
"gameHistoryId": "5250145705663",
"uid": "test01",
"gType": 0,
"mType": 14099,
"reportDate": "28-05-2026",
"gameDate": "28-05-2026 13:37:39",
"currency": "RB",
"isBuyFeature": false,
"isExtraBet": false,
"bet": -30.00,
"win": 50.00,
"netWin": 20.00,
"mainBet": -10.00,
"mainWin": 40.00,
"mainNetWin": 30.00,
"lastModifyTime": "28-05-2026 13:37:45"
}Response Parameter
| Parameter | Format | Description |
|---|---|---|
| status | String(4) | Success: 0000If the transferId has already been charged successfully, please return 0000 and do not charge again.Error: 6006 - Player balance insufficient Error: 9007 - Unknown action; return it only when Action 20 has not been integrated correctly. The request is not resent or added to the failed transaction list. For other error codes, see Error Codes in Appendix Other error codes are treated as retryable transaction failures; you may add the reason in err_text |
| balance | String | Balance |
| err_text | String(255) | Error message |
Response Example
{
"status": "0000",
"balance": "12345.67",
"err_text": ""
}Last updated on