Casino Software Aggregator

API documentation

Everything you need to list games, launch sessions and run the seamless wallet.

Introduction

The API is a JSON REST API. Your platform keeps player balances (seamless wallet): we call your wallet URL for every balance read, bet and win. You call us to list games, create players and open game sessions.

Base URL   https://api.casinosoftwareaggregator.com/v1
Format     JSON, UTF-8
Amounts    integers in the currency's minor units (2.50 USD → 250; JPY, KRW, VND, IDR, UZS → no decimals)

Get your keys instantly at /get-api-key/. Your key id, secret, wallet URL, test webhook button and reports are in the operator portal.

Authentication

Every request carries three headers. The signature is an HMAC-SHA256 (hex, lowercase) of the timestamp, the HTTP method, the request path with its query string and the raw body, joined by line feeds. For GET requests the body is an empty string. The timestamp must be within 5 minutes of our clock.

X-Key-Id:    ck_xxxxxxxxxxxxxxxx
X-Timestamp: 1764075600
X-Signature: hex( HMAC_SHA256( key_secret, timestamp + "\n" + METHOD + "\n" + path + "\n" + body ) )

Node.js

import crypto from 'node:crypto';
const KEY = process.env.CSA_KEY_ID, SECRET = process.env.CSA_SECRET, BASE = 'https://api.casinosoftwareaggregator.com';
async function csa(method, path, payload) {
  const body = payload ? JSON.stringify(payload) : '';
  const ts = Math.floor(Date.now() / 1000).toString();
  const sig = crypto.createHmac('sha256', SECRET).update(`${ts}\n${method}\n${path}\n${body}`).digest('hex');
  const r = await fetch(BASE + path, { method, body: body || undefined,
    headers: { 'Content-Type': 'application/json', 'X-Key-Id': KEY, 'X-Timestamp': ts, 'X-Signature': sig } });
  return r.json();
}
const { games } = await csa('GET', '/v1/games');

PHP

function csa($method, $path, $payload = null) {
  $body = $payload === null ? '' : json_encode($payload);
  $ts = (string) time();
  $sig = hash_hmac('sha256', "$ts\n$method\n$path\n$body", getenv('CSA_SECRET'));
  $ch = curl_init('https://api.casinosoftwareaggregator.com' . $path);
  curl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => $method, CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => $body ?: null, CURLOPT_HTTPHEADER => ['Content-Type: application/json',
    'X-Key-Id: ' . getenv('CSA_KEY_ID'), "X-Timestamp: $ts", "X-Signature: $sig"]]);
  return json_decode(curl_exec($ch), true);
}

GET/v1/games

All games enabled for your account. Optional filters: ?studio=pragmaticplay, ?category=live. Use game_id to launch. Categories are normalised: slots, live, crash, table, instant, bingo, keno, fishing, virtual, sportsbook, other.

{ "total": …,
  "games": [ {
    "game_id": "x6046f4988155b46",
    "name": "Gates of Olympus 1000",
    "studio": "pragmaticplay", "studio_name": "Pragmatic Play",
    "category": "slots", "mobile": true, "demo": false, "new": false, "featured": true,
    "images": { "landscape": "https://…", "square": "https://…", "portrait": "https://…" },
    "studio_logo": "https://…"
  } ] }

Cache the list on your side and refresh it a few times a day; new releases appear automatically.

GET/v1/studios

{ "total": 104, "studios": [ { "studio": "pragmaticplay", "name": "Pragmatic Play", "logo": "https://…", "games": 627 } ] }

GET/v1/currencies

Play currencies enabled for your account, your default, your settlement currency and the number of decimals of each currency.

{ "default": "USD", "currencies": ["USD","EUR","USDT","BRL","TRY","INR", …], "settlement": "USD",
  "minor_units": { "USD": 2, "VND": 0, … } }

GET/v1/account

Your prepaid credit (in settlement currency). GGR fees are deducted from it as rounds are played. When credit reaches zero, new real-money sessions are refused with INSUFFICIENT_CREDIT; sessions already open keep settling.

{ "company": "My Casino", "status": "active", "credit": 1834.12, "settlement_currency": "USD",
  "low_credit_alert": 50, "default_currency": "USD", "wallet_url": "https://my-casino.com/csa/wallet" }

POST/v1/players

Creates the player if needed (it is also done automatically on the first session). A player is identified by your player_id and the currency: the same person in two currencies is two wallets. email and phone (international format) are required for a new real-money player.

{ "player_id": "p-1042", "currency": "BRL", "email": "[email protected]", "phone": "+5511912345678",
  "country": "BR", "first_name": "Ana", "last_name": "Silva" }
→ { "player_id": "p-1042", "currency": "BRL", "created_at": "2026-11-25 10:00:00" }

POST/v1/sessions

Opens a real-money session and returns the URL to load in an iframe or a new window.

FieldDescription
player_idRequired. Your player id (1–64 chars: letters, digits, _ . @ -)
game_idRequired. From /v1/games
currencyOptional. Defaults to your account default
email, phoneRequired the first time a player is seen
countryISO 3166 alpha-2. Some games are not available in every country
lange.g. en, pt, tr, es
devicedesktop (default) or mobile
return_urlWhere the lobby/exit button sends the player
→ { "session_id": "sQ3…", "launch_url": "https://api.casinosoftwareaggregator.com/play/sQ3…",
    "player_id": "p-1042", "currency": "BRL", "demo": false }

