Integration guide
Everything your backend and app teams need to add Rixos Games to a voice chat or live-streaming app. Coins stay in your system: we call your wallet for every bet and win.
Overview
There are two directions of traffic:
- You → Rixos: two signed calls — list the games enabled for you, and get a launch URL for a player.
- Rixos → you: four signed wallet calls to your server —
balance,bet,win,refund. Optionally agameWinwebhook for in-room announcements.
When you are onboarded you receive a tenant code (e.g. yourapp), a secret key and access to the partner console. The secret is shown once; keep it on your server only — never in the app.
How it works
POST /v1/launch with the player and game.bet, then win if the player wins.Onboarding
- We create your tenant in sandbox and send your tenant code, secret key and console password.
- You implement the four wallet endpoints and set your wallet URL (and optional webhook URL, allowed IPs) in the partner console.
- You test end-to-end against sandbox. The console has a test tool that calls your
balanceand opens a launch link. - We review the flow together; then we switch your tenant to live.
Signing requests
Every request in both directions carries three headers:
| Header | Value |
|---|---|
X-Tenant | Your tenant code. |
X-Ts | Unix time in seconds. Requests older or newer than 300 seconds are rejected. |
X-Signature | Lowercase hex of HMAC_SHA256(secret, X-Ts + "." + rawBody). For GET, rawBody is an empty string. |
// Node.js — calling Rixos const crypto = require("crypto"); async function rixos(method, path, bodyObj) { const body = bodyObj ? JSON.stringify(bodyObj) : ""; const ts = Math.floor(Date.now() / 1000).toString(); const sig = crypto.createHmac("sha256", process.env.RIXOS_SECRET).update(ts + "." + body).digest("hex"); const r = await fetch("https://api.rixosbe.store/b2b" + path, { method, body: body || undefined, headers: { "Content-Type": "application/json", "X-Tenant": process.env.RIXOS_TENANT, "X-Ts": ts, "X-Signature": sig }, }); return r.json(); }
Verifying our calls
Verify the signature on every wallet call before touching a balance. Use a constant-time comparison and check the timestamp window.
// Node.js / Express — keep the raw body for verification app.use(express.json({ verify: (req, _res, buf) => { req.rawBody = buf.toString("utf8"); } })); function fromRixos(req) { const ts = req.get("X-Ts"), got = req.get("X-Signature") || ""; if (req.get("X-Tenant") !== process.env.RIXOS_TENANT) return false; if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; const want = crypto.createHmac("sha256", process.env.RIXOS_SECRET).update(ts + "." + req.rawBody).digest("hex"); return want.length === got.length && crypto.timingSafeEqual(Buffer.from(want), Buffer.from(got)); }
// PHP $raw = file_get_contents('php://input'); $ts = $_SERVER['HTTP_X_TS'] ?? ''; $sig = hash_hmac('sha256', $ts . '.' . $raw, getenv('RIXOS_SECRET')); $ok = abs(time() - (int)$ts) <= 300 && hash_equals($sig, $_SERVER['HTTP_X_SIGNATURE'] ?? ''); if (!$ok) { http_response_code(401); exit; }
List games
GET /v1/games — returns the games currently enabled for your tenant.
{
"status": true,
"list": [
{ "key": "greedycat", "name": "Greedy Cat", "category": "wheel",
"icon": "https://rixosbe.store/img/oyun/greedycat.jpg",
"langs": ["tr-TR", "en-US", "ar-EG"] }
]
}
Categories: slot, wheel, table, crash, fish. Use icon in your in-room game menu.
Launch a game
POST /v1/launch — call from your server when a player taps a game.
| Field | Type | Notes | |
|---|---|---|---|
playerId | string | required | Your user ID. 1–64 chars: A–Z a–z 0–9 _ . - |
gameKey | string | required | A key from /v1/games. |
roomId | string | recommended | The voice room / live stream ID. Players in the same room share wheel and crash rounds. |
nickname | string | optional | Shown in game (max 40). |
avatar | string | optional | HTTPS image URL. |
lang | string | optional | en, ar or tr. Default en. |
country | string | optional | ISO-3166 alpha-2. Used if you restrict a game by country. |
// Response { "status": true, "url": "https://api.rixosbe.store/games/greedycat/index.html?op=…&token=…", "halfUrl": "…", "expiresAt": 1764266400 }
Wallet endpoints (you implement)
We send POST {walletUrl}/{action} with a signed JSON body. Reply within 5 seconds with HTTP 200 and the player's new balance.
| Action | When | Your effect |
|---|---|---|
balance | Game opens / refreshes | None — return the balance. |
bet | Player places a stake | Debit amount. If not enough coins, reply 402. |
win | Round won | Credit amount. |
refund | A bet could not be confirmed | Credit back the bet in refTxId — only if you debited it. |
balance
// Request body { "playerId": "u_10293", "ts": 1764259200 } // Reply 200 { "balance": 20000 }
bet
{ "playerId": "u_10293", "txId": "yourapp-8f2c1a9e", "roundId": "gc_77341",
"amount": 500, "gameKey": "greedycat", "roomId": "r_5521", "ts": 1764259200 }
// Reply 200 // Reply 402
{ "balance": 19500 } { "error": "insufficient_balance" }
win
{ "playerId": "u_10293", "txId": "yourapp-1b77d0c2", "roundId": "gc_77341",
"amount": 1250, "gameKey": "greedycat", "roomId": "r_5521", "ts": 1764259204 }
// Reply 200
{ "balance": 20750 }
A win is never rejected for balance reasons. If your server is down we retry the same txId until you confirm.
refund
{ "playerId": "u_10293", "txId": "yourapp-8f2c1a9e-r", "refTxId": "yourapp-8f2c1a9e",
"amount": 500, "gameKey": "greedycat", "roundId": "gc_77341", "roomId": "r_5521", "ts": 1764259500 }
We send a refund when a bet timed out or failed with a 5xx, so we cannot know whether you debited it. If you did debit refTxId, credit it back. If you never saw that bet, do nothing — but still reply 200 with the balance. Refunds are retried after 1 min, 5 min, 30 min and 2 h, for up to 24 h.
Idempotency
txId must be applied at most once. Store it with a unique index. If the same txId arrives again, do not move coins again — return 200 with the current balance.-- example
CREATE UNIQUE INDEX rixos_tx ON wallet_moves (tx_id);
Win webhook (optional)
If you set a webhook URL, we send POST {webhookUrl}/gameWin after a win, signed the same way. Use it to announce big wins in the room. We do not wait for or retry this call.
{ "playerId": "u_10293", "nickname": "Layla", "amount": 1250, "gameKey": "greedycat", "roomId": "r_5521", "ts": 1764259204 }
In-app WebView
- Open the launch
urlin a bottom sheet of about 60% screen height over the room, so voice, gifts and chat keep running. - Enable JavaScript, DOM storage and media autoplay; allow HTTPS only.
- Close the sheet with your own close button; the game does not need a callback to close.
- Refresh your coin display after the sheet closes (call your own balance API).
Errors
Our API replies with { "status": false, "message": "…" } and these HTTP codes:
| Code | Meaning |
|---|---|
401 | Unknown tenant, timestamp outside 300 s, or bad signature. |
403 | Calling IP is not in your allow-list, or the tenant is disabled. |
404 | Game not enabled for you (or not allowed in country). |
400 | Invalid field, e.g. playerId. |
What we expect from your wallet:
| You reply | We do |
|---|---|
200 {balance} | Move confirmed. |
402 on bet | Player sees “not enough coins”. Nothing to refund. |
other 4xx on bet | Bet rejected. Nothing to refund. |
timeout / 5xx on bet | Round cancelled for the player; a refund is queued. |
timeout / 5xx on win or refund | We retry the same txId until you confirm. |
Sandbox
In sandbox you can use real or test player IDs at no cost. Games, rounds and reports behave exactly like live. Use the console’s test tool to check your balance endpoint and open a launch link on your phone. Nothing in sandbox is billed.
Go-live checklist
- All four wallet actions verify
X-Signatureand the 300 s window. txIdis unique-indexed; replays return the current balance.betreturns 402 on insufficient balance.refundcredits only bets you actually debited and always returns 200.- Wallet answers in under 5 s at peak (target < 300 ms).
- Secret key is stored server-side only; launch is called from your server.
- Allowed IPs set in the console (recommended).
- Coin rate agreed in the contract (1 USD = X coins) for billing.
Billing
GGR = total bets − total wins, counted in coins per calendar month and converted at your contracted rate. The fixed monthly fee is invoiced in advance; the GGR share is invoiced at month end from the statement in your console.