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
| Parameter | Type | Description | Required |
|---|---|---|---|
| merchantId | UUID | Merchant identifier | Yes |
| timestamp | Long | UNIX timestamp in milliseconds | Yes |
| authToken | String | Game session identifier | Yes |
| hash | String | HMAC SHA256 signature used to verify the request | 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",
"timestamp": 1773941523456,
"authToken": "5f6e7d8c-9b0a-4c3d-8e1f-2a3b4c5d6e7f",
"hash": "8c1e4d7a2b5f9c3e6a0d1b2f4a7c9e3d5b6f8a0c2d4e6b7a9c1d3f5e7a9b0c2d"
}
Validate Token Response
| Parameter | Type | Description | Required |
|---|---|---|---|
| errorCode | Integer | Error code (default 0, indicates success) | No |
| errorText | String | Error message | No |
| playerId | String | Merchant’s unique identification for the Player | Yes |
| test | Boolean | Indicates whether the Player is a test user | Yes |
| username | String | Player username | No |
| nickname | String | Player nickname | No |
| firstName | String | Player first name | No |
| lastName | String | Player last name | No |
| gender | String | Player gender | No |
| String | Player email address | No | |
| phone | String | Player phone number | No |
| ipAddress | String | Player IP address | No |
| language | String | Preferred language (ISO 639-3, e.g. ENG) | No |
| devicePlatform | String | Device platform (e.g. Desktop, Mobile) | No |
| address | String | Player address | No |
| city | String | Player city | No |
| country | String | Country code (ISO 3166) | No |
| balance | Decimal | Player balance at the time of the request | Yes |
| currency | String | Currency code (ISO 4217) | Yes |
Response Example
{
"errorCode": 0,
"errorText": "",
"playerId": "c8d9e0f1-2345-4a6b-8c9d-0e1f2a3b4c5d",
"test": false,
"balance": 120.5,
"currency": "EUR"
}