Skip to content

Data types and definitions

Amounts are always 1/100 of base currency

Every monetary value in this API is an integer expressed as 1/100 of the base currency (a fixed ×100 factor). This includes bets, wins, balances, stakes, and discounts. The API never uses a decimal. For example, the API sends €10.00 as 1000, and €1.50 as 150.

This is a fixed 1/100 convention, not the currency's ISO minor unit. Some currencies have no minor unit (for example JPY, CLP). A few currencies use 1/1000. hizi always expects 1/100 of the base currency. Do not send or expect fractions or decimals. See the amount type below.

Basic types

Basic types are scalar types. Objects use these types.

typedescriptionformatsample value
stringrepresents a string valueUTF-8 encoded stringtest
numberrepresents a numberany valid number notation with or without decimals180.1
amounta monetary value, always expressed as 1/100 of the base currency. It is an integer, never a fraction or decimal (for example €12.00 = 1200). This is a fixed ×100 factor, not necessarily the currency's ISO minor unit (see the callout above)a positive integer, 0 or more, no fractions1200
currencyISO 4217 3-letter currency code. See https://en.wikipedia.org/wiki/ISO_42173 letter string (uppercase)EUR
languageidentifies a language. See http://www.lingoes.net/en/translator/langcode.htm2 or 5 letter stringen en-US
countryan ISO-3166-2 2-letter country code. See https://en.wikipedia.org/wiki/ISO_3166-22 letter string (uppercase)GB
hasha UUID (a 128-bit unique identifier) that identifies transactions or other unique values. The API uses hashes to identify gamerounds, transactions, and other unique objects128 Bit UUID represented as a 36 character string see https://en.wikipedia.org/wiki/Universally_unique_identifier123e4567-e89b-12d3-a456-426655440000
timestampan ISO 8601 timestamp. See https://en.wikipedia.org/wiki/ISO_8601. Example: use the following code to generate an ISO string in JavaScript: console.log(new Date().toISOString());represented as a string. Always use UTC time2020-01-21T14:48:04Z
arrayan array of any basic or object typesjson array notation[1,2]
booleanrepresents a binary valuetrue false "true" "false"true
jsondataa valid json objectjson object notation{ "test": "ok" }

Object types

The following objects are complex data types used in request and response payloads. Each attribute has a basic type.

playerBalance

This type describes the balance of a player.

attributetypeallowed valuesmandatorynotes
typestring“real” “bonus” “demo”YES
amountamounta positive integer, 0 or more, no fractionsYESbalance in 1/100 of the base currency, no fractions
currencycurrencyany 3 character currency codeYESISO 4217 3-letter currency code
SamplesDescription
{ "type": "real", "amount": 1200, "currency": "EUR" }sample of a real money balance (12 EUR)
{ "type": "bonus", "amount": 0, "currency": "EUR" }sample of a bonus money balance

gameTransaction

This object describes a transaction linked to a gameround. The request or response body always includes the hash that identifies the gameround.

attributetypeallowed valuesmandatorynotes
typestring“end” “debit” “credit” “void”YESdetermines the type of the transaction
isFirstDebitbooleantrue or falseYES if type = "debit". If the type is not "debit", the operator ignores this field. YES indicates the start of a new gameroundfor a debit transaction, this field indicates the first bet needed to start the game
amountamounta positive integer, 0 or more, no fractions. The amount can be 0 if the operator grants a freeplayonly for debit and credit transactionsthe value of the transaction in 1/100 of the base currency
discountAmountamountOptional discount applied to the amountOnly for debit transactionsThe value of the discount in 1/100 of the base currency
discountCampaignIdstringOptional campaignId used for a discountOnly for debit transactionscampaignId received in discount information
currencycurrencyany 3 character currency codeonly for debit and credit transactionsthe currency of the transaction
hashhashany valid valueonly for debit, credit, and void transactionsidentifies a transaction. All calls must be idempotent on this value
timestamptimestampany valid valueNOtimestamp of the transaction. The API sends this only when reporting transactions back to the operator
reasonstringany valid valueNOoptional reason of this transaction
The following attributes apply when the operator uses a freeplay instead of debiting an amount. In that case, the amount attribute is 0. See Appendix D for details of freeplay processing
freePlayStakeamountIf the operator uses a freeplay (amount = 0), this value indicates the stake used for that gameroundNO
freePlayUsedbooleanIf the operator uses a freeplay, this value is trueNO
serialstringSerial of the freeplay package usedNOSerial used in assignPlayerFreerounds call

Notes

A transaction always has a type. The type can be any of the following. The gameround hash links multiple transactions.


Allowed transaction types

