Portale per sviluppatori

Portale per sviluppatori / Guida per gli operatori

Documentazione tecnica in inglese

OPERATOR GUIDE

Opening a game

Text
POST https://<spilvon-host>/api/v1/operator/sessions        (signed with your API secret)
json
{
  "player_id": "u-48213",
  "currency": "USDT",
  "game_code": "zenith",
  "token": "your-own-session-token-for-this-player",
  "lang": "en",
  "country": "DE",
  "device": "mobile",
  "lobby_url": "https://casino.example/lobby",
  "deposit_url": "https://casino.example/cashier",
  "mode": "real"
}
FieldRequiredNotes
player_idyes (not for demo)Your stable id for the player. 1–64 chars of A–Z a–z 0–9 _ . @ : -.
currencyyesSee section 5. Fixed for the session.
game_codeyesFrom GET /api/v1/operator/games.
tokenrecommendedYour own session token. We send it back unchanged on every wallet call so you can find the session. Up to 512 chars.
langnoen, tr, … Default en.
country, devicenoISO country code; desktop or mobile.
lobby_url, deposit_urlnohttps URLs the game uses for its Home and Deposit buttons.
modenoreal (default) or demo. Demo uses play money, makes no wallet calls and needs no player_id. A demo-only account (the kind used for public websites) is refused real with 403 REAL_PLAY_NOT_ALLOWED.
jurisdictionnoThe licence this session plays under, e.g. default, uk, de (section 6.2). It must be one your account holds; without it your default applies.
player_age_bandwhen required18-24 or 25+. Required where the jurisdiction caps stakes by age (UK).
reality_check_minutesnoReality-check interval for this player (1–1440). Can only make the jurisdiction's interval shorter.
history_urlwhen requiredhttps page of the player's account history, linked from the reality check.
session_started_atnoWhen the player's casino session began (epoch ms, last 24 h), so the session clock and the reality check count from there.

lang is one of en tr de es pt fr it nl pl ru uk el fi ja ko zh id vi th hi (anything else falls back to en). country and device are recorded but change nothing today; the jurisdiction decides the rules, never the country.

Errors specific to this call: 400 JURISDICTION_NOT_ALLOWED, 400 JURISDICTION_REQUIRED (you hold several and have no default), 400 PLAYER_AGE_BAND_REQUIRED, 400 HISTORY_URL_REQUIRED, 403 REAL_PLAY_NOT_ALLOWED, 403 DEMO_NOT_AVAILABLE_IN_JURISDICTION, 403 GAME_NOT_AVAILABLE_IN_JURISDICTION, 409 JURISDICTION_NOT_CONFIGURED. Request bodies are limited to 16 KiB (64 KiB for issuing free rounds); larger ones get 413 BODY_TOO_LARGE.

Response 201:

json
{ "session_id": "ses_…", "player_id": "u-48213", "launch_url": "https://<spilvon-host>/play/zenith?t=…", "expires_in": 120 }

Put launch_url in an iframe straight away. It works once and must be opened within 120 seconds; create a new session for every game launch.

html
<iframe src="LAUNCH_URL" allow="autoplay; fullscreen" style="border:0;width:100%;height:100%"></iframe>

The game can only be framed by the site origins registered for your operator account (tell us every origin, e.g. https://casino.example and https://m.casino.example). Each must be an exact origin, https://host[:port]: no path, no wildcard. Aggregator accounts, whose casinos are not known in advance, may instead be registered with the single value https: (any https site may frame the games; never plain http). On small screens, give the frame the whole viewport.

Each signed request is accepted once. If you retry, sign again with a fresh timestamp.

Messages between the game and your page (optional)

The game posts to its parent: { source: "spilvon", type, … } with type = ready, roundStart, roundEnd (round_id, bet, payout), balance (balance, currency), deposit (player pressed Deposit), exit (player pressed Home), realityCheck (open: true, then open: false, choice). Messages are addressed to your registered origin only, never to * (except for aggregator accounts registered with https:). Check event.origin is the SPILVON host.

Your page may post to the game frame: { source: "spilvon-host", type } with type = refreshBalance (after a deposit), pause, resume, mute, unmute, stopAutoplay, and, if you run your own reality check, realityCheck (the game stops autoplay and starts no new round) and realityCheckAck (the player chose to continue). Messages from any other origin than your registered ones are ignored.