Skip to Content

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 mainWin first 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 mainWin is greater than or equal to |bet|, this request should be processed.
    • If the player’s balance minus mainWin is less than |bet|, please return error code 6006.
  • bet is 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 transferId using 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 status is not 0000, 6006, or 9007.
  • 9007 means 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 transferId was already charged successfully → return the previous result (0000) and do not charge again.
  • If the transferId has not been charged successfully yet (previous attempt failed / incomplete) → process this request normally (this is a retry, not a duplicate).

Transaction Flow

Action 20 Side Bet 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

ParameterFormatDescription
actionInteger20
tsLongCurrent system time
transferIdLongIdempotency key, Transfer ID; the same value is sent on retries, deduplicate by it
historyIdString(200)Side bet history ID in the format sidebet_{gameHistoryId}; used for side bet history and report correlation
See Explanation of historyId
gameHistoryIdString(200)Main game history ID; used to correlate the main game round
uidString(50)Player ID, only allow a-z & 0-9 and underscores (_) and hyphens (-)
gTypeIntegerGame types
See Game Provider
mTypeIntegerMachine Type
reportDateString(10)Report Date (dd-MM-yyyy)
gameDateString(19)Game Date (dd-MM-yyyy HH:mm:ss)
currencyString(10)Please refer to: Currency Code
isBuyFeatureBooleanWhether the main game of this spin is in BuyFeature mode
isExtraBetBooleanWhether the main game of this spin is in ExtraBet mode
betDoubleTotal side bet amount (always negative)
winDoubleTotal side bet win
netWinDoubleTotal Net Win = win + bet
mainBetDoubleMain game bet amount of this spin (always negative)
mainWinDoubleMain game win of this spin; subtract this amount first when checking the balance
mainNetWinDoubleMain game net win of this spin = mainWin + mainBet
lastModifyTimeString(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

ParameterFormatDescription
statusString(4)Success: 0000
If 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
balanceStringBalance
err_textString(255)Error message

Response Example

{ "status": "0000", "balance": "12345.67", "err_text": "" }
Last updated on