API reference · bhub calls you

Seamless Wallet API

Calls bhub makes to the operator's wallet. The operator implements these endpoints.

Version 1.1.0-draft OpenAPI 3.1.0 Download seamless-wallet.v1.yaml

Servers

URLUse
https://{operator-wallet-host}/bhub

Conventions

  • Transport: HTTPS POST, Content-Type: application/json; charset=utf-8, UTF-8 strings.
  • Every business outcome returns HTTP 200 with a status. Non-200 means infrastructure failure and is treated as a timeout (unknown outcome). One exception: a request whose signature, key id or timestamp fails verification is answered HTTP 401 with {"status":"INVALID_SIGNATURE"} (unsigned); bhub treats it as a definite refusal.
  • Guides and the conformance kit: https://bhubsystems.com/docs
  • Amounts: decimal strings in the currency's minor-unit precision ("12.50" ZAR, "1500" UGX), never floats. More decimals than the currency allows is a bad request. The precision table is published at GET /v1/currencies on the operator API.
  • Identifiers: strings of at most 64 characters, [A-Za-z0-9._:-].
  • Times: RFC 3339 with Z (UTC). Reports render SAST for ZA.

Signing (HMAC-SHA256)

Headers on every request and every response:

  • X-Bhub-Key-Id: which key signed (two keys may be live during rotation).
  • X-Bhub-Timestamp: Unix seconds. Requests outside +/-300 s are rejected.
  • X-Bhub-Signature: hex HMAC-SHA256 of timestamp + "\n" + raw_body with the shared key. The operator signs its response body the same way, so bhub verifies answers too. HMAC-SHA256 doubles as the message error-detection code (SANS 1718-3 10.4, 10.11).

Test and live (X-Bhub-Environment)

Every request carries X-Bhub-Environment: live or X-Bhub-Environment: test.

  • test marks every call of the test studio (simulator) and of "Test connection" in the portal: synthetic players, sandbox rounds, trouble caused on purpose. It is sent only to the operator's registered test wallets, signed with the test wallet's own keys, which are never the live keys.
  • live marks real play, and bhub's reconciliation pulls of GET /v1/transactions.
  • A live wallet MUST refuse a request marked test (HTTP 200 with status: BAD_REQUEST, or HTTP 401 INVALID_SIGNATURE when the test key is unknown to it). A test wallet SHOULD refuse a request marked live. A missing header is treated as live by older wallets; bhub always sends it. The header is not part of the signed bytes; the separate test keys are what keep test calls out of a live wallet. See docs/operator-api.md, "Prepare a test wallet".

Idempotency contract

  • tx_id is the idempotency key, globally unique, kept by the operator for at least 180 days.
  • A repeat with the same tx_id and identical body MUST return the original outcome with the CURRENT balance and status: OK (or the original rejection).
  • The same tx_id with a different body MUST return DUPLICATE_CONFLICT. "Body" means the business fields: request_id (new on every attempt) and session_token (may be refreshed) are excluded from the comparison.
  • rollback of a transaction the operator never saw MUST return OK and remember the target ref_tx_id (tombstone), so a late-arriving original is refused with TRANSACTION_ROLLED_BACK.

Retries (published policy)

  • bet/bet_win debit: timeout ~3 s, NOT retried; bhub sends rollback instead, delivered with 2 immediate retries, then the async schedule below.
  • win, rollback, end_round, promo_credit: 2 immediate retries, then the same async schedule (1 min, 10 min, then hourly) up to 72 h, then manual reconciliation (visible in the failed-transaction feed and webhook).

Transactions endpoint (optional, for daily reconciliation)

GET /v1/transactions lets bhub read the operator's own records of every bhub money call, one business day at a time, instead of the operator uploading a file. It is signed like every call, except that a GET has no body: the signed bytes are the request target (path and query exactly as sent, e.g. /bhub/v1/transactions?from=...&limit=5000&to=...). The answer is signed over its body as usual. bhub asks for the business day plus 10 minutes either side and follows next_cursor until it is null. Lines are in the published layout (the same fields as the file upload). A line counts once; a stake the wallet gave back is status: rolled_back.

Session

Exchange a launch token for the player's identity and balance.

POST/v1/authenticate

Signed (HMAC-SHA256). See Request signing. · operationId authenticate

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest

Request body application/json, required

Schema AuthenticateRequest

FieldTypeDescription
request_idrequiredId
launch_tokenrequiredstring

at most 256 characters

game_idrequiredId
providerrequiredId
ip_addressstring

Responses