On mobile, size the iframe to the visible area under your header (height: calc(100dvh - 64px)) so the game's own bottom bar stays visible.

POST/v1/demo

Same fields without player data, for games where demo is true. Demo sessions never call your wallet.

GET/v1/players/{player_id}/rounds

Round history of a player, newest first. Query: currency, from, to (UTC, YYYY-MM-DD HH:MM:SS), limit (max 500), offset. Amounts in minor units.

{ "player_id": "p-1042", "total": 128, "limit": 50, "offset": 0, "rounds": [
  { "round_id": "r6c1f…", "game_id": "x6046f4988155b46", "game_name": "Gates of Olympus 1000", "currency": "BRL",
    "bet": 400, "win": 580, "net": 180, "legs": 2, "rolled_back": false,
    "started_at": "2026-11-25 16:10:15", "ended_at": "2026-11-25 16:10:24" } ] }

GET/v1/transactions/{transaction_id}

Look up a wallet movement we sent you, with the status we recorded (ok, refused, error).

Wallet webhooks

We send a POST with a JSON body to your wallet URL for each movement. Always answer HTTP 200 with JSON, within 8 seconds.

// balance
{ "type": "balance", "player_id": "p-1042", "currency": "BRL", "timestamp": 1764075600 }

// bet
{ "type": "debit", "transaction_id": "csa_m3x…", "player_id": "p-1042", "currency": "BRL", "amount": 400,
  "reason": "bet", "rollback": false, "round_id": "r6c1f…", "game_id": "x6046f4988155b46", "timestamp": 1764075601 }

// win
{ "type": "credit", "transaction_id": "csa_m3y…", "player_id": "p-1042", "currency": "BRL", "amount": 580,
  "reason": "win", "rollback": false, "round_id": "r6c1f…", "game_id": "x6046f4988155b46", "timestamp": 1764075609 }

Your answer:

{ "status": "OK", "balance": 12580 }                 // balance after the movement, minor units
{ "status": "INSUFFICIENT_FUNDS", "balance": 120 }    // debit refused
{ "status": "ERROR" }                                 // anything else (player unknown, blocked…)

Rules that keep balances right

  • Idempotency: de-duplicate on transaction_id. If you receive a transaction you already applied, answer OK with the current balance — never apply it twice.
  • Branch on type only. reason is informational (bet, win, free_spin, jackpot, …) and its list grows; never reject an unknown reason.
  • A credit can arrive without a debit (free spins, bonus rounds, jackpots). Do not require a prior bet.
  • rollback: true: a credit rollback refunds a bet, a debit rollback reverses a win. Apply them like normal movements.
  • A debit with amount: 0 can happen (free spin); answer OK.
  • If we get no valid answer to a credit, the same transaction is retried later with the same transaction_id.

Webhook signature

Each webhook carries X-CSA-Key-Id, X-CSA-Timestamp and X-CSA-Signature = hex(HMAC_SHA256(key_secret, timestamp + "." + raw_body)). Check it, and reject timestamps older than 60 seconds.

app.post('/csa/wallet', express.raw({ type: 'application/json' }), (req, res) => {
  const ts = req.get('X-CSA-Timestamp'), sig = req.get('X-CSA-Signature');
  const good = crypto.createHmac('sha256', SECRET).update(ts + '.' + req.body).digest('hex');
  if (sig !== good || Math.abs(Date.now() / 1000 - ts) > 60) return res.json({ status: 'ERROR' });
  const m = JSON.parse(req.body);
  // … apply m.type / m.amount idempotently on m.transaction_id, then:
  res.json({ status: 'OK', balance: newBalance });
});

Errors

Errors return a non-200 HTTP status and { "error": "CODE", "message": "…" }.

CodeHTTPMeaning
AUTH_MISSING / AUTH_INVALID / AUTH_EXPIRED401Headers missing, bad signature or clock skew over 5 minutes
ACCOUNT_SUSPENDED403Account not active
INSUFFICIENT_CREDIT402Prepaid credit exhausted — top up
WALLET_URL_MISSING400Set your wallet URL in the portal
PLAYER_CONTACT_REQUIRED400email and phone needed for a new player
CURRENCY_NOT_ENABLED / CURRENCY_NOT_SUPPORTED_BY_GAME400Currency not on your account, or not accepted by that game
GAME_NOT_FOUND404Unknown or disabled game_id
GAME_NOT_AVAILABLE_IN_COUNTRY403Game closed for the player's country
LAUNCH_FAILED502Temporary launch failure — retry or offer another game
RATE_LIMITED429Slow down (600 requests/minute, 120 launches/minute)

Go-live checklist

  1. Create your account and copy your key id and secret from the portal.
  2. Deploy your wallet endpoint, set its URL in the portal and press Send test webhook — you must answer {"status":"OK","balance":…}.
  3. Call GET /v1/games and build your lobby from category and studio.
  4. Top up your credit (minimum 200 USD), then open a session with POST /v1/sessions and play a round: the debit and credit appear in the portal under Round history.
  5. Check idempotency by replaying a webhook: the balance must not move.

Questions: [email protected].