Integration / API

One API, whole catalogue

Overview of the integration flow for operators and aggregators.

Draft contract: the endpoints below are a proposal for review. Official docs and credentials are released in the Client Hub.

The flow in 4 steps

  1. Catalogue

    Your system fetches the game list and art.

  2. Session

    On click, you create a session and open the returned URL.

  3. Wallet

    Bets and wins arrive as signed, idempotent callbacks.

  4. Reconciliation

    Round lookup for support and audit.

Endpoints

Request
GET /v1/games?locale=pt-BR HTTP/1.1
Authorization: Bearer tg_sandbox_…
Response
{
  "games": [
    {
      "id": "capivara-da-sorte",
      "name": "Capivara da Sorte",
      "type": "slot",
      "rtp": 96.0,
      "orientations": ["portrait", "landscape"],
      "assets": { "cover": "https://…/capa-720.webp" }
    }
  ],
  "next_cursor": null
}

Signature verification

Every call to your wallet is signed. Reject mismatches and treat repeated transaction_id as already processed.

Node.js
import { createHmac, timingSafeEqual } from 'node:crypto';

export function isFromTomGames(rawBody, headers, secret) {
  const ts = headers['x-tom-timestamp'];
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // 5 min
  const expected = 'sha256=' + createHmac('sha256', secret)
    .update(ts + '.' + rawBody)
    .digest('hex');
  const given = headers['x-tom-signature'] ?? '';
  return given.length === expected.length &&
    timingSafeEqual(Buffer.from(given), Buffer.from(expected));
}

Certification checklist

  • Launch in demo and real modes
  • Idempotent debit and credit
  • Rollback on failure
  • Insufficient funds handled without freezing the game
  • Correct currency and language
  • Limits and self-exclusion enforced before opening a session
Become a partner