StatusMeaning
200

Outcome

application/json: AuthenticateResponse

balance

POST/v1/balance

Signed (HMAC-SHA256). See Request signing. · operationId balance

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest

Request body application/json, required

Schema BalanceRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring
player_idrequiredId
currencyrequiredCurrency

Responses

StatusMeaning
200

Outcome

application/json: WalletResponse

Money

Debit a stake.

POST/v1/bet

Signed (HMAC-SHA256). See Request signing. · operationId bet

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest

Request body application/json, required

Schema BetRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
round_idrequiredId
round_closedboolean or null

true when this call closes the round, false when more calls follow; absent or null when the studio did not say.

is_freeboolean

Free spins round (granted by the studio, or an in-game feature). The stake is passed as the studio sent it, normally 0.

default false

bonus_refId

The studio's own free spins / bonus reference, opaque to bhub. bhub creates and manages no free spins campaigns; it only passes free spins rounds through. A free spins round without a reference is still processed and is flagged for review.

round_detailsobject

The studio's raw round and bonus fields, passed through unchanged (no fixed schema).

jurisdictionobject

ZA WRS ticket fields (ticket number arrives later via the round feed).

jurisdiction.codestring

e.g. ZA

jurisdiction.provincestring
jurisdiction.venuestring
tx_idrequiredId
amountrequiredAmount
jackpot_contribution_microstring

pattern ^[0-9]{1,18}$

Responses

StatusMeaning
200

Outcome

application/json: WalletResponse

Credit a win. A round may have several wins. Zero-amount wins are sent when they close a round.

POST/v1/win

Signed (HMAC-SHA256). See Request signing. · operationId win

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest

Request body application/json, required

Schema WinRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
round_idrequiredId
round_closedboolean or null

true when this call closes the round, false when more calls follow; absent or null when the studio did not say.

is_freeboolean

Free spins round (granted by the studio, or an in-game feature). The stake is passed as the studio sent it, normally 0.

default false

bonus_refId

The studio's own free spins / bonus reference, opaque to bhub. bhub creates and manages no free spins campaigns; it only passes free spins rounds through. A free spins round without a reference is still processed and is flagged for review.

round_detailsobject

The studio's raw round and bonus fields, passed through unchanged (no fixed schema).

jurisdictionobject

ZA WRS ticket fields (ticket number arrives later via the round feed).

jurisdiction.codestring

e.g. ZA

jurisdiction.provincestring
jurisdiction.venuestring
tx_idrequiredId
ref_tx_idId

The bet this win settles

amountrequiredAmount

Responses

StatusMeaning
200

Outcome

application/json: WalletResponse

Debit and credit in one call (instant and crash games). Atomic on the operator side.

POST/v1/bet_win

Signed (HMAC-SHA256). See Request signing. · operationId betWin

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest

Request body application/json, required

Schema BetWinRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
round_idrequiredId
round_closedboolean or null

true when this call closes the round, false when more calls follow; absent or null when the studio did not say.

is_freeboolean

Free spins round (granted by the studio, or an in-game feature). The stake is passed as the studio sent it, normally 0.

default false

bonus_refId

The studio's own free spins / bonus reference, opaque to bhub. bhub creates and manages no free spins campaigns; it only passes free spins rounds through. A free spins round without a reference is still processed and is flagged for review.

round_detailsobject

The studio's raw round and bonus fields, passed through unchanged (no fixed schema).

jurisdictionobject

ZA WRS ticket fields (ticket number arrives later via the round feed).

jurisdiction.codestring

e.g. ZA

jurisdiction.provincestring
jurisdiction.venuestring
tx_idrequiredId
bet_amountrequiredAmount
win_amountrequiredAmount

Responses

StatusMeaning
200

Outcome

application/json: WalletResponse

Reverse a bet or a win identified by ref_tx_id.

POST/v1/rollback

Signed (HMAC-SHA256). See Request signing. · operationId rollback

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest

Request body application/json, required

Schema RollbackRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
tx_idrequiredId
ref_tx_idrequiredId
round_idrequiredId
round_closedboolean or null

Responses

StatusMeaning
200

Outcome

application/json: WalletResponse

Close a round. Idempotent per round_id; may repeat.

POST/v1/end_round

Signed (HMAC-SHA256). See Request signing. · operationId endRound

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest

Request body application/json, required

Schema EndRoundRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
tx_idrequiredId
round_idrequiredId
total_betrequiredAmount
total_winrequiredAmount

Responses

StatusMeaning
200

Outcome

application/json: WalletResponse

