Skip to main content

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

ParameterTypeDescriptionRequired
merchantIdUUIDMerchant identifierYes
timestampLongUNIX timestamp in millisecondsYes
playerIdStringMerchant's unique identifier for the PlayerYes
authTokenStringGame session identifierYes
hashStringHMAC SHA256 signature used to verify the requestYes
currencyStringCurrency 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

ParameterTypeDescriptionRequired
errorCodeIntegerError code (default 0, indicates success)No
errorTextStringError messageNo
balanceDecimalPlayer’s wallet balanceYes
currencyStringCurrency code (ISO 4217)Yes

Response Example

{
"errorCode": 0,
"errorText": "",
"balance": 1000.59,
"currency": "EUR"
}