Developer portal

Developer portal / API reference

operator API  /  Sessions

Create a game session and get its one-time launch URL

POST/api/v1/operator/sessions

Creates a session for one player, one game and one currency and returns a launch URL. Put the URL into an iframe (or redirect to it) immediately: it can be opened once and within 120 seconds. Create a new session for every launch.

No wallet call is made here. The first wallet call (balance) happens when the game loads.

The game page can only be framed by the origins registered for your operator account. In demo mode the game uses play money held by SPILVON, makes no wallet calls, and player_id is optional (an anonymous id is generated).

Authentication

X-Spilvon-Operator + X-Spilvon-Timestamp + X-Spilvon-Signature

Request body

application/json
player_idallOf
Required for mode: real; optional for mode: demo.
currencystring · required
Currency enabled for your operator account: USD, EUR, GBP, TRY, USDT, USDC, TRX, BTC, ETH, LTC, SOL, DOGE, and the display units mBTC, uBTC, mETH, uETH, mLTC, uLTC (same money as the base coin, scaled; the session, wallet calls and reports then all use the unit code and its decimals).
game_codestring · required
tokenstring | null
Your own session token. Echoed unchanged in every wallet call for this session. Recommended.
langstring
Game language. Unsupported languages fall back to en. Supported - en tr de es pt fr it nl pl ru uk el fi ja ko zh id vi th hi.
countrystring | null
ISO 3166-1 alpha-2 country of the player. Stored with the session; no jurisdiction rules are applied from it today.
devicestring | null
Stored with the session; the game adapts to the screen on its own.desktop · mobile · null
jurisdictionstring | null
Licence jurisdiction this session is played under: a SPILVON jurisdiction profile code your account holds (published profiles as of 2026-11-30: default, uk, de). Omitted: your default jurisdiction, else your only one, else default. The profile's rules (feature buys, autoplay limits, minimum cycle time, turbo, session clock, net position, reality check, RTP display, stake caps, game whitelist, required certificates), tightened by your operator override and by this request, are frozen on the session and enforced. Errors: JURISDICTION_NOT_ALLOWED, JURISDICTION_REQUIRED, JURISDICTION_NOT_CONFIGURED, GAME_NOT_AVAILABLE_IN_JURISDICTION, DEMO_NOT_AVAILABLE_IN_JURISDICTION.
reality_check_minutesinteger
Reality-check interval for this player. May only tighten the jurisdiction's interval.
player_age_bandstring
Required (PLAYER_AGE_BAND_REQUIRED) where the jurisdiction caps stakes by age.18-24 · 25+
history_urlstring | null
https URL of the player's gaming history at your site, linked from the reality check. Required where the jurisdiction says so (HISTORY_URL_REQUIRED).
session_started_atinteger
Epoch milliseconds when the player's session at your site began (within the last 24 h), so the session clock and reality check count from your login, not from this launch.
lobby_urlstring | null
https URL for the game's Home button (http allowed outside production).
deposit_urlstring | null
https URL for the game's Deposit button.
modestring
real · demo
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "game_code",
    "currency"
  ],
  "additionalProperties": true,
  "properties": {
    "player_id": {
      "allOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^[A-Za-z0-9_.@:-]+$",
          "description": "Your stable id for the player.",
          "examples": [
            "u-48213"
          ]
        }
      ],
      "description": "Required for `mode: real`; optional for `mode: demo`."
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Za-z0-9]{2,8}$",
      "description": "Currency enabled for your operator account: USD, EUR, GBP, TRY, USDT, USDC, TRX, BTC, ETH, LTC, SOL, DOGE, and the display units mBTC, uBTC, mETH, uETH, mLTC, uLTC (same money as the base coin, scaled; the session, wallet calls and reports then all use the unit code and its decimals).",
      "examples": [
        "USD",
        "USDT",
        "BTC"
      ]
    },
    "game_code": {
      "type": "string",
      "maxLength": 32,
      "pattern": "^[a-z0-9-]+$",
      "examples": [
        "dice",
        "zenith",
        "thunder-anvil"
      ]
    },
    "token": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 512,
      "description": "Your own session token. Echoed unchanged in every wallet call for this session. Recommended."
    },
    "lang": {
      "type": "string",
      "pattern": "^[a-z]{2}(-[A-Z]{2})?$",
      "default": "en",
      "description": "Game language. Unsupported languages fall back to `en`. Supported - en tr de es pt fr it nl pl ru uk el fi ja ko zh id vi th hi."
    },
    "country": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[A-Z]{2}$",
      "description": "ISO 3166-1 alpha-2 country of the player. Stored with the session; no jurisdiction rules are applied from it today."
    },
    "device": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "desktop",
        "mobile",
        null
      ],
      "description": "Stored with the session; the game adapts to the screen on its own."
    },
    "jurisdiction": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[a-z][a-z0-9-]{1,15}$",
      "description": "Licence jurisdiction this session is played under: a SPILVON jurisdiction profile code\nyour account holds (published profiles as of 2026-11-30: `default`, `uk`, `de`).\nOmitted: your default jurisdiction, else your only one, else `default`. The profile's\nrules (feature buys, autoplay limits, minimum cycle time, turbo, session clock, net\nposition, reality check, RTP display, stake caps, game whitelist, required\ncertificates), tightened by your operator override and by this request, are frozen on\nthe session and enforced. Errors: `JURISDICTION_NOT_ALLOWED`, `JURISDICTION_REQUIRED`,\n`JURISDICTION_NOT_CONFIGURED`, `GAME_NOT_AVAILABLE_IN_JURISDICTION`,\n`DEMO_NOT_AVAILABLE_IN_JURISDICTION`.\n"
    },
    "reality_check_minutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1440,
      "description": "Reality-check interval for this player. May only tighten the jurisdiction's interval."
    },
    "player_age_band": {
      "type": "string",
      "enum": [
        "18-24",
        "25+"
      ],
      "description": "Required (`PLAYER_AGE_BAND_REQUIRED`) where the jurisdiction caps stakes by age."
    },
    "history_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "maxLength": 512,
      "description": "https URL of the player's gaming history at your site, linked from the reality check. Required where the jurisdiction says so (`HISTORY_URL_REQUIRED`)."
    },
    "session_started_at": {
      "type": "integer",
      "description": "Epoch milliseconds when the player's session at your site began (within the last 24 h), so the session clock and reality check count from your login, not from this launch."
    },
    "lobby_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "maxLength": 512,
      "description": "https URL for the game's Home button (http allowed outside production)."
    },
    "deposit_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "maxLength": 512,
      "description": "https URL for the game's Deposit button."
    },
    "mode": {
      "type": "string",
      "enum": [
        "real",
        "demo"
      ],
      "default": "real"
    }
  }
}
Example · Real-money launch
application/json
{
  "player_id": "u-48213",
  "currency": "USDT",
  "game_code": "zenith",
  "token": "casino-session-7f3a9c",
  "lang": "en",
  "country": "DE",
  "device": "mobile",
  "lobby_url": "https://casino.example/lobby",
  "deposit_url": "https://casino.example/cashier",
  "mode": "real"
}
Example · Demo (play money) launch, no player needed
application/json
{
  "currency": "USD",
  "game_code": "dice",
  "lang": "tr",
  "mode": "demo"
}

