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 details, 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,\"isFeatureGame\":\"\",\"deviceType\":0}",
"actualBetAmt": 0,
"validBetAmt": 0,
"winAmt": 1.3,
"jackpotWin": 0,
"jackpotContribute": 0,
"betSourceId": 1
}
ParameterTypeRequiredDescription
actionstringYesFixed value "betNSettle"
uidstringYesPlayer Account
roundIdstringYesGame round number
transferIdstringYesTransaction Unique Identifier (planned for removal)
betIdstringYesBet ID, a unique value assigned by VP
brandstringYesBrand code, fixed value VP
currencystringYesCurrency code
gameCodestringYesGame Code
betTimestringYesBet time
txTimestringYesSettlement time
gameInfostringYesJSON string containing game-related information
actualBetAmtnumberYesActual Bet Amount
validBetAmtnumberYesValid bet amount
winAmtnumberYesAmount won, can be 0 or a positive number
jackpotWinnumberYesJackpot amount won, default is 0
jackpotContributenumberYesJackpot contribution amount, default is 0
betSourceIdnumberYesTransaction source code

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 the status code description below
errTextstringError message, empty string when successful
balancenumberPlayer's Balance after the transaction
responseTimestringResponse time

Response Status and Transaction Result

StatusBet StatusWhether It Triggers a RetryBet Slip Status
0000SuccessNoValid
9999FailedYesVoided
1006FailedNoVoided
2001SuccessNoValid
2002FailedNoVoided
TimeoutFailedYesVoided

Important Notes

  1. Atomic Operation: BetNSettle is an atomic operation; it will either fully succeed or fully fail
  2. Balance Calculation: afterBalance = beforeBalance - actualBetAmt + winAmt
  3. betId Uniqueness: The betId is unique for each game round
  4. Retry Strategy: Retries will continue until a success response is received
  • Retry Frequency: Retries up to 5 times, using an exponential backoff policy between each retry (1s, 3s, 5s, 7s, 9s)
    • If all of the above retries fail, regular transactions enter the rollback stage
    • If all of the above retries fail, Item and Operator Card transactions enter the retryBet stage
  1. Parameter Adjustment: transferId will be removed and replaced by betId
  2. Jackpot Parameters: There is currently no jackpot feature; the related parameters are reserved fields, currently all defaulting to 0