Wallet API

Wallet API is called by Hub88, and a Supplier needs to give Hub88 information on how their systems accept data and calls from Hub88 for the integration between two platforms.

Request consistency

Wallet API requests have to be idempotent. All requests contain a request_uuid field. Hub88 will ensure that requests with the same request_uuid are not processed twice, while the response will be the same for all duplicate requests, excluding the /supplier/generic/v2/user/balance call.


Wallet API Reference - Supplier API


Get a user's balance


post

The endpoint should be called when a user's balance is needed by the Supplier. Hub88 will return user's current balance. Game identifier is provided to help Hub88 with user's activity statistics.

Header parameters
X-Hub88-SignatureanyRequired

RSA-SHA256 is used to sign the request body using the private key. The signature is validated using the public key associated with the provided operator_id.

Body
supplier_userstringOptional

The user ID in the Supplier's system. If the Supplier renames Hub88's user IDs in any way(prefixes, etc.), the Supplier should send changed user IDs in this field to inform Hub88 about the renaming.

Example: hub88_john12345
tokenstringRequired

The game session token that was passed within /game/url endpoint request.

Example: 55b7518e-b89e-11e7-81be-58404eea6d16
request_uuidstringRequired

A standard 16-byte unique user identifier. The ID can be used as network layer action. An ID of an action that is generated for each game Supplier's call to Hub88. It's Used to sync Hub88 and game Supplier's sides for debugging purposes. Hub88 has to respond with the same request_uuid as the one that was received in request.

Example: 583c985f-fee6-4c0e-bbf5-308aad6265af
game_codestring | nullRequired

The unique game identifier in Provider's system in the form of a string. game_code can be obtained from the /game/list endpoint and is a required parameter.

Example: clt_dragonrising
Responses
200
OK
application/json
post
POST /supplier/generic/v2/user/balance HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 167

{
  "supplier_user": "hub88_john12345",
  "token": "55b7518e-b89e-11e7-81be-58404eea6d16",
  "request_uuid": "583c985f-fee6-4c0e-bbf5-308aad6265af",
  "game_code": "clt_dragonrising"
}
200

OK

{
  "user": "john12345",
  "status": "RS_OK",
  "request_uuid": "583c985f-fee6-4c0e-bbf5-308aad6265af",
  "currency": "USD",
  "balance": 100500
}

Update a user's balance based on transaction bet



Update a user's balance based on transaction win



Update a user's balance based on transaction rollback


post

The endpoint should be called when the Supplier receives any status other than RS_OK,RS_ERROR_LIMIT_REACHED , RS_ERROR_NOT_ENOUGH_MONEY. Hub88 will then find the referenced transaction, roll back its effects and return the users new balance. Retry Policy: In case of a network failure (HTTP 502, timeout, nxdomain, etc.) or unsuccessful status, the Supplier should retry the transaction.

Header parameters
X-Hub88-SignatureanyRequired

RSA-SHA256 is used to sign the request body using the private key. The signature is validated using the public key associated with the provided operator_id.

Body
supplier_userstringOptional

The user ID in the Supplier's system. If the Supplier renames Hub88's user IDs in any way(prefixes, etc.), the Supplier should send changed user IDs in this field to inform Hub88 about the renaming.

Example: hub88_john12345
transaction_uuidstringRequired

The unique transaction identifier. An ID of business logic action (transaction) that needs to be stored on both sides for at least 4 months (for reconciliation purposes). Hub88 has to respond on each transaction_uuid. An action with same transaction_uuid must not be processed more than once.

Example: 16d2dcfe-b89e-11e7-854a-58404eea6d16
tokenstringRequired

The game session token that was passed within /game/url endpoint request.

Example: 55b7518e-b89e-11e7-81be-58404eea6d16
round_closedboolean | nullOptional

Denotes when the round is closed.

Example: true
roundstringOptional

The game round ID used to relate all bets and wins made in one round. All transactions related to the same round have the same value in this field. The ID is not unique through whole system. The value depends on Supplier's RGS logic, as it is created from game + user + round combination, resulting in uniqueness.

Example: rNEMwgzJAOZ6eR3V
request_uuidstringRequired

A standard 16-byte unique user identifier. The ID can be used as network layer action. An ID of an action that is generated for each game Supplier's call to Hub88. It's Used to sync Hub88 and game Supplier's sides for debugging purposes. Hub88 has to respond with the same request_uuid as the one that was received in request.

Example: 583c985f-fee6-4c0e-bbf5-308aad6265af
reference_transaction_uuidstringRequired

The unique identifier of the transaction which is referenced. In case of a rollback, this field will contain the transaction_uuid of the transaction which needs to be rolled back. In case of win, there will be transaction_uuid of the bet to which the win is related to.

Example: 16d2dcfe-b89e-11e7-854a-58404eea6d16
game_codestring | nullRequired

The unique game identifier in Provider's system in the form of a string. game_code can be obtained from the /game/list endpoint and is a required parameter.

Example: clt_dragonrising
metaobject | nullOptional

The transaction metadata, enriches the transaction payload for processing.

Responses
200
OK
application/json
post
POST /supplier/generic/v2/transaction/rollback HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 352

{
  "supplier_user": "hub88_john12345",
  "transaction_uuid": "16d2dcfe-b89e-11e7-854a-58404eea6d16",
  "token": "55b7518e-b89e-11e7-81be-58404eea6d16",
  "round_closed": true,
  "round": "rNEMwgzJAOZ6eR3V",
  "request_uuid": "583c985f-fee6-4c0e-bbf5-308aad6265af",
  "reference_transaction_uuid": "16d2dcfe-b89e-11e7-854a-58404eea6d16",
  "game_code": "clt_dragonrising",
  "meta": null
}
200

OK

{
  "user": "john12345",
  "status": "RS_OK",
  "request_uuid": "583c985f-fee6-4c0e-bbf5-308aad6265af",
  "currency": "USD",
  "balance": 100500
}

Last updated

Was this helpful?