Responses

201 Session created.

Session created.

application/json
session_idstring · required
player_idstring · required
Your player id, or the generated demo-… id for an anonymous demo session.
launch_urlstring · required
One-time URL of the game page. Open within expires_in seconds.
expires_ininteger · required
sandboxboolean
Present (true) when the session belongs to a sandbox account (play money, wallet calls flagged sandbox).
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "session_id",
    "player_id",
    "launch_url",
    "expires_in"
  ],
  "properties": {
    "session_id": {
      "type": "string",
      "pattern": "^ses_[0-9a-f]{32}$"
    },
    "player_id": {
      "type": "string",
      "description": "Your player id, or the generated `demo-…` id for an anonymous demo session."
    },
    "launch_url": {
      "type": "string",
      "format": "uri",
      "description": "One-time URL of the game page. Open within `expires_in` seconds."
    },
    "expires_in": {
      "type": "integer",
      "const": 120
    },
    "sandbox": {
      "type": "boolean",
      "const": true,
      "description": "Present (true) when the session belongs to a sandbox account (play money, wallet calls flagged `sandbox`)."
    }
  }
}
Example
{
  "session_id": "ses_0193c4d2a1b07e4f9a3c5d6e7f801234",
  "player_id": "u-48213",
  "launch_url": "https://games.example.com/play/zenith?t=eyJ0IjoibGF1bmNoIiwic2lkIjoi...",
  "expires_in": 120
}
400 The request is malformed: INVALID_JSON, INVALID_BODY (not UTF-8), INVALID_P

