Get Balance
Retrieve the player's balance. This API is provided by the merchant (operator) for the game platform to call.
Request Url
POST {API_URL_ROOT}/player/getBalance
Note: This URL can be configured in the merchant backend, but input and output parameters must follow the spec below.
Request Parameters
Header
| Field | Required | Type | Description |
|---|---|---|---|
| sign | YES | string | Signature computed using the Signature Algorithm. |
| timestamp | YES | int | UTC timestamp (seconds) since 1970-01-01, e.g. 1741837297. |
| Accept-Language | YES | string | Language codes, see Language List, e.g. zh,en for localized error messages. |
| Content-Type | YES | string | "application/json; charset=utf-8" |
Body
| Field | Type | Description |
|---|---|---|
| tenantId | int | Merchant ID assigned by the platform. |
| userId | string | Merchant's player ID that uniquely identifies a player. |
Important: Regardless of isSuccess being true or false, the current account balance must be returned. The system will update the current account balance using the balance value. If the account status is abnormal (player cannot play), balance MUST be 0.
Response Parameters
| Field | Required | Type | Description |
|---|---|---|---|
| tenantId | YES | int | Merchant ID assigned by the platform. |
| userId | YES | string | Merchant's player ID. |
| balance | YES | double | Player balance. |
| currency | NO | string | Game currency code. |
Example
{
"isSuccess": true,
"code": 0,
"data": {
"tenantId": 1,
"userId": "t1_276682",
"balance": 100000,
"currency": "BRL"
}
}
// Player disabled scenario:
{
"isSuccess": false,
"code": 2014,
"message": "Player disabled",
"data": {
"tenantId": 1,
"userId": "t1_276682",
"balance": 0.0,
"currency": "BRL"
}
}