valuedescriptionnotes
debita player placed a wager (bet). If isFirstDebit is true, this indicates the start of a new gameroundThe operator decides whether to use real or bonus money
creditthe operator adds a win to the player's account
voidthe operator voids a debit transactionThe operator might receive the void command before the actual debit transaction. In this case, the operator voids the debit transaction. This means no deduction from the player's account. The transaction hash identifies the transaction to void
endthe gameround is finishedThe API always sends this when the gameround finishes, including after a void transaction
SamplesDescription
{ "type": "debit", "isFirstDebit": "true", "amount": 200, "currency": "EUR", "hash": "62848922-da8b-46af-b7b3-7cf10190cd25" }A gameround starts. The player places an initial wager of 2 EUR. Make this call idempotent.
{ "type": "debit", "isFirstDebit": "false", "amount": 100, "currency": "EUR", "hash": "39ab89c2-f722-405e-a2e1-c96fedbfd586" }The player places a continuation bet of 1 EUR. Make this call idempotent.
{ "type": "credit", "amount": 1000, "currency": "EUR", "hash": "5b1ba0fc-6040-478e-9a19-58bd4786ca23" }The player wins 10 EUR in that gameround. Make this call idempotent.
{ "type": "void", "hash": "62848922-da8b-46af-b7b3-7cf10190cd25", "reason": "game had a malfunction" }The game had a malfunction. The operator voids the debit transaction above. Make this call idempotent.
{ "type": "end" }The gameround finishes. The operator closes it. Make this call idempotent.
Sample when a freeplay is usedDescription
{ "hash": "9385ec9642034ed89ef974d0fffbdff7", "type": "debit", "isFirstDebit": true, "amount": 0, "currency": "EUR", "freePlayStake": 100, "freePlayUsed": true, "serial": "f089ec54-8e3b-40b0-92c3-e614402f5358" }The operator uses a free ticket worth 1 EUR instead of a debit

errorCode

The operator uses this structure to return an error as the result of an API call.

attributetypeallowed valuesmandatorynotes
idnumberID of error that occurred (0 means no error, a successful operation)YESsee list of known errors
msgstringoptional explanationNOThe game client does not display this text. Use it to give hints in log files
clientmsgstringoptional message to be displayed in game clientNOThe game client displays this message exactly, without further interpretation
SamplesDescription
{ "id": 1, "msg": "player id unknown" }example of an error when the API cannot find a player
{ "id": 0 }example of errorCode for no error (a successful operation)
{ "id": 11, "msg": "betlimit reached", "clientmsg": "You reached your daily betting limit!" }example of an error when the player reaches the bet limit, with text for the game client to display

clientMessage

The operator uses this structure to trigger a dialog in the game client. Use it to pass a message about a switch from bonus to real money, to control betting limits, or to show reality checks. Additional flags let the operator interrupt an autoplay.

attributetypecontentmandatorynotes
titlestringtitle of the message boxYES
msgstringmessage that the game client displays in a message boxYES
buttonsarray of jsondataoptional list of buttons to display. See notes for detailsNOIf this field is not present, the game client shows a standard "OK" button. This button closes the dialog box without further action
stopAutoPlaybooleantrue falseNOIf this field is true, the game client interrupts any running autoplay. The player must resume autoplay manually

Structure of button data in a client message

Use the following object to define buttons for a client message box.

attributetypeallowed valuesmandatorynotes
labelstringtext on buttonYES
urlstringURL that the game client calls when the player clicks the buttonNOIf this field is not present, the button just closes the box
SampleDescription
{ "title": "Reality check", "msg": "You are now playing for 60 minutes, do you want to continue ?", "stopAutoPlay": true, "buttons": [ { "label": "Yes" }, { "label": "No", "url": "http://gotolobby" } ] }Displays a reality check message box. Stops autoplay. Gives the player a choice to continue or exit.

tickets

The API uses this structure to return information about tickets and freeplays available to a player. See Appendix D for details on freeplays.

attributetypeallowed valuesmandatorynotes
serialstringSerial assign to this packageYESUnique for each operator
stakeamounta positive integer greater than 0, no fractionsYESStake for which the freeplay is valid
currencycurrencyany 3 character currency codeYESCurrency for which the freeplay is valid
availableTicketsnumbera positive integer greater than 0YESNumber of freeplays available
SamplesDescription
{ "serial": "unique-value", "currency": "EUR", "stake": 100, "availableTickets": 4 }4 tickets with a stake of 1 EUR available
{ "serial": "dbf8907c-8002-4bdc-8804-3b1ec00d21be", "currency": "EUR", "stake": 500, "availableTickets": 1 }One ticket with a stake of 5 EUR available