Originals EngineOperator API

API reference: calls you receive

Player info

We ask for the player's current balance.

POST {wallet-url}/info

Called
when the game refreshes the balance, when a round has no balance of its own, and by Test connection
Timeout
your debit timeout: 2,000 ms unless agreed otherwise (500–5,000 ms)
Retries
never
Signed
yes

Not called at launch (auth gives the opening balance). The game calls it after a failed bet request, after a bet answered without a balance, and on your page's ifc.update.balance command; each session may cause at most 6 such reads a minute. It is also used for a round whose only balance came from a 409, and for a free-bet round whose deposit is not confirmed yet. Whenever a round has no balance figure we may show and this call fails, the round is still answered as placed (code 200 on your page's ifc.make.bet.complete or ifc.cashout.complete) and its result shown, without a balance, and the game reads the balance once more.

Request#

Player info: request fields
FieldTypePresenceMeaning
user_idstring (1–128 chars)requiredYour player reference: the user of the launch.
session_tokenstringrequiredOur token for this game session: 64 lower-case hex characters, made at launch and sent in every later call of the session, also after it ended. It is not a credential.
currencystringrequiredThe session currency (the round's currency).

Answer#

Player info: answer fields
FieldTypePresenceMeaning
codeintegerrequiredThe outcome: see the codes. Always answer with HTTP status 200.
messagestringoptionalA short text for people. Not used.
dataobjectrequired with code 200The result. Required with code 200 (and, on a money method, with 409).
data.user_idstringoptionalMust equal ours if present.
data.usernamestringoptionalIgnored.
data.balanceintegerrequired in dataThe balance in units. Shown rounded down.
data.currencystringoptionalMust equal ours if present.
data.is_bonus_balancebooleanoptionalUpdates the "Bonus" tag beside the balance.

Examples#

Request

{
  "user_id": "u_829301",
  "session_token": "5f2b8c1d9e3a4f60718293a4b5c6d7e8f9012345678901234567890123456789",
  "currency": "USD"
}

Accepted

{
  "code": 200,
  "message": "ok",
  "data": {
    "user_id": "u_829301",
    "username": "Dan",
    "balance": 49992,
    "currency": "USD",
    "is_bonus_balance": false
  }
}

Refused (401)

{
  "code": 401,
  "message": "session not found"
}

Codes and what we do#

Player info: codes
CodeMeaningWhat we do
200The balance.Shown to the player, in the order of our balance numbering.
401The session or token is not valid.The game is told the session ended (INVALID_SESSION).
403The session or token expired.As 401.
413Our signature did not verify.The balance stays as shown; WALLET_UNAVAILABLE, and an alert.
500Any other error.The balance stays as shown; WALLET_UNAVAILABLE.

When there is no usable answer#

An unknown outcome means the call may or may not have been applied. For info: the balance stays as shown.

info: answers we cannot use
What arrivedRead as
No answer within the timeout, a network error, a redirect (never followed)unknown outcome
HTTP status 500 or higher, whatever the body saysunknown outcome
HTTP status below 500 with a JSON body and an integer codethe code counts, whatever the HTTP status
A body that is not JSON, has no integer code, or has code 200 without the required data fields of the right type (amounts by the integer rule)unknown outcome
Code 200 whose data.provider_tx_id, data.user_id or data.currency differs from oursunknown outcome
A money method answered 409 without our provider_tx_id in dataunknown outcome, and an alert on our side
A code this method does not listread as 500