Skip to main content

BetNSettle - Bet and Settle

Execute bet and settlement operations, this is the core API of the game.

Request Parameters​

Request before decryption​

{
"cipherText": "G0ZMDELeJwx+7JcIfIFOLJjkSzANPu6krGM2uw==..."
}
info

For encryption Description, please refer to Operator API Implementation Guide

Request after decryption​

{
"action": "betNSettle",
"uid": "testaccount01",
"roundId": "testroundId001",
"transferId": "testroundId001",
"betId": "7634846433511800000",
"brand": "VP",
"currency": "THB",
"gameCode": "VP_230001_1",
"betTime": "2025-11-17T16:01:13.155Z",
"txTime": "2025-11-17T16:01:13.155Z",
"gameInfo": "{\"featureBuy\":0,\"spinID\":[\"7634278403511200000\",\"7634278403512200000\",\"7634278403513700000\"],\"cardType\":1,\"deviceType\":0}",
"actualBetAmt": 0,
"validBetAmt": 0,
"winAmt": 1.3,
"jackpotWin": 0,
"jackpotContribute": 0,
"betSourceId": 1,
"featureMode": 1
}
ParameterTypeRequiredDescription
actionstringYesFixed as "betNSettle"
uidstringYesPlayer Account
roundIdstringYesGame round number
transferIdstringYesTransaction Unique Identifier (scheduled for removal)
betIdstringYesBet ID, unique to VP
brandstringYesBrand code, fixed as VP
currencystringYesCurrency code
gameCodestringYesGame Code
betTimestringYesBet time
txTimestringYesSettlement time
gameInfostringYesJSON string of Game-related information
actualBetAmtnumberYesActual Bet Amount
validBetAmtnumberYesValid Bet Amount
winAmtnumberYesWin Amount, can be 0 or positive
jackpotWinnumberYesJackpot Win Amount
jackpotContributenumberYesJackpot Contribution Amount, default is 0
betSourceIdnumberYesTransaction source code
featureModenumberYesFeature Mode

Response Format​

info

The response is in plaintext JSON and does not need to be encrypted.

Success Response​

{
"status": "0000",
"errText": "",
"balance": 12345.67,
"responseTime": "2024-12-11T01:23:38.271Z"
}
FieldTypeDescription
statusstringStatus Code, see Status Code Description below
errTextstringError message, empty string on Success
balancenumberPlayer Balance after transaction
responseTimestringResponse time

Response Status and Transaction Result​

StatusDetermine Bet StatusYesNo Trigger RetryBet Status
0000SuccessNoConfirmed
9999FailedYesCanceled
1006FailedNoCanceled
2001SuccessNoConfirmed
2002FailedNoCanceled
TimeoutFailedYesCanceled

Important Notes​

  1. Atomic operation: BetNSettle is an atomic operation, it will either all Success or all fail (Yes all fail)
  2. Balance calculation: afterBalance = beforeBalance - actualBetAmt + winAmt
  3. betId uniqueness: Each Game round has a unique betId
  4. Retry policy: If Success is not received, retries will continue
    • Retry frequency: Retries 5 times, each retry uses an exponential backoff policy (1s, 3s, 5s, 7s, 9s)
      • If all above retries fail, normal transactions enter the rollback stage
      • If all above retries fail, Item and Operator Card transactions enter the retryBet stage
  5. Parameter adjustment transferId will be removed and replaced by betId
  6. Jackpot parameters: jackpotWin is currently only used by FISH Games VP_400001_1; SLOT Games do not use it, and the value is fixed at 0; jackpotContribute is a reserved Field, currently defaulting to 0