The request is malformed: INVALID_JSON, INVALID_BODY (not UTF-8), INVALID_PARAMETER (the message names the field), INVALID_AMOUNT, CURRENCY_NOT_SUPPORTED; on session creation also JURISDICTION_NOT_ALLOWED, JURISDICTION_REQUIRED, PLAYER_AGE_BAND_REQUIRED, HISTORY_URL_REQUIRED.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
Example
{
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "currency must be a string"
  },
  "request_id": "6f1c2a54-5b1e-4a8e-9a43-3f3e8b8f9d10"
}
401 Authentication failed: INVALID_SIGNATURE (unknown operator, missing/malform

Authentication failed: INVALID_SIGNATURE (unknown operator, missing/malformed headers or a wrong signature, deliberately indistinguishable), TIMESTAMP_OUT_OF_RANGE (check your clock), REPLAYED_REQUEST (this exact signed request was already received: sign again).

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
Example
{
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "authentication failed"
  },
  "request_id": "6f1c2a54-5b1e-4a8e-9a43-3f3e8b8f9d10"
}
403 IP_NOT_ALLOWED, OPERATOR_SUSPENDED, GAME_DISABLED (the game is not enabled

IP_NOT_ALLOWED, OPERATOR_SUSPENDED, GAME_DISABLED (the game is not enabled for you), DEMO_NOT_AVAILABLE (the title has no demo room), REAL_PLAY_NOT_ALLOWED (a demo-only account asked for mode: real), GAME_NOT_AVAILABLE_IN_JURISDICTION, DEMO_NOT_AVAILABLE_IN_JURISDICTION, or IDENTITY_MISMATCH.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
Example
{
  "error": {
    "code": "GAME_DISABLED",
    "message": "this game is not enabled for the operator"
  },
  "request_id": "6f1c2a54-5b1e-4a8e-9a43-3f3e8b8f9d10"
}
404 GAME_NOT_FOUND: unknown game_code.

GAME_NOT_FOUND: unknown game_code.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
405 METHOD_NOT_ALLOWED: the path exists with another method.

METHOD_NOT_ALLOWED: the path exists with another method.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
409 JURISDICTION_NOT_CONFIGURED: no valid published profile for the jurisdictio

JURISDICTION_NOT_CONFIGURED: no valid published profile for the jurisdiction.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
413 BODY_TOO_LARGE: over 16 KiB (64 KiB for issuing free rounds).

BODY_TOO_LARGE: over 16 KiB (64 KiB for issuing free rounds).

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
421 WRONG_HOST (421 Misdirected Request): this host does not serve this path; t

WRONG_HOST (421 Misdirected Request): this host does not serve this path; the message names the right host.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
429 RATE_LIMITED. Wait Retry-After seconds.

RATE_LIMITED. Wait Retry-After seconds.

Response headers
Headers
{
  "Retry-After": {
    "description": "Seconds until the current one-minute window ends.",
    "schema": {
      "type": "integer",
      "minimum": 1
    }
  },
  "X-RateLimit-Limit": {
    "description": "Requests allowed per minute.",
    "schema": {
      "type": "integer"
    }
  },
  "X-RateLimit-Remaining": {
    "description": "Always 0 on a 429.",
    "schema": {
      "type": "integer"
    }
  }
}
application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
Example
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "rate limit of 3000 requests per minute exceeded; retry after 12 s"
  },
  "request_id": "6f1c2a54-5b1e-4a8e-9a43-3f3e8b8f9d10"
}
500 INTERNAL_ERROR. Safe to retry with a freshly signed request; quote request_

INTERNAL_ERROR. Safe to retry with a freshly signed request; quote request_id if it persists.

