Skip to main content

Get Bet Slip and Validate Token

/betSlip

The Authentication API enables the HPGames system to verify the information received in the launch protocol. Only once the merchant approves this information game will be launched.

BetSlip Request

BetSlip is similar to Validate Token request from casino API with one additional filed for retriving Bet Slip

Parameter NameData TypeDescriptionRequired/Optional
merchantIdStringMerchant IDRequired
timestamplongTime representation in UNIX milliseconds format.Required
authTokenStringGame session idRequired
hashStringString To Encode: merchantId + timestamp
HMAC SHA256 Code Snippet
Required

Request example:

{
"merchantId": "21385394-6dda-4171-a003-02fa4a975643",
"timestamp": 1643727556,
"authToken": "b5e10b6b-4d88-475c-9496-a461052a8448",
"hash": "288db34c0f1eb6e9c11f38ff2feb90d0"
}

Signature calculation example:

(value of secret key used in all examples: secretkey)

SHA256("21385394-6dda-4171-a003-02fa4a9756431643727556", secretkey);

BetSlip Response

Parameter NameData TypeDescriptionRequired/Optional
playerIdStringMerchant’s unique identification for each player.Required
balanceDecimalAvailable money in the player’s wallet at the time of the request. The value will be presented in the currency of that sessionRequired
currencyStringThe currency of the balance, Currency code (ISO 421)Required
betSlipList<Bet>Bet Slip Item data, check Bet tableRequired
usernameStringPlayer’s usernameOptional
nicknameStringPlayer nickname for gamesOptional
firstNameStringPlayer’s first nameOptional
lastNameStringPlayer’s last nameOptional
genderStringPlayer’s genderOptional
emailStringPlayer’s email addressOptional
phoneStringPlayer’s phone numberOptional
ipAddressStringIp addressOptional
languageStringPrefered user language. ISO 639-3 language code. Defaults to ENGOptional
devicePlatformStringDevice platform (Desktop,Mobile..)Optional
phoneStringPlayer’s phone numberOptional
addressStringPlayer’s addressOptional
cityStringPlayer’s cityOptional
countryStringPlayer’s country code (ISO 3166)Optional
testBooleanSet to true for test users. Default falseOptional
errorCodeintError code, default 0Optional
errorMessageStringError messageOptional

Bet:

Parameter NameData TypeDescriptionRequired/Optional
sportIdStringUnique identifier for the sportRequired
sportNameStringName of the sportRequired
betSlipIdStringUnique identifier for the betSlip on merchant sideOptional
matchNameStringName of the matchRequired
matchIdStringUnique identifier for the matchRequired
competitionIdStringUnique identifier for the competitionRequired
competitionNameStringName of the competitionRequired
marketIdStringUnique identifier for the marketRequired
marketNameStringDescription of the betting marketRequired
marketOptionIdStringUnique identifier for the market optionRequired
marketOptionNameStringName of the selected market optionRequired
oddDoubleBetting odd for the selected market optionRequired
marginDoubleMargin for the oddsRequired for specific markets like over/under
homeTeamStringName of the home teamRequired
awayTeamStringName of the away teamRequired

This table maps the attributes from your JSON object into a structured format.

Response example:

{
"errorCode": 0,
"errorMessage": "",
"playerId": "PL123456789",
"username": "john_doe",
"firstName": "John",
"lastName": "Doe",
"gender": "male",
"email": "john.doe@example.com",
"phone": "+1234567890",
"ipAddress": "192.168.1.1",
"language": "en",
"devicePlatform": "Mobile",
"address": "123 Main St",
"city": "New York",
"country": "US",
"test": false,
"balance": 250.75,
"currency": "USD",
"betSlip": [
{
"sportId": "1",
"sportName": "Football",
"betSlipId": "915259f2-0412-478d-bb32-b08d02f71a0c",
"matchName": "Monaco - Crvena Zvezda",
"matchId": "1234",
"competitionId": "10",
"competitionName": "UEFA - Champions League",
"marketId": "1",
"marketName": "The Match will end with Draw result",
"marketOptionId": "2",
"marketOptionName": "Draw",
"odd": 1.38,
"margin": null,
"homeTeam": "Monaco",
"awayTeam": "Crvena Zveda"
},
{
"sportId": "2",
"sportName": "Basketball",
"betSlipId": "a7f8a612-d391-4d9b-beb2-efa87f1b5a3d",
"matchName": "Lakers - Celtics",
"matchId": "5678",
"competitionId": "20",
"competitionName": "NBA - Finals",
"marketId": "3",
"marketName": "Total Points Over/Under",
"marketOptionId": "5",
"marketOptionName": "Over 215.5",
"odd": 1.95,
"margin": 215.5,
"homeTeam": "Lakers",
"awayTeam": "Celtics"
}
]
}