SELTENLABS
api.seltenlabs.comlive

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.

Swagger UI · platform.json · wallet.json

Sections

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.

SectionWhat is availablePathAccess
PlayersProfile, status, tags, comments, sessions, wallet operations, rounds/api/admin/playersstaff session
LedgerTransactions, accounts, integrity check, round cancellation/api/admin/ledgerstaff session
PaymentsDeposits and withdrawals: checks, approval, payout/api/admin/paymentsstaff session
BonusesOffers, grants, activation, forfeit, wagering/api/admin/bonusesstaff session
GamesGame performance and catalogue health/api/admin/gamesstaff session
KYCCases, documents, decisions/api/admin/kycstaff session
MessagingTemplates, preview, sending, journal/api/admin/messagesstaff session
Projects (geo)Currencies, languages, project settings/api/admin/projectsstaff session
CataloguesGame catalogue, lobby, promotions, content, templates: one generic interface/api/admin/bostaff session
Wallet for game providersBalance, bet, win, rollback/api/providerHMAC signature
WebhooksVendor callbacks, such as a KYC result/api/hooksvendor 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: signing

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.

Signing example
# 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: methods

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.

MethodPurposeRequest fieldsResponse
POST /api/provider/{provider}/balanceCurrent player balanceplayer_id, currencybalance, currency, balance_version
POST /api/provider/{provider}/betBet: debit the amountplayer_id, currency, amount, transaction_id, round_id, game_codetransaction_id, balance, balance_version, currency, replay, status, round_id
POST /api/provider/{provider}/winWin: credit; with finished the round closesplayer_id, currency, amount, transaction_id, round_id, finished (true)as for a bet
POST /api/provider/{provider}/rollbackRoll back a bet by reference to its transaction_idplayer_id, currency, transaction_id, ref_transaction_id, round_id (optional)status: posted, tombstone, already_rolled_back
Examples

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.

Bet: request
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"}
Bet: response
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}
The same bet repeated
HTTP/1.1 200 OK

{"transaction_id": 318, "balance": 9500,
 "balance_version": 7, "currency": "EUR",
 "replay": true, "status": "posted", "round_id": 12}
Win: request body
{"player_id": 42, "currency": "EUR", "amount": 1200,
 "transaction_id": "tx-1002", "round_id": "r-77",
 "finished": true}
Rollback: request body
{"player_id": 42, "currency": "EUR",
 "transaction_id": "tx-1003",
 "ref_transaction_id": "tx-1001", "round_id": "r-77"}
Rollback of an unknown bet: a tombstone
HTTP/1.1 200 OK

{"transaction_id": 319, "balance": 9500,
 "balance_version": 7, "currency": "EUR",
 "replay": false, "status": "tombstone"}
A late bet after a tombstone
HTTP/1.1 409 Conflict

{"error": "transaction_rolled_back"}
Request outcomes

Request outcomes and response codes

Branches are checked top to bottom; the highlighted one leads to a posted operation.

Request
POST /api/provider/{provider}/{op}
  • 200A new operation is postedstatus: posted
  • 200A repeat with the same parametersreplay: true
  • 409Same key, other parametersidempotency_conflict
  • 401The signature does not matchbad_signature
  • 404Unknown provider or methodunknown_provider, unknown_op
  • 400A body or field is invalidbad_request, bad_amount
  • 403The game catalogue refused the betgame_disabled, game_restricted, ...
  • 402Insufficient fundsinsufficient_funds
  • 409A round or rollback blocks the operationround_closed, transaction_rolled_back
Errors

Error codes

An error response: {"error": "code"} with an HTTP status. The code is stable; the human-readable text is up to the client.

CodeHTTPWhen
bad_signature401Signature does not match the body
unknown_provider404The provider is not registered
unknown_op404A method other than balance, bet, win, rollback
bad_request400The body is not JSON or a field is missing; the response carries field
bad_amount400The amount is not an integer, is negative, or is zero for a bet
currency_mismatch400The currency differs from the player's currency
player_not_found404The player is not found
player_blocked403The player is blocked
insufficient_funds402The balance is below the bet amount
provider_disabled403The provider is disabled in the catalogue
ip_not_allowed403The caller address is not trusted
game_not_found404The game is not found for the provider
game_disabled403The game is disabled
bet_out_of_range400The bet is out of limits; the response carries min and max
game_restricted403The game is restricted by a rule, for example by country
idempotency_conflict409The same key with other parameters
transaction_rolled_back409The bet was already cancelled by a rollback
round_not_found404The round is not found (a win without a bet)
round_closed409The round is closed
round_mismatch409The round belongs to another player
round_settled409A rollback is impossible: the round is settled
rollback_not_allowed409Only a bet can be rolled back
conflict_retry409Concurrent requests did not settle in three attempts, repeat the request
Webhooks

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.

CodeHTTPWhen
integration_not_available404The vendor is not connected
bad_signature401The vendor signature does not match
bad_request400 / 413The body is not JSON or exceeds 1 MB