Player Balance
/getPlayerBalance
The Get Player Balance API is used by HPGames to retrieve the current balance of a Player from the Merchant system.
Get Player Balance Request
| Parameter | Type | Description | Required |
|---|---|---|---|
| merchantId | UUID | Merchant identifier | Yes |
| timestamp | Long | UNIX timestamp in milliseconds | Yes |
| playerId | String | Merchant's unique identifier for the Player | Yes |
| authToken | String | Game session identifier | Yes |
| hash | String | HMAC SHA256 signature used to verify the request | Yes |
| currency | String | Currency code (ISO 4217) | Yes |
Hash Fields
The hash is calculated by concatenating the following fields in the exact order:
- merchantId
- timestamp
For details on how the hash is generated, see Hash Algorithm.
Request Example
{
"merchantId": "1387a6cc-3651-4473-ae52-e415caea3395",
"playerId": "c8d9e0f1-2345-4a6b-8c9d-0e1f2a3b4c5d",
"timestamp": 1773941523456,
"authToken": "5f6e7d8c-9b0a-4c3d-8e1f-2a3b4c5d6e7f",
"hash": "8c1e4d7a2b5f9c3e6a0d1b2f4a7c9e3d5b6f8a0c2d4e6b7a9c1d3f5e7a9b0c2d",
"currency": "EUR"
}
Get Player Balance Response
| Parameter | Type | Description | Required |
|---|---|---|---|
| errorCode | Integer | Error code (default 0, indicates success) | No |
| errorText | String | Error message | No |
| balance | Decimal | Player’s wallet balance | Yes |
| currency | String | Currency code (ISO 4217) | Yes |
Response Example
{
"errorCode": 0,
"errorText": "",
"balance": 1000.59,
"currency": "EUR"
}