Seamless
Seamless Wallet API
Functions
Action 8: BetNSettle

Action 8: BetNSettle

Function Description

  • JDB will call the API when player bet, and inform this game result.

  • Please use bet or mb to confirm whether the player's balance is sufficient, and after deducting or adding funds with netWin, return the remaining amount to the player.

    • bet:
      • If the player's balance is greater than or equal to bet, this request should be processed.
      • If the player's balance is less than bet, please return error code 6006.
    • mb:
      • If the player's balance is greater than or equal to mb, this request should be processed.
      • If the player's balance is less than mb, then reply with 6006.
  • The response will contain a field: mb, with which the customers can check whether the balance is enough.

    • mb is the abbreviation for minimum balance.

    • How to use: when player's balance >= mb, this is a legal bet.

    • How to calculate:

      • The mb of non-fish game means bet.

      • The mb of fish game means:

        • Iterate on the bullet list. For each bullet:

        • accumulated cost = previous accumulated cost + bet - previous win

        • mb = Max(previous mb, accumulated cost)

        • For example: bet = 24, win = 29 in game results.

          betwinaccumulated costmb
          110\=0 + 1 - 0 = 1Max(0, 1) = 1
          55\=1 + 5 - 10 = -4Max(1, -4) = 1
          100\= -4 + 10 - 5 = 1Max(1, 1) = 1
          54\=1 + 5 - 0 =6Max(1, 6) = 6
          110\=6 + 1 - 4 = 3Max(6, 3) = 6
          10\=3 + 1 - 10 = -6Max(6, -6) = 6
          10\=-6 + 1 - 0 = -5Max(6, -5) = 6
        • In the previous example, the final mb is 6. That is, the player's balance should be at least 6.

  • When a response times out or a correctly formatted response is not received (please refer to the image below), Cancel BetNSettle (Action 4) will be called after one minute.

    seamless wallet BetNSettle flow chart

Request Parameter

ParameterFormatDescription
actionInteger8
tsLongCurrent system time
transferIdLongTransfer ID
historyIdString(100)Game History ID
See Explanation of historyId
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
betDoubleBet Amount (always be negative)
mbDoublePlayer Minimum Balance
winDoubleGame Win (Include bet amount)
netWinDoubleTotal Net Win
lastModifyTimeString(19)Last Modified Time (dd-MM-yyyy HH:mm:ss)
sessionNoString(50)Session No. , will be different in each game. Recommend when the JDB lobby is not in use.
This is not included by default, contact JDB service if needed.
systemSessionIdString(150)System Session ID, will be different in each login when using action 21 get game launch url.

Game Type supports range: SLOT(0), FISH(7), ARCADE(9), LOTTERY(12), CARD(18)

This is not included by default, contact JDB service if needed.

More data fields are vary by gType, listed in the following table:

Betting records in slot games: gType = 0

ParameterFormatDescription
denomDoubleDenom
systemTakeWinIntegerSystem Take Win:
0: No
1: Yes
jackpotWinDoubleThe amount of the jackpot won
jackpotContributeDoubleJackpot contributions
hasFreeGameIntegerFree game
0: No
1: Yes
hasGambleIntegerGambling Game
0: No
1: Yes
hasBuyFeatureIntegerBuy Feature Game
0: No
1: Yes

Betting records in fishing game: gType = 7

ParameterFormatDescription
denomDoubleDenom
systemTakeWinIntegerSystem Take Win:
0: No
1: Yes
roomTypeIntegerGame Room
-1: Lobby (Achievement Game)
0: Small Bet
1: Medium sized bet
2: Large bet
Real naming of game room differentiated by Machine Type

Betting records in Arcade games: gType = 9

ParameterFormatDescription
denomDoubleDenom
systemTakeWinIntegerSystem Take Win:
0: No
1: Yes
hasBonusGameIntegerBonus game
0: No
1: Yes
hasGambleIntegerGambling Game
0: No
1: Yes

Betting records in Lottery Game: gType = 12

ParameterFormatDescription
denomDoubleDenom
systemTakeWinIntegerSystem Take Win:
0: No
1: Yes
hasBonusGameIntegerBonus game
0: No
1: Yes

Request Example: Slot

{
  "action": 8,
  "ts": 1447452951820,
  "transferId": 1001,
  "historyId": "5250145705663",
  "uid": "test01",
  "gType": 0,
  "mType": 8001,
  "reportDate": "11-07-2018",
  "gameDate": "11-07-2018 13:37:39",
  "currency": "RB",
  "bet": -5.25,
  "mb": 5.25,
  "win": 2,
  "netWin": -3.25,
  "lastModifyTime": "11-07-2018 13:37:45",
  "denom": 0.01,
  "systemTakeWin": 0,
  "jackpotWin": 0,
  "jackpotContribute": -0.02625,
  "hasFreeGame": 0,
  "hasGamble": 0
}

Request Example: Fish

{
  "action": 8,
  "ts": 1447452951820,
  "transferId": 1001,
  "historyId": "5250145705663",
  "uid": "test01",
  "gType": 7,
  "mType": 7001,
  "reportDate": "11-07-2018",
  "gameDate": "11-07-2018 13:37:39",
  "currency": "RB",
  "bet": -5.25,
  "mb": 5.25,
  "win": 2,
  "netWin": -3.25,
  "lastModifyTime": "11-07-2018 13:37:45",
  "denom": 0.01,
  "systemTakeWin": 0,
  "roomType": 0
}

Request Example: Arcade

{
  "action": 8,
  "ts": 1447452951820,
  "transferId": 1001,
  "historyId": "5250145705663",
  "uid": "test01",
  "gType": 9,
  "mType": 9001,
  "reportDate": "11-07-2018",
  "gameDate": "11-07-2018 13:37:39",
  "currency": "RB",
  "bet": -5.25,
  "mb": 5.25,
  "win": 2,
  "netWin": -3.25,
  "lastModifyTime": "11-07-2018 13:37:45",
  "denom": 0.01,
  "systemTakeWin": 0,
  "hasGamble": 0,
  "hasBonusGame": 0
}

Request Example: Lottery

{
  "action": 8,
  "ts": 1447452951820,
  "transferId": 1001,
  "historyId": "5250145705663",
  "uid": "test01",
  "gType": 12,
  "mType": 12001,
  "reportDate": "11-07-2018",
  "gameDate": "11-07-2018 13:37:39",
  "currency": "RB",
  "bet": -5.25,
  "mb": 5.25,
  "win": 2,
  "netWin": -3.25,
  "lastModifyTime": "11-07-2018 13:37:45",
  "denom": 0.01,
  "systemTakeWin": 0,
  "hasBonusGame": 0
}

Request Example: FC, YB, AMB

{
  "action": 8,
  "ts": 1447452951820,
  "transferId": 1001,
  "historyId": "5250145705663",
  "uid": "test01",
  "gType": 30,
  "mType": 30001,
  "reportDate": "11-07-2018",
  "gameDate": "11-07-2018 13:37:39",
  "currency": "RB",
  "bet": -5.25,
  "win": 2,
  "netWin": -3.25,
  "lastModifyTime": "11-07-2018 13:37:45"
}

Response Parameter

ParameterFormatDescription
statusString(4)Success: 0000
Error: 6006 - Player balance is insufficient
It would be considered as failure if the status is not 0000, and you can describe in err_text.
balanceStringBalance
err_textString(255)Error message

Response Example

{
  "status": "0000",
  "balance": "12345.67",
  "err_text": ""
}