Skip to main content

BetNSettle - Place Bet and Settle

Execute betting and settlement operations. This is the core API of the game.

Request Parameters

Request Body Before Decryption

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

For the decryption algorithm, please refer to the Operator API Implementation Description

Request Body After Decryption

{
action: 'betNSettle',
uid: 'VPSysDevTest001',
roundId: '7634846433511800000',
transferId: '7634846433511800000',
brand: 'VP',
currency: 'THB',
gameCode: 'VP_230001_1',
betTime: '2025-11-18T16:50:43.881Z',
txTime: '2025-11-18T16:50:43.881Z',
gameInfo: '{"featureBuy":0,"spinID":"[\\"7634846433511800000\\"]","cardType":0,"isFeatureGame":"","deviceType":0}',
actualBetAmt: 0.5,
validBetAmt: 0.5,
winAmt: 0,
jackpotWin: 0,
jackpotContribute: 0,
betType: 0,
betSourceId: 1
}
參數TypeRequiredDescription
actionstringYesFixed to "betNSettle"
uidstringYesPlayer Account
roundIdstringYesGame round id
transferIdstringYesUnique Transaction Identifier
brandstringYesGame Brand
currencystringYesCurrency
gameCodestringYesGame Code
betTimestringYesBet Time
txTimestringYesSettle Time
gameInfostringYesAdditional information
actualBetAmtnumberYesActual bet amount
validBetAmtnumberYesValid bet amount
winAmtnumberYesReturn amount
jackpotWinnumberYesJackpot amount
jackpotContributenumberYesJackpot contribution value
betSourceIdnumberYesSource of the transaction

Response Format

info

The response is returned as plaintext JSON and does not require encryption.

Success response

{
status: '0000',
errText: '',
balance: 1016.00,
responseTime: '2024-12-11T01:23:38.271Z'
}
FieldTypeDescription
statusstringTransaction status
errTextstringError message; empty string on success
balancenumberCurrent available balance
responseTimestringResponse time

Transaction status and Transaction Results

StatusDetermine Transaction StatusTrigger RetryTransaction Valid
0000SuccessNoYes
9999FailedYesNo
1006FailedNoNo
2001SuccessNoYes
2002FailedNoN
Time OutFailedYesNo

Important Notes

  1. Atomic Operation: BetNSettle is an atomic operation—either all steps succeed or all fail.
  2. Balance Calculation: afterBalance = beforeBalance - actualBetAmt + winAmt
  3. transferId Uniqueness: The transferId is unique for each game round.
  4. Retry Strategy: If a successful response is not received, retries will continue.
    • Retry Frequency: Retry up to 5 times, using an exponential backoff policy between retries (1s, 3s, 5s, 7s, 9s).
    • If all retries fail and the transaction is not a multi-item transaction, the process will proceed to the rollback phase.