Promotions

Offline-safe credit outside normal play (free-spins total, jackpot, tournament, prize drop, cashback). No session needed.

POST/v1/promo_credit

Signed (HMAC-SHA256). See Request signing. · operationId promoCredit

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest

Request body application/json, required

Schema PromoCreditRequest

FieldTypeDescription
request_idrequiredId
tx_idrequiredId
player_idrequiredId
currencyrequiredCurrency
amountrequiredAmount
kindrequiredstring

free_spins_win is a studio's aggregated free spins total paid at the end of the free spins; report it as a promotional payout.

free_spins_winjackpottournamentprize_dropmissioncashbackadjustment
bonus_refId

The studio's opaque bonus reference, when it sent one.

round_idId
game_idId
providerId

Responses

StatusMeaning
200

Outcome

application/json: WalletResponse

Reconciliation

The operator's records of bhub money calls in a time window (optional; for reconciliation).

GET/v1/transactions

Signed (HMAC-SHA256). See Request signing. · operationId listTransactions

Signed over the request target (path and query) instead of a body. Pages are in the operator's order; cursor is opaque to bhub. Amounts are integers in minor units here (this is a records export, not a money call).

Parameters

NameInTypeDescription
X-Bhub-Environmentrequiredheaderstring

live for real play, test for the test studio and Test connection. See "Test and live".

livetest
fromrequiredquerystring (date-time)

Inclusive.

torequiredquerystring (date-time)

Exclusive.

cursorquerystring

at most 200 characters

limitqueryinteger

default 1000 · min 1 · max 10000

Responses

StatusMeaning
200

One page

application/json: TransactionsPage

400

Bad window

401

Signature failed: {"status":"INVALID_SIGNATURE"}

Schemas

Id

string

at most 64 characters · pattern ^[A-Za-z0-9._:-]+$

Amount

Non-negative decimal string in the currency's precision.

string

pattern ^(0|[1-9][0-9]{0,17})(\.[0-9]{1,4})?$

Currency

ISO 4217

string

pattern ^[A-Z]{3}$

Status

string

OKINSUFFICIENT_FUNDSPLAYER_NOT_FOUNDPLAYER_BLOCKEDTOKEN_INVALIDTOKEN_EXPIREDINVALID_SIGNATUREBAD_REQUESTGAME_DISABLEDLIMIT_REACHEDBET_OUT_OF_LIMITSCURRENCY_MISMATCHDUPLICATE_CONFLICTTRANSACTION_NOT_FOUNDTRANSACTION_ROLLED_BACKREALITY_CHECKINTERNAL_RETRYINTERNAL_NO_RETRY

Balance

FieldTypeDescription
cashrequiredAmount
bonusrequiredAmount

Common

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId

RoundRef

FieldTypeDescription
round_idrequiredId
round_closedboolean or null

true when this call closes the round, false when more calls follow; absent or null when the studio did not say.

is_freeboolean

Free spins round (granted by the studio, or an in-game feature). The stake is passed as the studio sent it, normally 0.

default false

bonus_refId

The studio's own free spins / bonus reference, opaque to bhub. bhub creates and manages no free spins campaigns; it only passes free spins rounds through. A free spins round without a reference is still processed and is flagged for review.

round_detailsobject

The studio's raw round and bonus fields, passed through unchanged (no fixed schema).

jurisdictionobject

ZA WRS ticket fields (ticket number arrives later via the round feed).

jurisdiction.codestring

e.g. ZA

jurisdiction.provincestring
jurisdiction.venuestring

AuthenticateRequest

FieldTypeDescription
request_idrequiredId
launch_tokenrequiredstring

at most 256 characters

game_idrequiredId
providerrequiredId
ip_addressstring

AuthenticateResponse

FieldTypeDescription
statusrequiredStatus
player_idId
session_tokenstring

at most 256 characters

currencyCurrency
balanceBalance
countrystring

pattern ^[A-Z]{2}$

jurisdictionstring
bet_limitsobject
bet_limits.min_total_betAmount
bet_limits.max_total_betAmount
promo_eligibleboolean

BalanceRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring
player_idrequiredId
currencyrequiredCurrency

BetRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
round_idrequiredId
round_closedboolean or null

true when this call closes the round, false when more calls follow; absent or null when the studio did not say.

is_freeboolean

Free spins round (granted by the studio, or an in-game feature). The stake is passed as the studio sent it, normally 0.

default false

bonus_refId

