Skip to main content

Validate Token

/validateToken

The Validate Token API is used by HPGames to verify the Player session with the Merchant system before launching a game. The game will be launched only if the Merchant successfully validates the provided token.


Validate Token Request

ParameterTypeDescriptionRequired
merchantIdUUIDMerchant identifierYes
timestampLongUNIX timestamp in millisecondsYes
authTokenStringGame session identifierYes
hashStringHMAC SHA256 signature used to verify the requestYes

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",
"timestamp": 1773941523456,
"authToken": "5f6e7d8c-9b0a-4c3d-8e1f-2a3b4c5d6e7f",
"hash": "8c1e4d7a2b5f9c3e6a0d1b2f4a7c9e3d5b6f8a0c2d4e6b7a9c1d3f5e7a9b0c2d"
}

Validate Token Response

ParameterTypeDescriptionRequired
errorCodeIntegerError code (default 0, indicates success)No
errorTextStringError messageNo
playerIdStringMerchant’s unique identification for the PlayerYes
testBooleanIndicates whether the Player is a test userYes
usernameStringPlayer usernameNo
nicknameStringPlayer nicknameNo
firstNameStringPlayer first nameNo
lastNameStringPlayer last nameNo
genderStringPlayer genderNo
emailStringPlayer email addressNo
phoneStringPlayer phone numberNo
ipAddressStringPlayer IP addressNo
languageStringPreferred language (ISO 639-3, e.g. ENG)No
devicePlatformStringDevice platform (e.g. Desktop, Mobile)No
addressStringPlayer addressNo
cityStringPlayer cityNo
countryStringCountry code (ISO 3166)No
balanceDecimalPlayer balance at the time of the requestYes
currencyStringCurrency code (ISO 4217)Yes

Response Example

{
"errorCode": 0,
"errorText": "",
"playerId": "c8d9e0f1-2345-4a6b-8c9d-0e1f2a3b4c5d",
"test": false,
"balance": 120.5,
"currency": "EUR"
}