application/json
errorobject · required
request_idstring
Schema (resolved)
JSON Schema
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable, machine-readable. Branch on this, never on `message`.",
          "enum": [
            "INVALID_SIGNATURE",
            "TIMESTAMP_OUT_OF_RANGE",
            "REPLAYED_REQUEST",
            "IP_NOT_ALLOWED",
            "OPERATOR_SUSPENDED",
            "RATE_LIMITED",
            "BODY_TOO_LARGE",
            "INVALID_BODY",
            "INVALID_JSON",
            "INVALID_PARAMETER",
            "INVALID_AMOUNT",
            "NOT_FOUND",
            "METHOD_NOT_ALLOWED",
            "GAME_NOT_FOUND",
            "GAME_DISABLED",
            "REAL_PLAY_NOT_ALLOWED",
            "JURISDICTION_NOT_ALLOWED",
            "JURISDICTION_REQUIRED",
            "JURISDICTION_NOT_CONFIGURED",
            "GAME_NOT_AVAILABLE_IN_JURISDICTION",
            "DEMO_NOT_AVAILABLE_IN_JURISDICTION",
            "PLAYER_AGE_BAND_REQUIRED",
            "HISTORY_URL_REQUIRED",
            "BET_STEP",
            "GAME_NOT_ELIGIBLE",
            "CURRENCY_NOT_SUPPORTED",
            "BET_OUT_OF_RANGE",
            "IDENTITY_MISMATCH",
            "ROUND_NOT_FOUND",
            "REFERENCE_CONFLICT",
            "CAMPAIGN_CANCELLED",
            "REFERENCE_NOT_FOUND",
            "AWARD_NOT_FOUND",
            "AWARD_NOT_ACTIVE",
            "INTERNAL_ERROR",
            "WRONG_HOST",
            "DEMO_NOT_AVAILABLE",
            "SANDBOX_LIMIT_REACHED",
            "SANDBOX_NOT_ALLOWED",
            "SANDBOX_ONLY",
            "NOT_ON_HOSTED_WALLET",
            "HOSTED_WALLET_NOT_CONFIGURED",
            "HOSTED_WALLET_UNAVAILABLE",
            "HOSTED_WALLET_ERROR",
            "PLAYER_LIMIT_REACHED",
            "SESSION_LIMIT_REACHED",
            "CURRENCY_MISMATCH",
            "INVALID_REQUEST",
            "POOL_NOT_FOUND",
            "OPERATOR_NOT_FOUND",
            "INVALID_GAME_CONFIG",
            "STALE_GAME_CONFIG",
            "APPROVAL_PENDING",
            "APPROVAL_REQUIRED",
            "OFFLINE_CHANGE_REQUIRED",
            "MATH_BUILD_CHANGED",
            "RTP_VARIANT_NOT_CERTIFIED",
            "NO_PLAYABLE_STAKE"
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable detail for your logs."
        }
      }
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}

Request signing samples

Canonical string and HMAC helpers from the downloadable samples. Wallet callbacks may also use Ed25519; see the wallet signing modes.

Node.js node/spilvon.mjs
Node.js
export const signingString = (ts, method, pathAndQuery, body) => `${ts}.${method.toUpperCase()}.${pathAndQuery}.${body}`;
export const hmacHex = (secret, s) => createHmac("sha256", secret).update(s, "utf8").digest("hex");
Signed session request
Node.js
export async function createSession({ playerId, gameCode, currency = "USD", lang = "en", token, mode = "real" }) {
  const path = "/api/v1/operator/sessions";
  const body = JSON.stringify({ player_id: playerId, game_code: gameCode, currency, lang, token, mode, lobby_url: "https://casino.example/lobby", deposit_url: "https://casino.example/cashier" });
  const ts = String(Date.now());
  const res = await fetch(env("SPILVON_URL") + path, {
    method: "POST",
    headers: {
      "content-type": "application/json",
      "x-spilvon-operator": env("SPILVON_OPERATOR"),
      "x-spilvon-timestamp": ts,
      "x-spilvon-signature": hmacHex(env("SPILVON_API_SECRET"), signingString(ts, "POST", path, body)),
    },
    body, // send exactly the string you signed
  });
  const json = await res.json();
  if (res.status !== 201) throw new Error(`${json.error?.code}: ${json.error?.message} (request_id ${json.request_id})`);
  return json; // { session_id, player_id, launch_url, expires_in: 120 } -> put launch_url in an iframe now
}
Download full sample
Python python/spilvon.py
Python
def signing_string(ts: str, method: str, path_and_query: str, body: str) -> str:
    return f"{ts}.{method.upper()}.{path_and_query}.{body}"


def hmac_hex(secret: str, s: str) -> str:
    return hmac.new(secret.encode(), s.encode("utf-8"), hashlib.sha256).hexdigest()
