# Wallet API

**Wallet API** is an API to integrate **Seamless wallet logic** to Hub88. The API works in a manner where Hub88 is the consumer and **the Operator needs to provide** corresponding endpoints based on the following API structures. Wallet API also has its own response status codes available [here](https://docs.hub88.io/developer-docs/operator-api-reference/operator-api-overview/seamless-wallet-response-statuses-operator-api).

***

## Wallet API Reference

***

### Get user's info

***

## POST /user/info

> Provides a player's data. The Operator is expected to return all available details.

```json
{"openapi":"3.1.1","info":{"title":"Hub88","version":"2.0"},"tags":[{"name":"Wallet API","description":"Operator is expected to provide API for Hub88 calls. API should process the described requests from Hub88."}],"paths":{"/user/info":{"post":{"tags":["Wallet API"],"summary":"","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfoResponse"}}}}},"parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Hub88-Signature","in":"header","description":"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`."}],"operationId":"/user/info","description":"Provides a player's data. The Operator is expected to return all available details.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user","request_uuid"],"properties":{"user":{"description":"The unique User ID in the Operator’s system. When generating the value, avoid using any real user data, that could be used to identify the person (e.g. full name, phone, email). Minimum value 4 characters.","type":"string"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"}}}}},"required":true,"description":""}}}},"components":{"schemas":{"UserInfoResponse":{"type":"object","title":"User Info Response","required":["user","status","request_uuid","country"],"properties":{"user":{"description":"Unique user ID in the Operator’s system. When generating the value, avoid using any real user data, that could be used to identify the person (e.g. full name, phone, email). Minimum value 4 characters.","type":"string"},"status":{"description":"","$ref":"#/components/schemas/status"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"country":{"description":"","$ref":"#/components/schemas/country"},"jurisdiction":{"description":"Jurisdiction the player should play in","type":"string","enum":["MGA","UKGC","SGA","GRA","CeG"]},"sub_partner_id":{"description":"","$ref":"#/components/schemas/sub_partner_id"},"birth_date":{"description":"Birth date of the player","type":"string"},"registration_date":{"description":"Registration date of the player","type":"string"},"tags":{"description":"List of tags applied to the player","type":"array","items":{"type":"string"}},"sex":{"description":"Sex of the player","type":"string","enum":["MALE","FEMALE"]},"affiliate_id":{"description":"ID of the affliate that brought the player to the platform","type":"string"}},"description":"Wallet API response"},"status":{"type":"string","enum":["RS_OK","RS_ERROR_UNKNOWN","RS_ERROR_INVALID_PARTNER","RS_ERROR_INVALID_TOKEN","RS_ERROR_INVALID_GAMERS_ERROR_WRONG_CURRENCY","RS_ERROR_NOT_ENOUGH_MONEY","RS_ERROR_USER_DISABLED","RS_ERROR_INVALID_SIGNATURE","RS_ERROR_TOKEN_EXPIRED","RS_ERROR_WRONG_SYNTAX","RS_ERROR_WRONG_TYPES","RS_ERROR_DUPLICATE_TRANSACTION","RS_ERROR_TRANSACTION_DOES_NOT_EXIST","RS_ERROR_LIMIT_REACHED"],"description":"Response status"},"request_uuid":{"type":"string","description":"An ID of an action that is generated for each of our calls to the Operator, used to sync Hub88 and Operator sides for debugging purposes, displayed in standard 16-byte UUID format. The Operator has to respond with the same `request_uuid` as the one received in request."},"country":{"type":"string","enum":["XX","AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"],"description":"The [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) country code, applicable to the User in the current session. "},"sub_partner_id":{"type":"string","description":"ID of Operator's sub-partner (brand, whitelabel, site, etc.) which uses same integration and credentials as an Operator. Used for detailed reporting and integration type switching. Sites under the same Operator can use different integration types: TransferWallet or SeamlessWallet. A single site (sub_partner_id) can NOT have both kinds of integration at the same time."}}}}
```

***

### Get user's balance

***

## POST /user/balance

> Called when the player's balance is needed. The Operator is expected to return player's current balance. The Game code is provided to help the Operator with player's activity statistics.

```json
{"openapi":"3.1.1","info":{"title":"Hub88","version":"2.0"},"tags":[{"name":"Wallet API","description":"Operator is expected to provide API for Hub88 calls. API should process the described requests from Hub88."}],"paths":{"/user/balance":{"post":{"tags":["Wallet API"],"summary":"","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}}},"parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Hub88-Signature","in":"header","description":"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`."}],"operationId":"/user/balance","description":"Called when the player's balance is needed. The Operator is expected to return player's current balance. The Game code is provided to help the Operator with player's activity statistics.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user","game_code","token","request_uuid"],"properties":{"user":{"description":"","$ref":"#/components/schemas/user"},"token":{"type":"string","description":"The game session token that was passed within `/game/url` endpoint response."},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"game_code":{"description":"","$ref":"#/components/schemas/game_code"}}}}},"required":true,"description":""}}}},"components":{"schemas":{"Response":{"type":"object","title":"Response","required":["user","status","request_uuid"],"properties":{"user":{"description":"","$ref":"#/components/schemas/user"},"status":{"description":"","$ref":"#/components/schemas/status"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"currency":{"description":"","$ref":"#/components/schemas/currency"},"balance":{"description":"","$ref":"#/components/schemas/money_amount"}},"description":"Wallet API response"},"user":{"type":"string","minLength":3,"description":"The unique user ID in the Operator’s system. In case of DEMO gameplay, this parameter may be omitted."},"status":{"type":"string","enum":["RS_OK","RS_ERROR_UNKNOWN","RS_ERROR_INVALID_PARTNER","RS_ERROR_INVALID_TOKEN","RS_ERROR_INVALID_GAMERS_ERROR_WRONG_CURRENCY","RS_ERROR_NOT_ENOUGH_MONEY","RS_ERROR_USER_DISABLED","RS_ERROR_INVALID_SIGNATURE","RS_ERROR_TOKEN_EXPIRED","RS_ERROR_WRONG_SYNTAX","RS_ERROR_WRONG_TYPES","RS_ERROR_DUPLICATE_TRANSACTION","RS_ERROR_TRANSACTION_DOES_NOT_EXIST","RS_ERROR_LIMIT_REACHED"],"description":"Response status"},"request_uuid":{"type":"string","description":"An ID of an action that is generated for each of our calls to the Operator, used to sync Hub88 and Operator sides for debugging purposes, displayed in standard 16-byte UUID format. The Operator has to respond with the same `request_uuid` as the one received in request."},"currency":{"type":"string","enum":["BSD","TTD","ZMW","BMD","USD","BYR","UGX","HKD","MGA","GIP","UZS","MKD","PTS","mLTC","EGP","AWG","CZK","ILS","MZN","TND","XPF","SOS","DOP","RUB","KRW","BTN","KGS","BAM","AOA","SOC","AMS","BND","RSD","FKP","PEN","EOS","GHS","JPY","TRY","SBD","UAH","LTL","FJD","GNF","MDL","AFN","ZAR","MOP","TJS","BOB","JMD","QAR","IRR","SYP","XXX","NAD","MYR","CUP","NOK","BGN","KPW","MNT","NZD","uETH","SGD","PYG","OMR","DZD","EUR","TMT","MMK","PTQ","ANG","TZS","CRC","VES","ETB","THB","ZWD","LYD","CHF","MVR","KES","CVE","LSL","KMF","SZL","KYD","BRL","AED","WST","YER","ALL","TRX","HUF","GTQ","uBTC","IDR","MWK","CUC","DKK","TWD","XCD","BBD","LRD","KZT","JOD","BYN","BIF","PLN","SDG","VUV","SEK","BDT","HNL","BWP","VND","ISK","SLL","BHD","HTG","USDT","ADA","MUR","ERN","uLTC","LKR","COP","GEL","AUD","GBP","CAD","PHP","PAB","DJF","GMD","PKR","NIO","AMD","RWF","RON","NGN","TOP","UYU","AZN","SRD","KWD","PGK","CDF","SAR","IQD","XRP","SCR","mETH","MAD","GYD","INR","LBP","ARS","MXN","CLP","BNB","CNY","KHR","LAK","HRK","BZD","SSP","XOF","X5T","MRO","NPR","mBTC"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. The following list contains all currencies supported by our system. Note that native gameplay support for these currencies may vary per Provider. Please contact us to know which Provider supports which currencies."},"money_amount":{"type":"integer","description":"The amount of money displayed in integer **(Int64)** format. To convert real float value to integer, it is multiplied by 100000. Example: `$3.56` is represented as `356000`"},"game_code":{"type":"string","description":"The unique game identifier in Hub88 system in the form of a string. `game_code` can be obtained from the `/game/list` endpoint."}}}}
```

***

### Update user's balance based on transaction win

***

## POST /transaction/win

> Called when the User wins (credit). The Operator is expected to increase player's balance by \`amount\` and return a new balance. The \`reference\_transaction\_uuid\` is used to show to which bet the win is related to.\
> &#x20;                       Each win has \`transaction\_uuid\` which is unique identifier of this transaction. Before any altering of User's balance, Operator has to check that win wasn't processed before.\
> &#x20;                       \*\*Retry Policy:\*\* In case of network fail (HTTP 502, timeout, nxdomain, etc.) we will retry 3 times with 1 sec of timeout. The rest of retry logic is left to provider's RGS: the retries may continue indefinitely or the bet may be rolled back, and the money returned back to user.

```json
{"openapi":"3.1.1","info":{"title":"Hub88","version":"2.0"},"tags":[{"name":"Wallet API","description":"Operator is expected to provide API for Hub88 calls. API should process the described requests from Hub88."}],"paths":{"/transaction/win":{"post":{"tags":["Wallet API"],"summary":"","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}}},"parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Hub88-Signature","in":"header","description":"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`."}],"operationId":"/transaction/win","description":"Called when the User wins (credit). The Operator is expected to increase player's balance by `amount` and return a new balance. The `reference_transaction_uuid` is used to show to which bet the win is related to.\n                        Each win has `transaction_uuid` which is unique identifier of this transaction. Before any altering of User's balance, Operator has to check that win wasn't processed before.\n                        **Retry Policy:** In case of network fail (HTTP 502, timeout, nxdomain, etc.) we will retry 3 times with 1 sec of timeout. The rest of retry logic is left to provider's RGS: the retries may continue indefinitely or the bet may be rolled back, and the money returned back to user.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["game_code","supplier_user","is_free","user","bet","round_closed","round","currency","amount","token","reference_transaction_uuid","transaction_uuid","supplier_transaction_id","request_uuid"],"properties":{"user":{"description":"","$ref":"#/components/schemas/user"},"transaction_uuid":{"description":"","$ref":"#/components/schemas/transaction_uuid"},"supplier_transaction_id":{"description":"","$ref":"#/components/schemas/supplier_transaction_id"},"token":{"type":"string","description":"The game session token that was passed within `/game/url` endpoint request."},"supplier_user":{"description":"","$ref":"#/components/schemas/supplier_user"},"round_closed":{"description":"","$ref":"#/components/schemas/round_closed"},"round":{"description":"","$ref":"#/components/schemas/round"},"reward_uuid":{"description":"","$ref":"#/components/schemas/reward_uuid"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"reference_transaction_uuid":{"description":"","$ref":"#/components/schemas/reference_transaction_uuid"},"is_free":{"description":"","$ref":"#/components/schemas/is_free"},"is_supplier_promo":{"type":"boolean","description":"Indicates that the promotion was created and granted by the game Supplier. \n    When set to `true`, the system treats the transaction as a supplier-issued free promotion. Default value `false`. \n   With this parameter, it's necessary for an Operator to NOT validate the expiration of the `token` as bet and win transactions could belong to inactive/staled session on operator side. `token` should be verified to be valid. "},"is_aggregated":{"description":"","$ref":"#/components/schemas/is_aggregated"},"game_code":{"description":"","$ref":"#/components/schemas/game_code"},"currency":{"description":"","$ref":"#/components/schemas/currency"},"bet":{"description":"","$ref":"#/components/schemas/bet"},"amount":{"description":"","$ref":"#/components/schemas/money_amount"},"meta":{"description":"","$ref":"#/components/schemas/meta_with_operator_reference"}}}}},"required":true,"description":""}}}},"components":{"schemas":{"Response":{"type":"object","title":"Response","required":["user","status","request_uuid"],"properties":{"user":{"description":"","$ref":"#/components/schemas/user"},"status":{"description":"","$ref":"#/components/schemas/status"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"currency":{"description":"","$ref":"#/components/schemas/currency"},"balance":{"description":"","$ref":"#/components/schemas/money_amount"}},"description":"Wallet API response"},"user":{"type":"string","minLength":3,"description":"The unique user ID in the Operator’s system. In case of DEMO gameplay, this parameter may be omitted."},"status":{"type":"string","enum":["RS_OK","RS_ERROR_UNKNOWN","RS_ERROR_INVALID_PARTNER","RS_ERROR_INVALID_TOKEN","RS_ERROR_INVALID_GAMERS_ERROR_WRONG_CURRENCY","RS_ERROR_NOT_ENOUGH_MONEY","RS_ERROR_USER_DISABLED","RS_ERROR_INVALID_SIGNATURE","RS_ERROR_TOKEN_EXPIRED","RS_ERROR_WRONG_SYNTAX","RS_ERROR_WRONG_TYPES","RS_ERROR_DUPLICATE_TRANSACTION","RS_ERROR_TRANSACTION_DOES_NOT_EXIST","RS_ERROR_LIMIT_REACHED"],"description":"Response status"},"request_uuid":{"type":"string","description":"An ID of an action that is generated for each of our calls to the Operator, used to sync Hub88 and Operator sides for debugging purposes, displayed in standard 16-byte UUID format. The Operator has to respond with the same `request_uuid` as the one received in request."},"currency":{"type":"string","enum":["BSD","TTD","ZMW","BMD","USD","BYR","UGX","HKD","MGA","GIP","UZS","MKD","PTS","mLTC","EGP","AWG","CZK","ILS","MZN","TND","XPF","SOS","DOP","RUB","KRW","BTN","KGS","BAM","AOA","SOC","AMS","BND","RSD","FKP","PEN","EOS","GHS","JPY","TRY","SBD","UAH","LTL","FJD","GNF","MDL","AFN","ZAR","MOP","TJS","BOB","JMD","QAR","IRR","SYP","XXX","NAD","MYR","CUP","NOK","BGN","KPW","MNT","NZD","uETH","SGD","PYG","OMR","DZD","EUR","TMT","MMK","PTQ","ANG","TZS","CRC","VES","ETB","THB","ZWD","LYD","CHF","MVR","KES","CVE","LSL","KMF","SZL","KYD","BRL","AED","WST","YER","ALL","TRX","HUF","GTQ","uBTC","IDR","MWK","CUC","DKK","TWD","XCD","BBD","LRD","KZT","JOD","BYN","BIF","PLN","SDG","VUV","SEK","BDT","HNL","BWP","VND","ISK","SLL","BHD","HTG","USDT","ADA","MUR","ERN","uLTC","LKR","COP","GEL","AUD","GBP","CAD","PHP","PAB","DJF","GMD","PKR","NIO","AMD","RWF","RON","NGN","TOP","UYU","AZN","SRD","KWD","PGK","CDF","SAR","IQD","XRP","SCR","mETH","MAD","GYD","INR","LBP","ARS","MXN","CLP","BNB","CNY","KHR","LAK","HRK","BZD","SSP","XOF","X5T","MRO","NPR","mBTC"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. The following list contains all currencies supported by our system. Note that native gameplay support for these currencies may vary per Provider. Please contact us to know which Provider supports which currencies."},"money_amount":{"type":"integer","description":"The amount of money displayed in integer **(Int64)** format. To convert real float value to integer, it is multiplied by 100000. Example: `$3.56` is represented as `356000`"},"transaction_uuid":{"type":"string","description":"The unique transaction identifier. An ID of business logic action (transaction) that <b>needs to be stored</b> on both sides for <b>at least 4 months</b> (for reconciliation purposes). Operator has to respond on each `transaction_uuid`. An action with same `transaction_uuid` shouldn't be processed more than once."},"supplier_transaction_id":{"type":"string","description":"The transaction identifier received from the game Supplier. This identifier will be used to investigate any issues via customer support tickets."},"supplier_user":{"type":"string","description":"The name of the user in the Provider’s system. In case Operator needs to find a user in Provder’s back office or report a problem with the user. If the value is NULL, the Operator can search for their own `user_id`."},"round_closed":{"type":"boolean","description":"Denotes when the round is closed. Can be null."},"round":{"type":"string","description":"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 provider’s RGS logic, as it is created from game + user + round combination, resulting in uniqueness. The value can be null or omitted."},"reward_uuid":{"type":"string","description":"The unique identifier for an reward on Hub88 side in standard 16-byte UUID format."},"reference_transaction_uuid":{"type":"string","description":"Unique identifier of the transaction that this transaction is referencing. In case of a rollback, this field will contain `transaction_uuid` of the transaction which needs to be rolled back. In case of a win, there will be `transaction_uuid` of the bet to which this win is related to."},"is_free":{"type":"boolean","description":"The flag which indicates that the transaction is tied to a reward issued via Hub88’s Freebets API. Set to `true` only when the transaction is the result of a previously created reward. When `false` or omitted, the transaction is not connected to a Hub88 Freebets API (e.g. the transaction is a regular gameplay or supplier-managed promotions). Can be null."},"is_aggregated":{"type":"boolean","description":"The flag which shows that related freebet transactions identified in the field `reward_uuid` have been aggregated into one single transaction. For example, a player was rewarded ten (10) freespins, but Hub88 sends one single transaction request with field `is_aggregated` set to true. The value can be null or omitted."},"game_code":{"type":"string","description":"The unique game identifier in Hub88 system in the form of a string. `game_code` can be obtained from the `/game/list` endpoint."},"bet":{"type":"string","description":"The field for metadata related to transaction, such as type of bet, value, time, etc. Differs from game to game. Not relevant for transaction processing procedure but could be useful for statistics or activity backtracking. The value can be null or omitted."},"meta_with_operator_reference":{"type":"object","description":"The transaction metadata. Differs from game to game and is used for enriching the transaction payload. If `is_supplier_promo` is set to `true`, it may include `supplier_promo_info` and a `promo_reference`. This object can also include the optional fields below.","properties":{"operator_reference":{"type":"string","description":"Unique reference of reward on operator side. Grants idempotency on reward creation."},"campaign_uuid":{"$ref":"#/components/schemas/campaign_uuid"}}},"campaign_uuid":{"type":"string","description":"The unique campaign ID in Hub88 side, displayed in standard 16-byte UUID format."}}}}
```

***

### Update user balance based on transaction bet

***

## POST /transaction/bet

> The endpoint called when a User places a bet (debit). The Operator is expected to decrease the player's balance by the \`amount\` value and return a new balance.\
> &#x20;                        Each bet has a unique identifier ( \`transaction\_uuid\`) for this transaction. Before altering the user's balance, the Operator has to check that the bet wasn't processed before. There might be \
> &#x20;                        \*\*Retry Policy:\*\*  In case of network fail (HTTP 502, timeout, nxdomain, etc.), we will retry 3 times with 1 sec of timeout. If we do not receive 200 HTTP status, this transaction will be counted as failed and rollback will be generated (to ensure that failed bet hadn’t affected User’s balance). This rollback will be retried 500 times (or less if we get logical response) with exponential back off.&#x20;

```json
{"openapi":"3.1.1","info":{"title":"Hub88","version":"2.0"},"tags":[{"name":"Wallet API","description":"Operator is expected to provide API for Hub88 calls. API should process the described requests from Hub88."}],"paths":{"/transaction/bet":{"post":{"tags":["Wallet API"],"summary":"","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}}},"parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Hub88-Signature","in":"header","description":"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`."}],"operationId":"/transaction/bet","description":"The endpoint called when a User places a bet (debit). The Operator is expected to decrease the player's balance by the `amount` value and return a new balance.\n                         Each bet has a unique identifier ( `transaction_uuid`) for this transaction. Before altering the user's balance, the Operator has to check that the bet wasn't processed before. There might be \n                         **Retry Policy:**  In case of network fail (HTTP 502, timeout, nxdomain, etc.), we will retry 3 times with 1 sec of timeout. If we do not receive 200 HTTP status, this transaction will be counted as failed and rollback will be generated (to ensure that failed bet hadn’t affected User’s balance). This rollback will be retried 500 times (or less if we get logical response) with exponential back off. ","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["game_code","supplier_user","user","is_free","bet","round_closed","round","currency","amount","token","transaction_uuid","supplier_transaction_id","request_uuid"],"properties":{"user":{"description":"","$ref":"#/components/schemas/user"},"transaction_uuid":{"description":"","$ref":"#/components/schemas/transaction_uuid"},"supplier_transaction_id":{"description":"","$ref":"#/components/schemas/supplier_transaction_id"},"token":{"type":"string","description":"The game session token that was passed within `/game/url` endpoint response."},"supplier_user":{"description":"","$ref":"#/components/schemas/supplier_user"},"round_closed":{"description":"","$ref":"#/components/schemas/round_closed"},"round":{"description":"","$ref":"#/components/schemas/round"},"reward_uuid":{"description":"","$ref":"#/components/schemas/reward_uuid"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"is_free":{"description":"","$ref":"#/components/schemas/is_free"},"is_supplier_promo":{"type":"boolean","description":"Indicates that the promotion was created and granted by the game Supplier. \n    When set to `true`, the system treats the transaction as a supplier-issued free promotion. Default value `false`. \n    With this parameter, it's necessary for an Operator to NOT validate the expiration of the `token` as bet and win transactions could belong to inactive/staled session on operator side. `token` should be verified to be valid."},"is_aggregated":{"description":"","$ref":"#/components/schemas/is_aggregated"},"game_code":{"description":"","$ref":"#/components/schemas/game_code"},"currency":{"description":"","$ref":"#/components/schemas/currency"},"bet":{"description":"","$ref":"#/components/schemas/bet"},"amount":{"description":"","$ref":"#/components/schemas/money_amount"},"meta":{"description":"","$ref":"#/components/schemas/meta_with_operator_reference"}}}}},"required":true,"description":""}}}},"components":{"schemas":{"Response":{"type":"object","title":"Response","required":["user","status","request_uuid"],"properties":{"user":{"description":"","$ref":"#/components/schemas/user"},"status":{"description":"","$ref":"#/components/schemas/status"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"currency":{"description":"","$ref":"#/components/schemas/currency"},"balance":{"description":"","$ref":"#/components/schemas/money_amount"}},"description":"Wallet API response"},"user":{"type":"string","minLength":3,"description":"The unique user ID in the Operator’s system. In case of DEMO gameplay, this parameter may be omitted."},"status":{"type":"string","enum":["RS_OK","RS_ERROR_UNKNOWN","RS_ERROR_INVALID_PARTNER","RS_ERROR_INVALID_TOKEN","RS_ERROR_INVALID_GAMERS_ERROR_WRONG_CURRENCY","RS_ERROR_NOT_ENOUGH_MONEY","RS_ERROR_USER_DISABLED","RS_ERROR_INVALID_SIGNATURE","RS_ERROR_TOKEN_EXPIRED","RS_ERROR_WRONG_SYNTAX","RS_ERROR_WRONG_TYPES","RS_ERROR_DUPLICATE_TRANSACTION","RS_ERROR_TRANSACTION_DOES_NOT_EXIST","RS_ERROR_LIMIT_REACHED"],"description":"Response status"},"request_uuid":{"type":"string","description":"An ID of an action that is generated for each of our calls to the Operator, used to sync Hub88 and Operator sides for debugging purposes, displayed in standard 16-byte UUID format. The Operator has to respond with the same `request_uuid` as the one received in request."},"currency":{"type":"string","enum":["BSD","TTD","ZMW","BMD","USD","BYR","UGX","HKD","MGA","GIP","UZS","MKD","PTS","mLTC","EGP","AWG","CZK","ILS","MZN","TND","XPF","SOS","DOP","RUB","KRW","BTN","KGS","BAM","AOA","SOC","AMS","BND","RSD","FKP","PEN","EOS","GHS","JPY","TRY","SBD","UAH","LTL","FJD","GNF","MDL","AFN","ZAR","MOP","TJS","BOB","JMD","QAR","IRR","SYP","XXX","NAD","MYR","CUP","NOK","BGN","KPW","MNT","NZD","uETH","SGD","PYG","OMR","DZD","EUR","TMT","MMK","PTQ","ANG","TZS","CRC","VES","ETB","THB","ZWD","LYD","CHF","MVR","KES","CVE","LSL","KMF","SZL","KYD","BRL","AED","WST","YER","ALL","TRX","HUF","GTQ","uBTC","IDR","MWK","CUC","DKK","TWD","XCD","BBD","LRD","KZT","JOD","BYN","BIF","PLN","SDG","VUV","SEK","BDT","HNL","BWP","VND","ISK","SLL","BHD","HTG","USDT","ADA","MUR","ERN","uLTC","LKR","COP","GEL","AUD","GBP","CAD","PHP","PAB","DJF","GMD","PKR","NIO","AMD","RWF","RON","NGN","TOP","UYU","AZN","SRD","KWD","PGK","CDF","SAR","IQD","XRP","SCR","mETH","MAD","GYD","INR","LBP","ARS","MXN","CLP","BNB","CNY","KHR","LAK","HRK","BZD","SSP","XOF","X5T","MRO","NPR","mBTC"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. The following list contains all currencies supported by our system. Note that native gameplay support for these currencies may vary per Provider. Please contact us to know which Provider supports which currencies."},"money_amount":{"type":"integer","description":"The amount of money displayed in integer **(Int64)** format. To convert real float value to integer, it is multiplied by 100000. Example: `$3.56` is represented as `356000`"},"transaction_uuid":{"type":"string","description":"The unique transaction identifier. An ID of business logic action (transaction) that <b>needs to be stored</b> on both sides for <b>at least 4 months</b> (for reconciliation purposes). Operator has to respond on each `transaction_uuid`. An action with same `transaction_uuid` shouldn't be processed more than once."},"supplier_transaction_id":{"type":"string","description":"The transaction identifier received from the game Supplier. This identifier will be used to investigate any issues via customer support tickets."},"supplier_user":{"type":"string","description":"The name of the user in the Provider’s system. In case Operator needs to find a user in Provder’s back office or report a problem with the user. If the value is NULL, the Operator can search for their own `user_id`."},"round_closed":{"type":"boolean","description":"Denotes when the round is closed. Can be null."},"round":{"type":"string","description":"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 provider’s RGS logic, as it is created from game + user + round combination, resulting in uniqueness. The value can be null or omitted."},"reward_uuid":{"type":"string","description":"The unique identifier for an reward on Hub88 side in standard 16-byte UUID format."},"is_free":{"type":"boolean","description":"The flag which indicates that the transaction is tied to a reward issued via Hub88’s Freebets API. Set to `true` only when the transaction is the result of a previously created reward. When `false` or omitted, the transaction is not connected to a Hub88 Freebets API (e.g. the transaction is a regular gameplay or supplier-managed promotions). Can be null."},"is_aggregated":{"type":"boolean","description":"The flag which shows that related freebet transactions identified in the field `reward_uuid` have been aggregated into one single transaction. For example, a player was rewarded ten (10) freespins, but Hub88 sends one single transaction request with field `is_aggregated` set to true. The value can be null or omitted."},"game_code":{"type":"string","description":"The unique game identifier in Hub88 system in the form of a string. `game_code` can be obtained from the `/game/list` endpoint."},"bet":{"type":"string","description":"The field for metadata related to transaction, such as type of bet, value, time, etc. Differs from game to game. Not relevant for transaction processing procedure but could be useful for statistics or activity backtracking. The value can be null or omitted."},"meta_with_operator_reference":{"type":"object","description":"The transaction metadata. Differs from game to game and is used for enriching the transaction payload. If `is_supplier_promo` is set to `true`, it may include `supplier_promo_info` and a `promo_reference`. This object can also include the optional fields below.","properties":{"operator_reference":{"type":"string","description":"Unique reference of reward on operator side. Grants idempotency on reward creation."},"campaign_uuid":{"$ref":"#/components/schemas/campaign_uuid"}}},"campaign_uuid":{"type":"string","description":"The unique campaign ID in Hub88 side, displayed in standard 16-byte UUID format."}}}}
```

***

### Rollback transaction

***

## POST /transaction/rollback

> Called when there is need to roll back the effect of the referenced transaction. The Operator is expected to find the referenced transaction, roll back its effects and return the player's new balance.

```json
{"openapi":"3.1.1","info":{"title":"Hub88","version":"2.0"},"tags":[{"name":"Wallet API","description":"Operator is expected to provide API for Hub88 calls. API should process the described requests from Hub88."}],"paths":{"/transaction/rollback":{"post":{"tags":["Wallet API"],"summary":"","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}}},"parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Hub88-Signature","in":"header","description":"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`."}],"operationId":"/transaction/rollback","description":"Called when there is need to roll back the effect of the referenced transaction. The Operator is expected to find the referenced transaction, roll back its effects and return the player's new balance.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user","game_code","round","token","reference_transaction_uuid","transaction_uuid","supplier_transaction_id","request_uuid"],"properties":{"user":{"description":"","$ref":"#/components/schemas/user"},"transaction_uuid":{"description":"","$ref":"#/components/schemas/transaction_uuid"},"supplier_transaction_id":{"description":"","$ref":"#/components/schemas/supplier_transaction_id"},"token":{"type":"string","description":"The game session token that was passed within `/game/url` endpoint response."},"round_closed":{"description":"","$ref":"#/components/schemas/round_closed"},"round":{"description":"","$ref":"#/components/schemas/round"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"reference_transaction_uuid":{"description":"","$ref":"#/components/schemas/reference_transaction_uuid"},"game_code":{"description":"","$ref":"#/components/schemas/game_code"},"meta":{"description":"","$ref":"#/components/schemas/meta"}}}}},"required":true,"description":""}}}},"components":{"schemas":{"Response":{"type":"object","title":"Response","required":["user","status","request_uuid"],"properties":{"user":{"description":"","$ref":"#/components/schemas/user"},"status":{"description":"","$ref":"#/components/schemas/status"},"request_uuid":{"description":"","$ref":"#/components/schemas/request_uuid"},"currency":{"description":"","$ref":"#/components/schemas/currency"},"balance":{"description":"","$ref":"#/components/schemas/money_amount"}},"description":"Wallet API response"},"user":{"type":"string","minLength":3,"description":"The unique user ID in the Operator’s system. In case of DEMO gameplay, this parameter may be omitted."},"status":{"type":"string","enum":["RS_OK","RS_ERROR_UNKNOWN","RS_ERROR_INVALID_PARTNER","RS_ERROR_INVALID_TOKEN","RS_ERROR_INVALID_GAMERS_ERROR_WRONG_CURRENCY","RS_ERROR_NOT_ENOUGH_MONEY","RS_ERROR_USER_DISABLED","RS_ERROR_INVALID_SIGNATURE","RS_ERROR_TOKEN_EXPIRED","RS_ERROR_WRONG_SYNTAX","RS_ERROR_WRONG_TYPES","RS_ERROR_DUPLICATE_TRANSACTION","RS_ERROR_TRANSACTION_DOES_NOT_EXIST","RS_ERROR_LIMIT_REACHED"],"description":"Response status"},"request_uuid":{"type":"string","description":"An ID of an action that is generated for each of our calls to the Operator, used to sync Hub88 and Operator sides for debugging purposes, displayed in standard 16-byte UUID format. The Operator has to respond with the same `request_uuid` as the one received in request."},"currency":{"type":"string","enum":["BSD","TTD","ZMW","BMD","USD","BYR","UGX","HKD","MGA","GIP","UZS","MKD","PTS","mLTC","EGP","AWG","CZK","ILS","MZN","TND","XPF","SOS","DOP","RUB","KRW","BTN","KGS","BAM","AOA","SOC","AMS","BND","RSD","FKP","PEN","EOS","GHS","JPY","TRY","SBD","UAH","LTL","FJD","GNF","MDL","AFN","ZAR","MOP","TJS","BOB","JMD","QAR","IRR","SYP","XXX","NAD","MYR","CUP","NOK","BGN","KPW","MNT","NZD","uETH","SGD","PYG","OMR","DZD","EUR","TMT","MMK","PTQ","ANG","TZS","CRC","VES","ETB","THB","ZWD","LYD","CHF","MVR","KES","CVE","LSL","KMF","SZL","KYD","BRL","AED","WST","YER","ALL","TRX","HUF","GTQ","uBTC","IDR","MWK","CUC","DKK","TWD","XCD","BBD","LRD","KZT","JOD","BYN","BIF","PLN","SDG","VUV","SEK","BDT","HNL","BWP","VND","ISK","SLL","BHD","HTG","USDT","ADA","MUR","ERN","uLTC","LKR","COP","GEL","AUD","GBP","CAD","PHP","PAB","DJF","GMD","PKR","NIO","AMD","RWF","RON","NGN","TOP","UYU","AZN","SRD","KWD","PGK","CDF","SAR","IQD","XRP","SCR","mETH","MAD","GYD","INR","LBP","ARS","MXN","CLP","BNB","CNY","KHR","LAK","HRK","BZD","SSP","XOF","X5T","MRO","NPR","mBTC"],"description":"The [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. The following list contains all currencies supported by our system. Note that native gameplay support for these currencies may vary per Provider. Please contact us to know which Provider supports which currencies."},"money_amount":{"type":"integer","description":"The amount of money displayed in integer **(Int64)** format. To convert real float value to integer, it is multiplied by 100000. Example: `$3.56` is represented as `356000`"},"transaction_uuid":{"type":"string","description":"The unique transaction identifier. An ID of business logic action (transaction) that <b>needs to be stored</b> on both sides for <b>at least 4 months</b> (for reconciliation purposes). Operator has to respond on each `transaction_uuid`. An action with same `transaction_uuid` shouldn't be processed more than once."},"supplier_transaction_id":{"type":"string","description":"The transaction identifier received from the game Supplier. This identifier will be used to investigate any issues via customer support tickets."},"round_closed":{"type":"boolean","description":"Denotes when the round is closed. Can be null."},"round":{"type":"string","description":"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 provider’s RGS logic, as it is created from game + user + round combination, resulting in uniqueness. The value can be null or omitted."},"reference_transaction_uuid":{"type":"string","description":"Unique identifier of the transaction that this transaction is referencing. In case of a rollback, this field will contain `transaction_uuid` of the transaction which needs to be rolled back. In case of a win, there will be `transaction_uuid` of the bet to which this win is related to."},"game_code":{"type":"string","description":"The unique game identifier in Hub88 system in the form of a string. `game_code` can be obtained from the `/game/list` endpoint."},"meta":{"type":"object","description":"The transaction metadata, enriches the transaction payload for processing. The value can be null or omitted."}}}}
```
