KNOWLEDGE API & GAME SESSIONS
Casino Game Session Lifecycle: Launch, Wallet and Settlement
Follow the technical journey of an online casino game session: who checks the player, how the launch URL is issued, what happens to wallet events, and why retries, reversals and reconciliation matter after the browser closes.
This is a reference integration model, not a specification for CASINO-AGG or any particular provider. Actual request formats, party responsibilities and settlement rules depend on the agreed API contract.
What a game session actually is
A player can be logged into a casino account without having an active game. A game session begins when the platform requests access to a particular game for that player. A game round is a smaller unit inside that experience: one spin, hand or other defined cycle. Keeping these three identities separate is the first step toward reliable integration.
A session usually connects an operator account, a game identifier, an integration tenant, a currency and a time-limited launch context. It does not necessarily own the player's money or define when all related financial movements have finished. Some games continue a round after a connection drops; some send a final credit after the browser has closed.
Browser closed does not automatically mean round settled. Session state, game-round state and wallet-transaction state require separate identifiers and explicit reconciliation rules.
Three systems, different responsibilities
A typical aggregated launch crosses the operator platform, a content aggregation layer and the game provider. The operator authenticates the player and applies account-level restrictions. The aggregator provides a normalized integration path and routes information to participating providers. The provider runs the game and reports its events through the agreed interface.
| System | Usually responsible for | Questions to confirm |
|---|---|---|
| Operator platform | Player identity, eligibility and account-facing wallet | Who owns the ledger and responds to failed transactions? |
| Aggregation layer | Catalog mapping, session routing and callback translation | Which identifiers and retry semantics survive provider changes? |
| Game provider | Game execution, outcome and provider-side round state | How are delayed results, cancellation and interrupted play reported? |
This is a reference model, not a universal assignment of duties. A managed-wallet integration, transfer wallet or another commercial arrangement can shift responsibility. The signed interface contract must say which system is authoritative for each state.
Before launch: a valid game is not always an available game
A catalog entry can be technically valid yet unavailable for a particular launch. The operator should evaluate player eligibility, market restrictions, currency support, the game configuration, the current provider entitlement and any platform-specific limits before asking for a real-money session.
- Use the exact game identifier returned by the authorized catalog; do not construct IDs from provider names or URL fragments.
- Check whether the operator, brand and target market are enabled for that specific title, not just for the studio.
- Confirm currency and amount representation, including minor units, precision and bonus-money behavior.
- Keep the player's public-facing device and locale information separate from backend credentials and secrets.
- Treat free-play and real-money launches as different acceptance cases even when the visual game is identical.
Catalog availability is dynamic. A successful metadata sync is evidence that a game can be listed, not proof that every customer can launch it in every market. The launch response is another control point and must be handled as such.
From a lobby click to a launch URL
The player sees a single button, but the backend needs to resolve several independent checks. The sequence below is illustrative. Endpoint names, token formats and the number of network calls vary across contracts.
The browser sends the selected catalog ID to the operator backend.
Authentication, game availability, territory, currency and account policy are checked.
Authorized server-to-server credentials and the contracted player context are submitted.
The response may contain a time-bound URL or token with game and session references.
The host follows the allowed embedding or navigation method for this provider.
If real-money play is enabled, the contracted balance and transaction interface becomes active.
Generate the session on the server. Do not place API secrets in frontend JavaScript, local storage, a copied launch URL or analytics events. Treat a launch URL as sensitive session material; whether it can be reused, embedded in an iframe or refreshed must be established with the provider.
Balance requests and wallet authority
In a seamless-wallet model, the operator's account ledger typically remains the authority for the available player balance. A game-side service may request a balance or send a debit or credit through the aggregation layer. The operator must validate the trusted integration context, player and currency before changing funds.
Other models transfer a defined amount into a provider-side wallet or use an intermediate balance. They need explicit funding, return and reconciliation rules. It is unsafe to assume that every game supports a single wallet model or that a successful launch proves the money path works.
Agree on ISO currency codes, amount units, rounding and precision before writing callback handlers. Floating-point arithmetic should not be the source of truth for account balances.
Debits, credits and the identity of a round
A paid round may involve a debit for the stake and one or more credits for the result. Bonus features, partially settled rounds and provider-specific game mechanics can add events. A round identifier groups related activity; a transaction identifier identifies an individual money movement. They are not interchangeable.
A useful transaction record should make these questions answerable
- Which authenticated integration, player account, game and round generated this event?
- What is the original provider transaction reference, and has it already been applied?
- Is it a debit, credit, reversal or another explicitly contracted event type?
- What exact integer or decimal amount and currency were used?
- What is the final business status, timestamp and correlation reference?
Persisting these fields gives support and finance teams something stronger than a response code. It also makes it possible to compare operator-side records with provider or aggregator statements without treating the browser session as the primary evidence.
Retries, duplicate callbacks and reversals
Networks fail in ordinary ways: a debit can be committed while its HTTP response is lost; a caller can retry because a timeout looks like a failure. If the same business transaction is applied twice, a player can be charged twice even though both HTTP requests were valid. HTTP itself does not make a non-idempotent wallet operation safe.
Design a durable deduplication key using the identifiers defined by the specific API contract. Include the trusted tenant or integration scope if transaction IDs are not globally unique. A retry for the same event should return the recorded result rather than create a second ledger entry. A reused key with different financial parameters is a conflict, not an invitation to silently accept new values.
- Check signature, authorization and the expected integration context before any balance mutation.
- Look up the unique transaction reference within a database transaction or other atomic boundary.
- Apply the first valid financial event exactly once and store the result before acknowledging success.
- For repeated requests, return a contract-compatible response representing the original outcome.
- If reversal is supported, reverse only a recorded operation and never credit twice for the same reversal.
RFC 9110 defines idempotency at the HTTP method level; financial idempotency additionally depends on application rules and persistent state. A reversal may arrive before, after or without an apparent original event. Each case needs an explicit agreed response and investigation policy.
What happens when the player leaves
Closing a tab, losing network access or returning to the lobby changes the player's browser state. It does not necessarily close every provider round or settle every callback. Some providers report delayed results or require round recovery. Other games do not support the same resume behavior.
- Define session expiry and refresh behavior independently from player login duration.
- Decide how unfinished rounds are displayed and whether re-entry resumes or creates a new session.
- Keep signed callbacks reachable after the browser disconnects, according to the contract.
- Do not invent a zero win or refund merely because the UI stopped receiving updates.
- Document the reconciliation path for rounds whose final state is delayed or disputed.
The important distinction is operational: a closed interface is a presentation event; a settled round is a financial state backed by recorded provider and wallet events.
Reconciliation: proving that the ledger agrees
A healthy integration can show a game on screen while still hiding a financial discrepancy. Reconciliation compares the operator ledger with the event feed or statement available from the aggregator and provider. It should work by stable transaction and round identities, not by matching approximate totals or guessing from session duration.
A practical review separates missing callbacks, repeated events, currency or rounding mismatches, late settlements, invalid references and ambiguous reversals. Track the time the event occurred and the time each system received it. These timestamps answer different questions during an incident.
Record the transaction's unique ID, originating system, business status and relevant timestamps. Avoid logging raw secrets, reusable launch credentials or unnecessary player personal data. GLI-19 describes record-keeping expectations for interactive gaming systems; applicable obligations must be checked per jurisdiction.
An acceptance test matrix that catches expensive mistakes
A demo game opening successfully is an important check, but it is not a production acceptance test. Before enabling real-money play, test the complete lifecycle with contract-approved credentials, controlled accounts and a defined evidence log.
| Scenario | Expected observation |
|---|---|
| Launch of an allowed game | Correct player, currency and game context; only authorized launch data returned. |
| Unavailable game or market | Clear rejection; no wallet change and no unauthorized content access. |
| Successful debit and win | Two traceable financial events with exact amounts and a consistent ledger. |
| Repeated debit callback | Original result is returned; the ledger records a single debit. |
| Timeout after a committed debit | Retry resolves to the existing transaction instead of charging again. |
| Valid reversal | Only the referenced earlier movement is compensated once. |
| Late settlement after exit | The result is recorded and reconciled even when the player is no longer in the game. |
| Unauthorized or tampered callback | Rejected without mutation and recorded for investigation. |
Also test regional restrictions, bonus and free-round behavior, multi-currency representation, game-provider downtime and disaster recovery where they are in scope. Expected responses, timeouts and retry windows should come from the actual signed contract, not a copied example implementation.
Questions to settle before development
A useful technical kickoff replaces assumptions with verifiable decisions. The short list below can be handed to the operator, aggregator and provider teams before anyone writes a callback handler.
- Which studios, titles, markets, currencies and brands are actually enabled for this operator?
- Who owns the authoritative player balance, and which money models are supported?
- Which identifiers uniquely define the session, round, business transaction and retry scope?
- How are callbacks authenticated, timed out, retried and acknowledged?
- What is the required behavior for duplicates, reversals, interrupted rounds and late results?
- Which reports, event exports and contact paths resolve ledger mismatches?
- What test evidence and jurisdiction-specific checks must be approved before live access?
The final deliverable is not merely a working launch URL. It is a reproducible path from a catalog selection to an authorized game, correctly applied wallet events and an auditable settlement result. When these boundaries are designed together, adding more content becomes a controlled integration task rather than a sequence of exceptions.
KNOWLEDGE
Sources & further reading
This guide draws on primary technical references and official guidance. Regulatory applicability depends on jurisdiction and implementation.
- IETF — RFC 9110, HTTP Semantics, Section 9.2.2 (Idempotent Methods)
- OWASP — API1:2023 Broken Object Level Authorization
- OWASP — Business Logic Security Cheat Sheet
- Gaming Laboratories International — GLI Standards (GLI-19 Interactive Gaming Systems)
- UK Gambling Commission — RTS 2, Displaying Transactions