Signed session request
Python
def create_session(player_id: str, game_code: str, currency="USD", lang="en", token=None, mode="real") -> dict:
    path = "/api/v1/operator/sessions"
    body = json.dumps({"player_id": player_id, "game_code": game_code, "currency": currency, "lang": lang, "token": token, "mode": mode,
                       "lobby_url": "https://casino.example/lobby", "deposit_url": "https://casino.example/cashier"})
    ts = str(int(time.time() * 1000))
    req = urllib.request.Request(env("SPILVON_URL") + path, data=body.encode("utf-8"), method="POST", headers={
        "Content-Type": "application/json",
        "X-Spilvon-Operator": env("SPILVON_OPERATOR"),
        "X-Spilvon-Timestamp": ts,
        "X-Spilvon-Signature": hmac_hex(env("SPILVON_API_SECRET"), signing_string(ts, "POST", path, body)),
    })
    try:
        with urllib.request.urlopen(req, timeout=10) as res:
            return json.load(res)  # {session_id, player_id, launch_url, expires_in: 120}
    except urllib.error.HTTPError as e:
        err = json.load(e)
        raise RuntimeError(f"{err['error']['code']}: {err['error']['message']} (request_id {err.get('request_id')})")
Download full sample
Go go/main.go
Go
func signingString(ts, method, pathAndQuery, body string) string {
	return ts + "." + strings.ToUpper(method) + "." + pathAndQuery + "." + body
}

func hmacHex(secret, s string) string {
	m := hmac.New(sha256.New, []byte(secret))
	m.Write([]byte(s))
	return hex.EncodeToString(m.Sum(nil))
}
Signed session request
Go
func createSession(playerID, gameCode, currency string) (map[string]any, error) {
	path := "/api/v1/operator/sessions"
	body, _ := json.Marshal(map[string]any{"player_id": playerID, "game_code": gameCode, "currency": currency, "lang": "en",
		"token": "casino-session-" + playerID, "lobby_url": "https://casino.example/lobby", "deposit_url": "https://casino.example/cashier"})
	ts := strconv.FormatInt(time.Now().UnixMilli(), 10)
	rq, _ := http.NewRequest("POST", os.Getenv("SPILVON_URL")+path, bytes.NewReader(body))
	rq.Header.Set("Content-Type", "application/json")
	rq.Header.Set("X-Spilvon-Operator", os.Getenv("SPILVON_OPERATOR"))
	rq.Header.Set("X-Spilvon-Timestamp", ts)
	rq.Header.Set("X-Spilvon-Signature", hmacHex(os.Getenv("SPILVON_API_SECRET"), signingString(ts, "POST", path, string(body))))
	res, err := (&http.Client{Timeout: 10 * time.Second}).Do(rq)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()
	var out map[string]any
	_ = json.NewDecoder(res.Body).Decode(&out)
	if res.StatusCode != 201 {
		return nil, fmt.Errorf("launch failed: %v", out)
	}
	return out, nil // session_id, player_id, launch_url, expires_in (120)
}
Download full sample · go.mod
PHP php/spilvon.php
PHP
function signing_string(string $ts, string $method, string $pathAndQuery, string $body): string {
    return $ts . '.' . strtoupper($method) . '.' . $pathAndQuery . '.' . $body;
}

function hmac_hex(string $secret, string $s): string {
    return hash_hmac('sha256', $s, $secret);
}
Signed session request
PHP
function create_session(string $playerId, string $gameCode, string $currency = 'USD'): array {
    $path = '/api/v1/operator/sessions';
    $body = json_encode(['player_id' => $playerId, 'game_code' => $gameCode, 'currency' => $currency, 'lang' => 'en',
        'token' => "casino-session-$playerId", 'lobby_url' => 'https://casino.example/lobby', 'deposit_url' => 'https://casino.example/cashier'], JSON_UNESCAPED_SLASHES);
    $ts = (string) (int) floor(microtime(true) * 1000);
    $ch = curl_init(getenv('SPILVON_URL') . $path);
    curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Spilvon-Operator: ' . getenv('SPILVON_OPERATOR'),
        "X-Spilvon-Timestamp: $ts",
        'X-Spilvon-Signature: ' . hmac_hex(getenv('SPILVON_API_SECRET'), signing_string($ts, 'POST', $path, $body)),
    ]]);
    $out = json_decode(curl_exec($ch), true);
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 201) throw new RuntimeException(($out['error']['code'] ?? '?') . ' request_id ' . ($out['request_id'] ?? '?'));
    return $out; // session_id, player_id, launch_url, expires_in (120)
}
Download full sample

Reviewed, not executed by the sample authors.