The studio's own free spins / bonus reference, opaque to bhub. bhub creates and manages no free spins campaigns; it only passes free spins rounds through. A free spins round without a reference is still processed and is flagged for review.

round_detailsobject

The studio's raw round and bonus fields, passed through unchanged (no fixed schema).

jurisdictionobject

ZA WRS ticket fields (ticket number arrives later via the round feed).

jurisdiction.codestring

e.g. ZA

jurisdiction.provincestring
jurisdiction.venuestring
tx_idrequiredId
amountrequiredAmount
jackpot_contribution_microstring

pattern ^[0-9]{1,18}$

WinRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
round_idrequiredId
round_closedboolean or null

true when this call closes the round, false when more calls follow; absent or null when the studio did not say.

is_freeboolean

Free spins round (granted by the studio, or an in-game feature). The stake is passed as the studio sent it, normally 0.

default false

bonus_refId

The studio's own free spins / bonus reference, opaque to bhub. bhub creates and manages no free spins campaigns; it only passes free spins rounds through. A free spins round without a reference is still processed and is flagged for review.

round_detailsobject

The studio's raw round and bonus fields, passed through unchanged (no fixed schema).

jurisdictionobject

ZA WRS ticket fields (ticket number arrives later via the round feed).

jurisdiction.codestring

e.g. ZA

jurisdiction.provincestring
jurisdiction.venuestring
tx_idrequiredId
ref_tx_idId

The bet this win settles

amountrequiredAmount

BetWinRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
round_idrequiredId
round_closedboolean or null

true when this call closes the round, false when more calls follow; absent or null when the studio did not say.

is_freeboolean

Free spins round (granted by the studio, or an in-game feature). The stake is passed as the studio sent it, normally 0.

default false

bonus_refId

The studio's own free spins / bonus reference, opaque to bhub. bhub creates and manages no free spins campaigns; it only passes free spins rounds through. A free spins round without a reference is still processed and is flagged for review.

round_detailsobject

The studio's raw round and bonus fields, passed through unchanged (no fixed schema).

jurisdictionobject

ZA WRS ticket fields (ticket number arrives later via the round feed).

jurisdiction.codestring

e.g. ZA

jurisdiction.provincestring
jurisdiction.venuestring
tx_idrequiredId
bet_amountrequiredAmount
win_amountrequiredAmount

RollbackRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
tx_idrequiredId
ref_tx_idrequiredId
round_idrequiredId
round_closedboolean or null

EndRoundRequest

FieldTypeDescription
request_idrequiredId
session_tokenstring

at most 256 characters

player_idrequiredId
currencyrequiredCurrency
game_idrequiredId
providerrequiredId
tx_idrequiredId
round_idrequiredId
total_betrequiredAmount
total_winrequiredAmount

PromoCreditRequest

FieldTypeDescription
request_idrequiredId
tx_idrequiredId
player_idrequiredId
currencyrequiredCurrency
amountrequiredAmount
kindrequiredstring

free_spins_win is a studio's aggregated free spins total paid at the end of the free spins; report it as a promotional payout.

free_spins_winjackpottournamentprize_dropmissioncashbackadjustment
bonus_refId

The studio's opaque bonus reference, when it sent one.

round_idId
game_idId
providerId

WalletResponse

FieldTypeDescription
statusrequiredStatus
request_idId
operator_tx_idstring

at most 64 characters

currencyCurrency
balanceBalance
used_bonusAmount
messagesarray of object

Player messages the game client renders (responsible gambling, notices).

at most 3 items

messages[].titlerequiredstring

at most 60 characters

messages[].textrequiredstring

at most 300 characters

RecordLine

One line of the operator's records (the published reconciliation layout).

FieldTypeDescription
operator_tx_idstring

The operator's own id for the line.

at most 64 characters

bhub_tx_idstring

The tx_id bhub sent. The matching key.

at most 64 characters

round_idstring

Fallback key with kind and amount when bhub_tx_id is missing.

at most 64 characters

player_refstring

at most 64 characters

kindrequiredstring

bet_win is two lines: a stake and a payout.

stakepayoutrefund
amount_minorrequiredinteger (int64)

min 0

currencyrequiredCurrency
occurred_atrequiredstring (date-time)
balance_afterinteger (int64)

Cash balance after the line

statusstringokrolled_backfailed

default "ok"

TransactionsPage

FieldTypeDescription
transactionsrequiredarray of RecordLine
next_cursorrequiredstring or null

Null on the last page.

Talk to bhub

Tell us about your platform and the markets you serve.

We use these details only to answer you. Nothing is shared or sold. Read our privacy notice.