# Casino Api Pro — full text > A REST API that supplies provably fair casino games to licensed gaming operators. The operator keeps the players, the wallet, the KYC and the licence; we run the games, the sessions, the round state machine and the settlement ledger. Generated from the site's own source. Canonical HTML for every section below lives at https://casinoapipro.com. --- # Documentation Section: Get started # Introduction > What Casino Api Pro is, how the API is structured, and how money is represented. Source: https://casinoapipro.com/docs/introduction The Casino Api Pro API lets a licensed operator launch provably fair casino games from one REST integration. You keep the players, the wallet, the KYC and the licence. We run the games, the sessions, the round state machine and the settlement ledger. ## Overview The API is organised around REST. It uses predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP verbs and status codes. There are two directions of traffic, and keeping them straight is most of the integration: - You call us to list games, open a session and read transactions. - We call you to move money — every bet and win is a request to your wallet API. See [Wallet integration](/docs/wallet). ## Base URL All endpoints are served over HTTPS at: ```bash https://api.casinoapipro.com/v1 ``` > **HTTPS only** > > Plain HTTP requests are redirected and credentials sent over them should be treated as compromised. There is no HTTP-only fallback. ## How money is represented Amounts are decimal strings, never JSON numbers. `"10.50"` is valid; `10.5` is rejected with a `VALIDATION_ERROR`. This is deliberate: IEEE-754 doubles cannot represent `0.1` exactly, and a rounding difference between your ledger and ours is the one class of bug that is expensive to unpick after the fact. ```json { "amount": "10.50", "currency": "GHS" } ``` Every amount we return is formatted to the currency's minor units — you will get `"100.00"` and not `"100"`, so string comparison is safe. ## Identifiers - `transaction_id` — yours. You mint it, and it is the idempotency key for the movement. - `round_id`, `session_id` — ours. Opaque strings; do not parse them. - `player_id` — yours. We store it as an opaque string scoped to your operator account. ## Health check Unauthenticated, and safe to poll from a monitor: ```bash curl https://api.casinoapipro.com/health ``` ```json { "status": "ok", "version": "0.1.0", "uptime_seconds": 84213 } ``` `GET /health` answers as long as the process is up, which is what you want from a load balancer. `GET /ready` is the stricter one: it actually reaches the database and Redis and reports each with its latency, answering `503` if either is unreachable. Point a load balancer at `/health` and an alert at `/ready` — a node that is up but cannot see its database should stop receiving traffic, not keep accepting bets it cannot record. ```json { "status": "ready", "checks": { "database": { "ok": true, "latency_ms": 1 }, "redis": { "ok": true, "latency_ms": 1 } } } ``` `GET /metrics` is a Prometheus exposition, and its counts come from the ledger rather than from in-process counters — so a restart does not reset them and two API nodes do not report two different truths. ```bash # HELP capro_operators_active Operators in ACTIVE status. # TYPE capro_operators_active gauge capro_operators_active 23 ``` > **All three are unauthenticated** > > They carry no operator data — counts and latencies only, never a player, a stake or a balance — so there is nothing in them to protect and a monitor does not need a credential to poll them. ## Where to go next - [Quickstart](/docs/quickstart) — first session in about ten minutes. - [Authentication](/docs/authentication) — credentials, tokens, scopes. - [Wallet integration](/docs/wallet) — the five calls we make to you. - [OpenAPI explorer](https://api.casinoapipro.com/docs) — try every endpoint in the browser. Section: Get started # Quickstart > From nothing to a playable sandbox session in six steps. Source: https://casinoapipro.com/docs/quickstart This walks from nothing to a playable game session in the sandbox. Everything here uses play money — no licence is required to complete it, and no real balance can move. ## 1. Get credentials Ask us for a sandbox account at [casinoapipro.com](/#contact). You will get a dashboard login; create a credential pair there. The secret is shown once — store it in your secret manager before closing the dialog. _credential (example)_ ```json { "api_key": "ck_test_7f3c9a21", "api_secret": "cs_test_9d41…shown once" } ``` ## 2. Exchange them for a token Credentials are long-lived; access tokens are not. Exchange the pair for a bearer token and cache it until it expires. _cURL_ ```bash curl -X POST https://api.casinoapipro.com/v1/auth/token \\ -H "Content-Type: application/json" \\ -d '{ "api_key": "ck_test_7f3c9a21", "api_secret": "cs_test_9d41" }' ``` _JavaScript_ ```js const res = await fetch("https://api.casinoapipro.com/v1/auth/token", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ api_key: API_KEY, api_secret: API_SECRET }), }); const { access_token, expires_in } = await res.json(); ``` _PHP_ ```php $ch = curl_init("https://api.casinoapipro.com/v1/auth/token"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Content-Type: application/json"], CURLOPT_POSTFIELDS => json_encode([ "api_key" => $apiKey, "api_secret" => $apiSecret, ]), ]); $token = json_decode(curl_exec($ch), true)["access_token"]; ``` ## 3. List the games you can launch ```bash curl https://api.casinoapipro.com/v1/games \\ -H "Authorization: Bearer $ACCESS_TOKEN" ``` The response contains only games enabled for _your_ operator account, with your per-game stake limits already applied. ## 4. Point us at a wallet Before a session can be created, we need somewhere to send debits and credits. In the sandbox you can skip writing one: create a sandbox player from the dashboard and we will use the built-in play-money wallet, which honours the same idempotency contract as a real one. > **Test your retries properly** > > The sandbox wallet is not a stub that always says yes. It enforces balances, rejects duplicate `transaction_id`s the way production does, and can be told to fail, so your retry path is genuinely exercised before it matters. ## 5. Create a session _cURL_ ```bash curl -X POST https://api.casinoapipro.com/v1/sessions \\ -H "Authorization: Bearer $ACCESS_TOKEN" \\ -H "Content-Type: application/json" \\ -d '{ "game_id": "mines", "player_id": "your_player_42", "currency": "GHS" }' ``` _JavaScript_ ```js const session = await api("/v1/sessions", { game_id: "mines", player_id: "your_player_42", currency: "GHS", }); // Open this in the player's browser. Nothing else is needed. redirect(session.launch_url); ``` ```json { "session_id": "sess_kgv5ws4duteqwhvjobok", "launch_url": "https://games.casinoapipro.com/play?token=eyJhbGciOi…", "expires_at": "2026-08-29T19:11:56.237Z", "game": { "id": "d533d22e…", "slug": "mines", "name": "Mines" }, "player_id": "your_player_42", "currency": "GHS" } ``` ## 6. Open the launch URL Redirect the player, or drop it into an `