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#
| Field | Type | Presence | Meaning |
|---|---|---|---|
user_token | string (1–512 chars) | required | The token of the launch URL, or the player_token of a round-details link. |
session_token | string | required | A 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" | required | mobile or desktop, from the browser that opened the launch. |
currency | string | required | The launch currency. |
Answer#
| Field | Type | Presence | Meaning |
|---|---|---|---|
code | integer | required | The outcome: see the codes. Always answer with HTTP status 200. |
message | string | optional | A short text for people. Not used. |
data | object | required with code 200 | The result. Required with code 200 (and, on a money method, with 409). |
data.user_id | string | required in data | Must equal the launch user. Another value refuses the launch. |
data.username | string | optional | Ignored. |
data.brand | string | optional | Confirms 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.balance | integer | required in data | The opening balance in units. Shown rounded down. |
data.currency | string | required in data | Must equal the launch currency. |
data.is_bonus_balance | boolean | optional | true shows the tag "Bonus" beside the balance. Display only. |
data.maxbet | integer (≥ 0) | optional | The 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.additionalOperatorData | any JSON | optional | Any 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#
| Code | Meaning | What we do |
|---|---|---|
200 | The 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. |
401 | Invalid token. | The launch is refused: the player sees "Your session has ended. Please reopen the game from the lobby." |
403 | Expired token. | The launch is refused: "Your session has expired. Please reopen the game from the lobby." |
413 | Our signature did not verify. | The launch is refused as WALLET_UNAVAILABLE, and we raise an alert. |
500 | Any 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.
| What arrived | Read as |
|---|---|
| No answer within the timeout, a network error, a redirect (never followed) | unknown outcome |
| HTTP status 500 or higher, whatever the body says | unknown outcome |
HTTP status below 500 with a JSON body and an integer code | the 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 ours | unknown outcome |
A money method answered 409 without our provider_tx_id in data | unknown outcome, and an alert on our side |
| A code this method does not list | read as 500 |
Notes#
- A launch with a
brandother than your default brand needsdata.brandwith 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.