← For operators

Game integration API

How a casino launches BetStream 3D's games for its own players, on its own wallet. One integration covers every game: 3D Sabong (sabong) today. The games run on our game server; your back end opens a session, shows the game in a frame, and answers four wallet calls.

In short

  1. You get an operator id and a secret from us, and give us the address of your wallet API. Ask for test credentials.
  2. Your back end opens a session for a player with a signed POST /operator/v1/sessions and receives a launchUrl.
  3. Your page shows the game: the launchUrl in an iframe.
  4. We call your wallet to take each stake and pay each win. Money never rests with us.

Base address: https://3dsabong.com. All amounts are whole minor units (centavos, cents) as JSON integers. Currencies: PHP, USD, EUR, GBP, USDT, THB, VND, IDR, MYR, INR, BRL, KRW, JPY.

Signing

Every server-to-server request, in both directions, carries three headers:

X-Operator-Id: acme
X-Timestamp:   1794355000     unix seconds; refused when more than 300 s off
X-Signature:   hex( HMAC-SHA256( secret, "<timestamp>.<METHOD>.<path with query>.<body as sent>" ) )

Check the signature over the raw body bytes before parsing them. A request to GET /operator/v1/games has an empty body, so the signed text ends with a dot.

Your calls to us

GET /operator/v1/gamesThe games enabled for you: id, name, category, version, build and RTP; and the currencies.
POST /operator/v1/sessionsOpen a session. Body: playerId, playerToken (yours, opaque; sent back on every wallet call), currency, gameId, mode (real or demo), lang, returnUrl. Returns sessionId, launchUrl, expiresAt.
GET /operator/v1/rounds?from=&to=&limit=Rounds by creation time (ISO), for reconciliation. ?playerId= for one player.
GET /operator/v1/rounds/<roundId>One round in full: the bets, the outcome, every wallet transaction and its status.
GET /operator/v1/rounds/<roundId>/verifyGame recall: works the round out again from what was recorded and says whether it matches.

mode: "demo" sessions use play money held by us and never call your wallet.

Our calls to your wallet

POST {walletUrl}/balance, /debit, /credit and /rollback. Every body has requestId, operatorId, playerId, playerToken, currency, gameId and sessionId. Money calls add:

transactionIdUnique for ever. The idempotency key.
roundIdThe round the movement belongs to.
amountMinor units, 0 or more.
roundClosedOn credits: true when this ends the round.
refTransactionIdOn rollbacks: the debit being undone.

Answer 200 {"status":"OK","balance":<int>}, or {"status":"ERROR","code":"…","message":"…"}. Codes we act on: INSUFFICIENT_FUNDS, PLAYER_NOT_FOUND, SESSION_EXPIRED, LIMIT_EXCEEDED, ROLLED_BACK; any other code on a debit is also a refusal. TEMPORARY, a 5xx, no answer within 5 seconds or an unreadable answer mean "unknown".

Three rules your wallet must keep

  1. A transaction id is applied once. The same id sent again returns OK with the current balance and changes nothing.
  2. A rollback always succeeds. If the debit it names was applied, return the money. If that debit never arrived, remember it, and refuse the debit (ROLLED_BACK) should it turn up later.
  3. A credit of 0 is normal. It closes a losing round.
CallIf you refuseIf the answer is unknown
debitThe bet is rejected; the player sees why.We send a rollback and cancel the bet. Nothing is played on it.
creditKept and retried.Retried after 5 s, 15 s, 1 min, 5 min, then every 10 min, until you acknowledge it.
rollbackKept and retried.The same.

A round's outcome is stored before its credit is sent, so a win survives a failure on either side. Transaction ids: stakes on the live games are <roundId>:d1, :d2, … (one per confirmed bet), the win is <roundId>:c, and a rollback of <id> is <id>:rb.

The game in your page

<iframe src="{launchUrl}" allow="fullscreen; autoplay" style="width:100%;height:100%;border:0"></iframe>

The session token in the address is the player's key: treat the address as a secret and open a new session for each visit. Both games are live tables shared by every player at every casino: the same fight and the same spin, in step.

The two games

GameHow a round runsReturn to playerFairness
3D Sabong
sabong
Bets on MERON, WALA or DRAW while betting is open on the fight; paid at the odds posted when the bet was placed. A draw returns MERON and WALA stakes. A void fight returns everything.95% by defaultThe fight's seed is sealed before the release and revealed after. Details.

Testing your integration

With test credentials you can run real sessions against your staging wallet straight away. We run the same check on our side for every new operator: it opens sessions for both games, places minimum bets, and confirms that your wallet was debited and credited by correctly signed calls and ends on the right balance. The games are not yet certified by a test laboratory; ask us where certification stands for your jurisdiction.

Ask for test credentials