Operator API Implementation Guide
In Seamless Wallet Mode, Operator needs to implement a unified API for VP to call, to achieve Balance query, Bet Settlement, and transaction processing.
Architecture Overview
In Seamless Wallet Mode, Player's Balance is Managed by Operator, and VP, as a Games service provider, needs to Query Balance from Operator and process transactions.
API Implementation Description
Operator needs to provide a set of callback URLs on its own server. Operator needs to decide the operation to perform based on the action parameter in the request:
| Action | Description | Priority |
|---|---|---|
| balance | Query player available balance in real-time | Mandatory |
| betNSettle | Process Games Bet and Settlement | Mandatory |
| rollback | Rollback abnormal transactions | Mandatory |
| retryBet | Bet retry mechanism | Mandatory |
Unified URL
Operator only needs to provide a set of callback URLs, for example:
POST https://operator.example.com/api/wallet
VP will include the action Field in the decrypted parameters of the request to distinguish different operations
Implementation Requirements
1. Security Requirements
- ✅ Encrypted Transmission: All request content uses AES-256-GCM encryption, responses use plaintext JSON format
- ✅ HTTPS: Production environment must use HTTPS
Algorithm: AES-256-GCM
- Key Length: 256 bits (32 bytes)
- IV Length: 96 bits (12 bytes)
- Authentication Tag Length: 128 bits (16 bytes)
Ciphertext Format:
ivBase64(16 characters) + authTagBase64(24 characters) + encryptedDataBase64
2. Response Format Requirements
The response format for all Operator APIs is unified as plaintext JSON, with the fixed format as follows:
{
"status": "0000",
"errText": "",
"balance": 12345.67,
"responseTime": "2024-12-11T01:23:38.271Z"
}
| Field | Type | Description |
|---|---|---|
| status | string | Status Code, see each API Description for details |
| errText | string | Error message, empty string on Success |
| balance | number | Player Balance after operation |
| responseTime | string | Response Time |
3. Performance Requirements
- ⚡ Response Time: Average response time should be < 3000ms, exceeding which will be considered a timeout
FAQ
Q1: How to distinguish different operations?
A: VP will include the action Field (balance, betNSettle, rollback, retryBet) in the decrypted parameters of the request, and Operator will route to the corresponding processing logic based on this Field.
Q2: How long should the Token validity period be set?
A: Recommended 24 hours. After Player closes Games or logs out, the Token should be invalidated.
Q3: How many decimal places should the Balance precision be set to?
A: Supports up to 4 decimal places (0.0001), must support at least 2 decimal places (0.01).
Q4: After how long will a transaction be considered a timeout?
A: 3 seconds
Q5: Which transactions will enter the Bet retry process?
A: Transactions for Items and Operator Cards will not Trigger Bet cancellation; they will continue to retry via the "Bet Retry" API
Q6: Can the callback URL be adjusted?
A: Yes, we do not specify any format for the callback URL returned by transactions. It can be configured and verified via the backend.
Technical Support
If you encounter problems during implementation, please Contact Customer Support Team
Next Steps
- See Balance - Query Balance to start implementation
- See BetNSettle - Bet and Settle
- See Rollback - Transaction Rollback
- See RetryBet - Bet Retry