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
}
| 參數 | Type | Required | Description |
|---|---|---|---|
| action | string | Yes | Fixed to "betNSettle" |
| uid | string | Yes | Player Account |
| roundId | string | Yes | Game round id |
| transferId | string | Yes | Unique Transaction Identifier |
| brand | string | Yes | Game Brand |
| currency | string | Yes | Currency |
| gameCode | string | Yes | Game Code |
| betTime | string | Yes | Bet Time |
| txTime | string | Yes | Settle Time |
| gameInfo | string | Yes | Additional information |
| actualBetAmt | number | Yes | Actual bet amount |
| validBetAmt | number | Yes | Valid bet amount |
| winAmt | number | Yes | Return amount |
| jackpotWin | number | Yes | Jackpot amount |
| jackpotContribute | number | Yes | Jackpot contribution value |
| betSourceId | number | Yes | Source 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'
}
| Field | Type | Description |
|---|---|---|
| status | string | Transaction status |
| errText | string | Error message; empty string on success |
| balance | number | Current available balance |
| responseTime | string | Response time |
Transaction status and Transaction Results
| Status | Determine Transaction Status | Trigger Retry | Transaction Valid |
|---|---|---|---|
| 0000 | Success | No | Yes |
| 9999 | Failed | Yes | No |
| 1006 | Failed | No | No |
| 2001 | Success | No | Yes |
| 2002 | Failed | No | N |
| Time Out | Failed | Yes | No |
Important Notes
- Atomic Operation: BetNSettle is an atomic operation—either all steps succeed or all fail.
- Balance Calculation:
afterBalance = beforeBalance - actualBetAmt + winAmt - transferId Uniqueness: The transferId is unique for each game round.
- 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.