Originals EngineOperator API

API reference: calls you receive

Authentication

We send you the launch token; you tell us who the player is, the balance, and optionally a bet cap.

POST {wallet-url}/auth

Called
once per real launch, and once per round-details view
Timeout
your debit timeout: 2,000 ms unless agreed otherwise (500–5,000 ms)
Retries
never
Signed
yes, with your client key (how)

Check the token you put in the launch URL and answer with the player. The token is yours: whether it may be used twice is your decision, but we use each one once (a second launch with it is refused). No money moves here, so a failed auth leaves nothing to undo.

Request#

Authentication: request fields
FieldTypePresenceMeaning
user_tokenstring (1–512 chars)requiredThe token of the launch URL, or the player_token of a round-details link.
session_tokenstringrequiredA new token we made for this launch, 64 lower-case hex characters. Every later call of the session carries it. For a round-details view it is a fresh value used for nothing else.
platform"mobile" | "desktop"requiredmobile or desktop, from the browser that opened the launch.
currencystringrequiredThe launch currency.

Answer#

Authentication: 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_idstringrequired in dataMust equal the launch user. Another value refuses the launch.
data.usernamestringoptionalIgnored.
data.brandstringoptionalConfirms the brand of the launch: if present it must equal the launch brand; it is required when the launch names a brand other than your default brand.
data.balanceintegerrequired in dataThe opening balance in units. Shown rounded down.
data.currencystringrequired in dataMust equal the launch currency.
data.is_bonus_balancebooleanoptionaltrue shows the tag "Bonus" beside the balance. Display only.
data.maxbetinteger (≥ 0)optionalThe player's largest bet in units, at least 0. Every bet above it, free bets included, is refused (BET_ABOVE_MAX), and the game offers no larger stake. 0, or a value below one smallest amount (1–9 units of a two-decimal currency), keeps the game open but refuses every bet. Absent: no cap of yours.
data.additionalOperatorDataany JSONoptionalAny JSON value of at most 2,048 bytes as text. We hand it back unchanged to your page in ifc.init and ifc.close. A larger value is dropped. We never read, log or store it.

Examples#

Request

{
  "user_token": "b1c4e0f2-launch-7731",
  "session_token": "5f2b8c1d9e3a4f60718293a4b5c6d7e8f9012345678901234567890123456789",
  "platform": "mobile",
  "currency": "USD"
}

Accepted

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

Accepted, another brand

{
  "code": 200,
  "message": "ok",
  "data": {
    "user_id": "u_829301",
    "brand": "onyx",
    "balance": 49992,
    "currency": "USD"
  }
}

Refused (401)

{
  "code": 401,
  "message": "invalid token"
}

Codes and what we do#

Authentication: codes
CodeMeaningWhat we do
200The token is valid.The session opens, if user_id and currency are the launch's and brand (when needed) confirms the launch brand. Another user_id: refused as INVALID_SESSION. Another currency: refused as WALLET_UNAVAILABLE, with an alert. A brand mismatch: refused as NOT_FOUND.
401Invalid token.The launch is refused: the player sees "Your session has ended. Please reopen the game from the lobby."
403Expired token.The launch is refused: "Your session has expired. Please reopen the game from the lobby."
413Our signature did not verify.The launch is refused as WALLET_UNAVAILABLE, and we raise an alert.
500Any other error.The launch is refused as WALLET_UNAVAILABLE: "The wallet is not responding. Nothing was charged; please try again."

When there is no usable answer#

An unknown outcome means the call may or may not have been applied. For auth: the launch is refused as WALLET_UNAVAILABLE; nothing is stored.

auth: 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

Notes#

  • A launch with a brand other than your default brand needs data.brand with that brand; this stops a player from switching brands by editing the URL.
  • Two launches with one token both reach auth. If you accept both, only one session opens on our side.
  • Keep session_token: it identifies the game session in every later call, and you may use it to match calls to sessions.