B1 Operator Integration API v1
This document describes how an operator integrates B1 games (Hero, Sportsbook) into its platform.
The integration has two parts:
| Part |
Direction |
Purpose |
| Casino API |
Operator → B1 |
Get the game list, launch a game, get a link to a round result |
| Operator API |
B1 → Operator |
Game status notifications and the seamless wallet (balance, bet, win, rollback) |
B1 games are sports bets. A bet is placed now and settled later, when the sporting event finishes (minutes or hours later). The wallet contract is designed around that:
- one bet = one round;
- a round is opened by a
bet and closed by exactly one win (settlement, cashout, cancellation or loss with amount 0) or one rollback (technical failure of the bet);
- a
win may arrive after the player's session has expired and must still be credited.
1. General conventions
1.1 Transport
- HTTPS only,
Content-Type: application/json, UTF-8.
- All timestamps are ISO-8601 in UTC, e.g.
2026-12-05T10:15:30Z.
- Casino API base URL:
https://<casino-api-host>/api/operators/b1/v1 (provided by B1 per environment).
- Operator API base URLs (
gamesUrl, walletUrl) are provided by the operator and configured on the B1 side.
1.2 Authentication and signature
Each operator receives an operatorId and a shared secret. The same scheme is used in both directions: the operator signs Casino API calls, B1 signs Operator API calls.
| Header |
Description |
X-Operator-Id |
Operator identifier issued by B1 |
X-Timestamp |
Unix time in milliseconds at the moment of sending |
X-Request-Id |
Unique request id (UUID), used for tracing |
X-Signature |
Hex-encoded HMAC-SHA256 signature (lowercase) |
Signature:
stringToSign = X-Timestamp + "\n" + HTTP_METHOD + "\n" + PATH + "\n" + RAW_BODY
X-Signature = hex( HMAC_SHA256( secret, stringToSign ) )
-
PATH is the request path including the query string, e.g. /api/operators/b1/v1/games?lang=en.
-
RAW_BODY is the exact request body bytes; an empty string for GET.
- Requests with
X-Timestamp more than 30 seconds away from the receiver's clock must be rejected with INVALID_SIGNATURE.
- IP whitelisting can additionally be enabled on request.
1.3 Amounts
All monetary amounts are integers equal to the amount multiplied by 10 000 (JSON number, int64).
| Real amount |
API value |
| 1 INR |
10000 |
| 100.50 INR |
1005000 |
| 0.0001 USDT |
1 |
Currencies are ISO 4217 codes, plus B1-supported codes such as USDT.
1.4 Idempotency
Every wallet transaction carries a unique transactionId generated by B1.
- A repeated request with the same
transactionId and the same parameters must return the original result (success or error) without moving money again.
- A repeated
transactionId with different parameters must be rejected with TRANSACTION_CONFLICT.
1.5 Errors
Business errors are returned with HTTP 400 and a machine-readable code:
{
"error": {
"code": "NOT_ENOUGH_BALANCE",
"message": "Human-readable description"
},
"balance": 50000
}
- Only
error.code is used for processing; message is for logs.
-
balance is optional; when present it is shown to the player.
- A timeout, any HTTP 5xx, or a response that cannot be parsed is treated as a technical error (see Retry policy).
2. Casino API (Operator → B1)
2.1 Get game list
GET /api/operators/b1/v1/games?lang=en
Returns the games available to the calling operator.
| Query param |
Required |
Description |
lang |
no |
Language for localized names (ISO 639-1). Default en
|
Response
{
"games": [
{
"gameCode": "CH",
"name": "Cricket Hero",
"category": "SPORTS",
"status": "ACTIVE",
"images": {
"logo": "https://cdn.b1.example/ch/logo.svg",
"thumbnail": "https://cdn.b1.example/ch/thumb_400x300.webp",
"background": "https://cdn.b1.example/ch/bg.webp"
},
"devices": ["MOBILE", "DESKTOP"],
"demoSupported": true,
"languages": ["en", "hi", "ru"],
"currencies": ["INR", "USD", "USDT"],
"updatedAt": "2026-12-01T10:00:00Z"
}
]
}
| Field |
Type |
Description |
gameCode |
string |
Unique game code, used in launch and wallet calls |
name |
string |
Game name in the requested language |
category |
string |
Game category, e.g. SPORTS
|
status |
string |
ACTIVE — the game can be launched; MAINTENANCE — temporarily unavailable, launch is rejected |
images.logo |
string |
Logo URL |
images.thumbnail |
string |
Lobby tile image URL |
images.background |
string |
Background image URL |
devices |
string[] |
Supported devices: MOBILE, DESKTOP
|
demoSupported |
boolean |
Whether DEMO mode can be launched |
languages |
string[] |
Supported languages (ISO 639-1) |
currencies |
string[] |
Currencies enabled for this operator |
updatedAt |
string |
Last change of the game record |
2.2 Launch game
POST /api/operators/b1/v1/games/launch
Request
{
"gameCode": "CH",
"mode": "REAL",
"userId": "u-123",
"sessionToken": "op-sess-abc",
"currency": "INR",
"language": "en",
"userIp": "203.0.113.5",
"device": "MOBILE",
"lobbyUrl": "https://operator.example/casino",
"subPartnerId": "wl-7",
"betLimits": {
"minBet": 100000,
"maxBet": 500000000
}
}
| Field |
Type |
Required |
Description |
gameCode |
string |
yes |
Game code from the game list |
mode |
string |
yes |
REAL or DEMO
|
userId |
string |
REAL only |
Player id on the operator side |
sessionToken |
string |
REAL only |
Operator session token. B1 sends it back in every wallet call; it is the key of the game session |
currency |
string |
yes |
Player currency |
language |
string |
yes |
Game UI language (ISO 639-1) |
userIp |
string |
yes |
Player IP address |
device |
string |
yes |
MOBILE or DESKTOP
|
lobbyUrl |
string |
yes |
Where the "back to lobby" button leads |
subPartnerId |
string |
no |
White-label / sub-partner id |
betLimits.minBet |
integer |
no |
Minimum stake (×10 000) |
betLimits.maxBet |
integer |
no |
Maximum stake (×10 000) |
If betLimits is not provided, the default limits configured for the operator and currency apply.
In REAL mode B1 calls the operator's balance endpoint during launch to validate sessionToken. In DEMO mode no wallet calls are made; B1 uses an internal demo balance.
Response
{
"url": "https://play.b1.example/hero?ott=7f3c...",
"expiresAt": "2026-12-05T10:20:30Z"
}
| Field |
Description |
url |
Game URL to open in the browser / iframe. Single use |
expiresAt |
The URL must be opened before this moment |
Errors: GAME_NOT_FOUND, GAME_UNAVAILABLE, CURRENCY_NOT_SUPPORTED, LANGUAGE_NOT_SUPPORTED, INVALID_BET_LIMITS, SESSION_EXPIRED, SESSION_NOT_FOUND, INVALID_SIGNATURE, INVALID_REQUEST.
2.3 Get round result link
POST /api/operators/b1/v1/rounds/result-link
Returns a link to a page that shows the result of a round (the bet, the event and the outcome). Intended for operator support and player history.
Request
{
"userId": "u-123",
"roundId": "r-555",
"language": "en"
}
| Field |
Type |
Required |
Description |
userId |
string |
yes |
Player id on the operator side |
roundId |
string |
one of |
Round id from wallet calls |
transactionId |
string |
one of |
Any B1 transactionId of the round (bet, win or rollback) |
language |
string |
no |
Page language. Default en
|
Exactly one of roundId or transactionId must be provided.
Response
{
"url": "https://results.b1.example/r/9a1b...",
"expiresAt": "2026-12-06T10:15:30Z"
}
| Field |
Description |
url |
Link to the round result page |
expiresAt |
The link is guaranteed to work until this moment (24 hours after the request). Request a new link after that |
Errors: ROUND_NOT_FOUND, TRANSACTION_NOT_FOUND, INVALID_SIGNATURE, INVALID_REQUEST.
3. Operator API (B1 → Operator)
The operator implements the endpoints below. Requests are signed by B1 as described in 1.2; the operator must verify the signature.
3.1 Game notifications
POST {gamesUrl}/games/notify
B1 notifies the operator when a game is added, changed, or its status changes (for example, put into maintenance or back to active).
Request
{
"eventId": "evt-1001",
"type": "GAME_STATUS_CHANGED",
"game": {
"gameCode": "CH",
"name": "Cricket Hero",
"category": "SPORTS",
"status": "MAINTENANCE",
"images": { "logo": "...", "thumbnail": "...", "background": "..." },
"devices": ["MOBILE", "DESKTOP"],
"demoSupported": true,
"languages": ["en", "hi", "ru"],
"currencies": ["INR", "USD", "USDT"],
"updatedAt": "2026-12-05T02:00:00Z"
},
"previousStatus": "ACTIVE",
"occurredAt": "2026-12-05T02:00:00Z"
}
| Field |
Description |
eventId |
Unique notification id; the same notification may be delivered more than once |
type |
See below |
game |
Full game object, same as in the game list
|
previousStatus |
Status from the previous notification, only for GAME_STATUS_CHANGED
|
occurredAt |
When the change happened |
type |
When |
GAME_CREATED |
The game is sent to this operator for the first time |
GAME_STATUS_CHANGED |
The status differs from the one in the previous notification (ACTIVE ↔ MAINTENANCE) |
GAME_UPDATED |
Any other change of the game (name, images, languages, currencies) |
Response: HTTP 200 { "status": "OK" }. Any other response is treated as a failed delivery, and the notification is sent again with the same type.
3.2 Wallet
All wallet endpoints are POST with a JSON body.
Successful response for bet, win and rollback:
{
"balance": 15200000,
"currency": "INR",
"operatorTransactionId": "op-9"
}
| Field |
Description |
balance |
Player balance after the transaction (×10 000) |
currency |
Balance currency |
operatorTransactionId |
Transaction id on the operator side (for reconciliation) |
3.2.1 Balance
POST {walletUrl}/wallet/balance
{
"userId": "u-123",
"sessionToken": "op-sess-abc",
"currency": "INR",
"gameCode": "CH"
}
Response
{ "balance": 15200000, "currency": "INR" }
Errors: SESSION_EXPIRED, SESSION_NOT_FOUND, USER_NOT_FOUND, USER_LOCKED, CURRENCY_MISMATCH, INVALID_SIGNATURE, INVALID_REQUEST.
3.2.2 Bet
POST {walletUrl}/wallet/bet
Debits the stake when the player places a bet. Opens a round.
{
"transactionId": "b1-tx-1",
"roundId": "r-555",
"userId": "u-123",
"sessionToken": "op-sess-abc",
"gameCode": "CH",
"currency": "INR",
"amount": 1000000,
"createdAt": "2026-12-05T10:15:30Z"
}
| Field |
Description |
transactionId |
Unique B1 transaction id (idempotency key) |
roundId |
Round id; the same in the win / rollback of this bet |
userId |
Player id on the operator side |
sessionToken |
Operator session token from launch; must be valid |
gameCode |
Game code |
currency |
Currency |
amount |
Stake (×10 000), greater than 0 |
createdAt |
When the bet was placed |
Errors: NOT_ENOUGH_BALANCE, SESSION_EXPIRED, SESSION_NOT_FOUND, USER_NOT_FOUND, USER_LOCKED, USER_REACHED_LIMIT, CURRENCY_MISMATCH, TRANSACTION_ROLLED_BACK, TRANSACTION_CONFLICT, INVALID_SIGNATURE, INVALID_REQUEST.
3.2.3 Win
POST {walletUrl}/wallet/win
Credits the result of a bet and closes the round. Sent for every bet that was accepted, including lost bets (with amount = 0).
{
"transactionId": "b1-tx-2",
"betTransactionId": "b1-tx-1",
"roundId": "r-555",
"userId": "u-123",
"sessionToken": "op-sess-abc",
"gameCode": "CH",
"currency": "INR",
"amount": 1850000,
"reason": "SETTLEMENT"
}
| Field |
Description |
transactionId |
Unique B1 transaction id (idempotency key) |
betTransactionId |
transactionId of the bet being settled |
roundId |
Round id |
userId |
Player id on the operator side |
sessionToken |
Session token from launch. Informational only, must not be validated
|
gameCode |
Game code |
currency |
Currency |
amount |
Amount to credit (×10 000), 0 or greater |
reason |
See below |
reason |
When |
amount |
SETTLEMENT |
The event is settled |
Payout; 0 if the bet lost |
CASHOUT |
The player cashed out before settlement |
Cashout amount |
CANCEL |
The bet was cancelled (event cancelled, market voided) |
Stake refund |
The operator must credit a win regardless of the session or player state. SESSION_EXPIRED, SESSION_NOT_FOUND, USER_LOCKED, USER_REACHED_LIMIT and NOT_ENOUGH_BALANCE must never be returned for win.
Errors: USER_NOT_FOUND, BET_NOT_FOUND, CURRENCY_MISMATCH, TRANSACTION_CONFLICT, INVALID_SIGNATURE, INVALID_REQUEST.
3.2.4 Rollback
POST {walletUrl}/wallet/rollback
Technical reversal of a bet whose outcome is unknown to B1 (timeout or 5xx on bet). Refunds the stake and closes the round. Business cancellations are sent as win with reason = CANCEL, not as rollback.
{
"transactionId": "b1-tx-3",
"refTransactionId": "b1-tx-1",
"roundId": "r-555",
"userId": "u-123",
"gameCode": "CH",
"currency": "INR",
"amount": 1000000
}
| Field |
Description |
transactionId |
Unique B1 transaction id (idempotency key) |
refTransactionId |
transactionId of the bet being rolled back |
roundId |
Round id |
userId |
Player id on the operator side |
gameCode |
Game code |
currency |
Currency |
amount |
Stake of the original bet (×10 000) |
Rules:
- If the operator never received the bet
refTransactionId, it must still respond with success (current balance) and remember the rollback.
- If the bet with that
transactionId arrives after the rollback, it must be rejected with TRANSACTION_ROLLED_BACK.
- Session and player state must not be validated.
Errors: USER_NOT_FOUND, CURRENCY_MISMATCH, TRANSACTION_CONFLICT, INVALID_SIGNATURE, INVALID_REQUEST.
4. Error codes
4.1 Operator API (returned by the operator)
| Code |
balance |
bet |
win |
rollback |
B1 reaction |
NOT_ENOUGH_BALANCE |
– |
✔ |
✘ |
✘ |
Bet rejected, player notified |
SESSION_EXPIRED |
✔ |
✔ |
✘ |
✘ |
Player asked to re-launch the game |
SESSION_NOT_FOUND |
✔ |
✔ |
✘ |
✘ |
Player asked to re-launch the game |
USER_NOT_FOUND |
✔ |
✔ |
✔ |
✔ |
Bet rejected; win / rollback go to manual review |
USER_LOCKED |
✔ |
✔ |
✘ |
✘ |
Bet rejected |
USER_REACHED_LIMIT |
– |
✔ |
✘ |
✘ |
Bet rejected (responsible gaming limit) |
CURRENCY_MISMATCH |
✔ |
✔ |
✔ |
✔ |
Integration error |
BET_NOT_FOUND |
– |
– |
✔ |
– |
Manual review |
TRANSACTION_ROLLED_BACK |
– |
✔ |
– |
– |
Bet rejected |
TRANSACTION_CONFLICT |
– |
✔ |
✔ |
✔ |
Integration error |
INVALID_SIGNATURE |
✔ |
✔ |
✔ |
✔ |
Integration error, alert |
INVALID_REQUEST |
✔ |
✔ |
✔ |
✔ |
Integration error |
✔ — the code may be returned by this endpoint; ✘ — must never be returned; – — not applicable.
An unknown code is treated as a rejection: a bet is rejected; a win or rollback goes to manual review.
4.2 Casino API (returned by B1)
| Code |
Endpoint |
Meaning |
GAME_NOT_FOUND |
launch |
Unknown gameCode or game not enabled for the operator |
GAME_UNAVAILABLE |
launch |
Game is in MAINTENANCE, or DEMO is not supported |
CURRENCY_NOT_SUPPORTED |
launch |
Currency is not enabled for the operator |
LANGUAGE_NOT_SUPPORTED |
launch |
Language is not supported by the game |
INVALID_BET_LIMITS |
launch |
minBet > maxBet, or values outside the allowed range |
SESSION_EXPIRED / SESSION_NOT_FOUND
|
launch |
Operator rejected sessionToken during the balance check |
ROUND_NOT_FOUND |
result-link |
No such round for this player |
TRANSACTION_NOT_FOUND |
result-link |
No such transaction for this player |
INVALID_SIGNATURE |
all |
Signature, timestamp or operator id is invalid |
INVALID_REQUEST |
all |
Malformed request or missing required field |
5. Retry policy
A technical error is a timeout, any HTTP 5xx, or a response that cannot be parsed.
| Call |
On technical error |
balance |
Not retried; the player sees an error and may retry |
bet |
The bet is considered not accepted; B1 sends rollback for it |
win |
Retried with increasing intervals for up to 24 hours, then manual review |
rollback |
Retried with increasing intervals for up to 24 hours, then manual review |
games/notify |
Sent again later with the same type
|
Retries reuse the same transactionId / eventId, so the operator must handle them idempotently.
6. Flows
6.1 Bet won or lost
Player B1 Operator
| place bet | |
|----------->| POST /wallet/bet |
| |----------------------------->| debit stake
| |<-----------------------------| 200 balance
| | ... event finishes ... |
| | POST /wallet/win |
| | reason=SETTLEMENT |
| | amount=payout (0 if lost) |
| |----------------------------->| credit, close round
| |<-----------------------------| 200 balance
6.2 Event cancelled
B1 Operator
| POST /wallet/bet |
|---------------------------------->| debit stake
| ... event cancelled ... |
| POST /wallet/win |
| reason=CANCEL, amount=stake |
|---------------------------------->| refund, close round
6.3 Bet timeout
B1 Operator
| POST /wallet/bet |
|---------------------------------->| (timeout / 5xx)
| POST /wallet/rollback |
| refTransactionId=<bet> |
|---------------------------------->| refund if debited, close round
|<----------------------------------| 200 balance
7. Planned
-
POST {walletUrl}/wallet/freebet-win: crediting free bet winnings (v2).