iGaming platform API
The operator API: players, wallets and the ledger, payments, bonuses, games, KYC, messaging, projects. And the wallet API for game providers: HMAC signing, idempotency, rollbacks.
The reference is being extended
Base addresses
https://api.seltenlabs.com
wallet for providers, webhooks
https://bo.seltenlabs.com
operator API
Amounts are integers in minor currency units. Requests and responses are JSON.
Platform API sections
To an operator the platform exposes the same operations the back office runs on. Game providers and vendors call the platform with a signature.
| Section | What is available | Path | Access |
|---|---|---|---|
| Players | Profile, status, tags, comments, sessions, wallet operations, rounds | /api/admin/players | staff session |
| Ledger | Transactions, accounts, integrity check, round cancellation | /api/admin/ledger | staff session |
| Payments | Deposits and withdrawals: checks, approval, payout | /api/admin/payments | staff session |
| Bonuses | Offers, grants, activation, forfeit, wagering | /api/admin/bonuses | staff session |
| Games | Game performance and catalogue health | /api/admin/games | staff session |
| KYC | Cases, documents, decisions | /api/admin/kyc | staff session |
| Messaging | Templates, preview, sending, journal | /api/admin/messages | staff session |
| Projects (geo) | Currencies, languages, project settings | /api/admin/projects | staff session |
| Catalogues | Game catalogue, lobby, promotions, content, templates: one generic interface | /api/admin/bo | staff session |
| Wallet for game providers | Balance, bet, win, rollback | /api/provider | HMAC signature |
| Webhooks | Vendor callbacks, such as a KYC result | /api/hooks | vendor signature |
The operator API works with a staff session today: password, mandatory TOTP, and the X-CSRF-Token header for changes; each operation has its own permission. API keys for integrations are planned.
Wallet request signing: HMAC-SHA256
The provider computes HMAC-SHA256 over the raw request body with a shared secret and sends the hex digest in the X-Signature header. An invalid signature: 401.
# Python: sign the raw body, send the hex digest in X-Signature
import hmac, hashlib
def sign(secret: bytes, body: bytes) -> str:
return hmac.new(secret, body, hashlib.sha256).hexdigest()
# shell
echo -n "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex- Exactly the body that is sent is signed, byte for byte.
- A secret is issued per provider and known only to the two parties.
- The signature is compared in constant time.
- An unknown provider: 404, unknown_provider.
Wallet API methods: balance, bet, win, rollback
Amounts are integers in minor currency units, and the currency must match the player's currency. The player is passed as player_id.
| Method | Purpose | Request fields | Response |
|---|---|---|---|
POST /api/provider/{provider}/balance | Current player balance | player_id, currency | balance, currency, balance_version |
POST /api/provider/{provider}/bet | Bet: debit the amount | player_id, currency, amount, transaction_id, round_id, game_code | transaction_id, balance, balance_version, currency, replay, status, round_id |
POST /api/provider/{provider}/win | Win: credit; with finished the round closes | player_id, currency, amount, transaction_id, round_id, finished (true) | as for a bet |
POST /api/provider/{provider}/rollback | Roll back a bet by reference to its transaction_id | player_id, currency, transaction_id, ref_transaction_id, round_id (optional) | status: posted, tombstone, already_rolled_back |
Example requests and responses
Values are illustrative. The idempotency key is the provider plus transaction_id: a repeat with the same parameters returns the original result with replay: true.
POST /api/provider/selten-mock/bet HTTP/1.1
Host: api.seltenlabs.com
Content-Type: application/json
X-Signature: 9b3f...c41e
{"player_id": 42, "currency": "EUR", "amount": 500,
"transaction_id": "tx-1001", "round_id": "r-77",
"game_code": "demo-game-1"}HTTP/1.1 200 OK
Content-Type: application/json
{"transaction_id": 318, "balance": 9500,
"balance_version": 7, "currency": "EUR",
"replay": false, "status": "posted", "round_id": 12}HTTP/1.1 200 OK
{"transaction_id": 318, "balance": 9500,
"balance_version": 7, "currency": "EUR",
"replay": true, "status": "posted", "round_id": 12}{"player_id": 42, "currency": "EUR", "amount": 1200,
"transaction_id": "tx-1002", "round_id": "r-77",
"finished": true}{"player_id": 42, "currency": "EUR",
"transaction_id": "tx-1003",
"ref_transaction_id": "tx-1001", "round_id": "r-77"}HTTP/1.1 200 OK
{"transaction_id": 319, "balance": 9500,
"balance_version": 7, "currency": "EUR",
"replay": false, "status": "tombstone"}HTTP/1.1 409 Conflict
{"error": "transaction_rolled_back"}Request outcomes and response codes
Branches are checked top to bottom; the highlighted one leads to a posted operation.
POST /api/provider/{provider}/{op}- 200A new operation is posted
status: posted - 200A repeat with the same parameters
replay: true - 409Same key, other parameters
idempotency_conflict - 401The signature does not match
bad_signature - 404Unknown provider or method
unknown_provider, unknown_op - 400A body or field is invalid
bad_request, bad_amount - 403The game catalogue refused the bet
game_disabled, game_restricted, ... - 402Insufficient funds
insufficient_funds - 409A round or rollback blocks the operation
round_closed, transaction_rolled_back
Error codes
An error response: {"error": "code"} with an HTTP status. The code is stable; the human-readable text is up to the client.
| Code | HTTP | When |
|---|---|---|
bad_signature | 401 | Signature does not match the body |
unknown_provider | 404 | The provider is not registered |
unknown_op | 404 | A method other than balance, bet, win, rollback |
bad_request | 400 | The body is not JSON or a field is missing; the response carries field |
bad_amount | 400 | The amount is not an integer, is negative, or is zero for a bet |
currency_mismatch | 400 | The currency differs from the player's currency |
player_not_found | 404 | The player is not found |
player_blocked | 403 | The player is blocked |
insufficient_funds | 402 | The balance is below the bet amount |
provider_disabled | 403 | The provider is disabled in the catalogue |
ip_not_allowed | 403 | The caller address is not trusted |
game_not_found | 404 | The game is not found for the provider |
game_disabled | 403 | The game is disabled |
bet_out_of_range | 400 | The bet is out of limits; the response carries min and max |
game_restricted | 403 | The game is restricted by a rule, for example by country |
idempotency_conflict | 409 | The same key with other parameters |
transaction_rolled_back | 409 | The bet was already cancelled by a rollback |
round_not_found | 404 | The round is not found (a win without a bet) |
round_closed | 409 | The round is closed |
round_mismatch | 409 | The round belongs to another player |
round_settled | 409 | A rollback is impossible: the round is settled |
rollback_not_allowed | 409 | Only a bet can be rolled back |
conflict_retry | 409 | Concurrent requests did not settle in three attempts, repeat the request |
Webhooks: callbacks from external services
External services, such as an identity verification vendor, call the platform themselves. Each call is verified by the vendor signature.
KYC: verification result
POST /api/hooks/kyc/{code}
The vendor signature is required: an unsigned call gets 401 and is recorded in the log. Repeating the same status changes nothing; a closed case is never reopened.
A successful response: {"ok": true}. Availability check: GET /api/health.
| Code | HTTP | When |
|---|---|---|
integration_not_available | 404 | The vendor is not connected |
bad_signature | 401 | The vendor signature does not match |
bad_request | 400 / 413 | The body is not JSON or exceeds 1 MB |