Game Provider API
Integrate one NiuNiu lobby, without inheriting another operator's risk.
Each brand runs in an isolated cell with its own database, wallet ledger, bot, admin, configuration and API credentials. The game engine remains one shared product, so approved releases and bug fixes roll through the same versioned codebase.
One declared currency per lobby
All API amounts are sen, never floats
No API writes a balance directly
White-label architecture
Meka Niu Niu is the first client cell. It uses the same immutable release as every future brand, but its operational data and secrets are never shared. A release moves through sandbox → pilot → stable; a failed pilot health check stops the rollout.
Transfer endpoint
https://api-transfer.mekaniuniu.online/provider/v1Seamless endpoint
https://api-seamless.mekaniuniu.online/provider/v1Transfer wallet lifecycle
- 1. Fund: call
POST /transfers/inbefore launch. The game credits its isolated double-entry wallet. - 2. Launch: create a one-use session and redirect the player to the returned URL.
- 3. Play: bets, wins, refunds and cancellations settle inside the game wallet.
- 4. Return: call
POST /transfers/out. On a timeout, query the same transaction id before retrying.
Authentication Live per certified operator
Requests are signed with HMAC-SHA256. Never send the secret to a browser or mobile app. Keep clocks synchronised; timestamps outside ±60 seconds and reused nonces are rejected.
Required headers
X-NiuNiu-Key-Id: meka-live-01
X-NiuNiu-Timestamp: 1793656800
X-NiuNiu-Nonce: 01K8...unique...
X-NiuNiu-Signature: <64 lowercase hex>Canonical string
NIUNIU-HMAC-SHA256
GET
/provider/v1/status
1793656800
01K8...unique...
0000000000000000000000000000000000000000000000000000000000000000The final line is the lowercase SHA-256 hex digest of the exact raw request body. For an empty GET body, hash zero bytes. Sign the complete path including its query string.
GET /provider/v1/status Live per certified operator
Use this as the first certification request. A successful response proves the key id, signature, timestamp and nonce are correct and returns only capabilities actually enabled for that cell.
{
"ok": true,
"apiVersion": "2026-11-24",
"operatorId": "meka-casino",
"requestId": "5f8a1d...",
"capabilities": {
"status": true,
"sessions": true,
"transferWallet": true,
"seamlessWallet": false,
"reports": true
}
}POST /provider/v1/sessions Live per certified operator
The operator exchanges its own player id for a short-lived, one-use launch URL. Player ids are scoped to the operator, so identical ids from two operators never share a wallet or history.
{
"playerId": "operator-player-18492",
"displayName": "MeiLing88",
"currency": "MYR",
"language": "zh",
"returnUrl": "https://operator.example/games"
}Transfer wallet Live per certified operator
Every mutation requires both Idempotency-Key and operatorTransactionId. Repeating the same request returns the original immutable result; changing its bytes returns 409. Amounts are integer sen and are moved through the double-entry game ledger, never by directly editing a balance.
POST /provider/v1/transfers/in
Idempotency-Key: 4f89d15c-...-operator-unique
{
"operatorTransactionId": "deposit-920144",
"playerId": "operator-player-18492",
"money": { "currency": "MYR", "amountMinor": 10000 }
}GET /provider/v1/transactions/:operatorTransactionId Live per certified operator
Use this after any timeout before attempting a new transfer. The response is scoped to the signed operator and returns the original accepted, rejected or pending result together with the resulting game-wallet balance.
Seamless wallet Certification stage
Seamless mode keeps the player's money at the operator and requires certified balance, debit, credit, rollback and reconciliation callbacks. It remains disabled until the operator passes duplicate-delivery, timeout, rollback and round-settlement tests. A cell never silently falls back from seamless to transfer mode.
Operator callback contract
POST {callbackBaseUrl}/wallet/balance
POST {callbackBaseUrl}/wallet/debit
POST {callbackBaseUrl}/wallet/credit
POST {callbackBaseUrl}/wallet/rollback
GET {callbackBaseUrl}/wallet/transactions/{transactionId}
Every mutation contains:
operatorId, playerId, roundId, transactionId,
idempotencyKey, reason, currency, amountMinorA bet is accepted only after the debit has a durable final response. Win and refund credits are delivered from a durable outbox and retried with the same transaction id. An unknown callback outcome pauses that player's next wager until reconciliation completes.
Webhooks Certification stage
Callbacks use a separate signing key, durable outbox, exponential retry and a stable event id. Consumers must acknowledge duplicate event ids without applying them twice. Delivery history and manual replay are part of certification.
Certification checklist
- 1Valid signature succeeds; stale timestamp, modified body and replayed nonce fail.
- 2Duplicate transfer request moves value once and returns the same immutable response.
- 3Insufficient funds and exposure limits fail closed without creating a partial ledger entry.
- 4Cancelled rounds refund exactly once; reports reconcile to signed transaction ids.
- 5Operator origin, IP allow-list, key rotation and emergency revoke are verified.