BetNSettle - Bet and Settlement
Perform Bet and Settlement operations, this is the core API for the game.
Request Parameters
Request Before Decryption
{
"cipherText": "G0ZMDELeJwx+7JcIfIFOLJjkSzANPu6krGM2uw==..."
}
info
For Encryption Description, please refer to [Operator API Implementation Description](./overview.md#1-Security Requirements)
Decrypted Request
{
"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
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| action | string | Yes | Fixed as "betNSettle" |
| uid | string | Yes | Player Account |
| roundId | string | Yes | Game round number |
| transferId | string | Yes | Transaction Unique Identifier (planned for removal) |
| betId | string | Yes | Bet ID, unique to VP |
| brand | string | Yes | Brand code, fixed as VP |
| currency | string | Yes | Currency code |
| gameCode | string | Yes | Game Code |
| betTime | string | Yes | Bet time |
| txTime | string | Yes | Settlement time |
| gameInfo | string | Yes | JSON string of game-related information |
| actualBetAmt | number | Yes | Actual Bet Amount |
| validBetAmt | number | Yes | Valid Bet Amount |
| winAmt | number | Yes | Win Amount, can be 0 or positive |
| jackpotWin | number | Yes | Jackpot Win Amount, default is 0 |
| jackpotContribute | number | Yes | Jackpot Contribution Amount, default is 0 |
| betSourceId | number | Yes | Transaction source code |
Response Format
info
Response is plaintext JSON, no encryption required.
Success Response
{
"status": "0000",
"errText": "",
"balance": 12345.67,
"responseTime": "2024-12-11T01:23:38.271Z"
}
| Field | Type | Description |
|---|---|---|
| status | string | Status Code, see Status Code Description below |
| errText | string | Error message, empty string on Success |
| balance | number | Player Balance after transaction |
| responseTime | string | Response time |
Response Status and Transaction Result
| Status | Bet Status Determination | Trigger Retry? | Bet Status |
|---|---|---|---|
| 0000 | Success | No | Established |
| 9999 | Failed | Yes | Voided |
| 1006 | Failed | No | Voided |
| 2001 | Success | No | Established |
| 2002 | Failed | No | Voided |
| Timeout | Failed | Yes | Voided |
Important Notes
- Atomic Operation: BetNSettle is an atomic operation, it will either be all Success or all Failed
- Balance Calculation: afterBalance = beforeBalance - actualBetAmt + winAmt
- transferId Uniqueness: The transferId for each game round is unique
- Retry Policy: If Success is not received, retries will continue
- Retry Frequency: Retries 5 times, with an exponential backoff policy between each retry (1s, 3s, 5s, 7s, 9s)
- If all retries fail and it is not an item transaction, proceed to rollback phase
- Parameter Adjustment: transferId will be removed and replaced by betId
- Jackpot Parameters: Currently, there is no jackpot functionality, all related parameters are Reserved Fields, currently defaulting to 0