Skip to main content

Balance - Query Balance

Query Player's current available Balance.

Request Parameters

Request Before Decryption

{
"cipherText": "asdqwcqwqe"
}
info

For Encryption Description, please refer to [Operator API Implementation Description](./overview.md#1-Security Requirements)

Decrypted Request

{
"action": "balance",
"uid": "gameTest1",
"currency": "PHP",
"brand": "VP"
}
ParameterTypeRequiredDescription
actionstringYesFixed as "balance"
uidstringYesPlayer Account
currencystringYesCurrency code
brandstringYesBrand 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"
}
FieldTypeDescription
statusstringStatus Code, see Status Code Description below
errTextstringError message, empty string on Success
balancenumberCurrent available Balance
responseTimestringResponse time

Response Status and Transaction Result

StatusQuery StatusTrigger Retry?
0000SuccessNo
9999FailedYes
TimeoutFailedYes

Important Notes

  1. Token Validation: The validity of the Token is validated with each query
  2. Real-time Balance: The returned Balance is the real-time available Balance
  3. Currency Consistency: Ensure consistency with the currency set by VP
  4. Caching Strategy: It is recommended for the Operator to appropriately cache Balance to reduce query frequency
  5. Concurrency Control: Under high concurrency, it may be necessary to wait for locks to be released
  6. Query Frequency: Sent once every 10 seconds after the Player enters the game, until the Player leaves the game