# Freebets API

***

## Freebets API Reference: Supplier API

***

### Get a list of prepaids

***

## POST /freebet/prepaids/list

> Returns the list of available prepaids. A prepaid is a reward template which specifies obtainable rounds or spins (\`bet\_count\`), value of each round or spin (\`bet\_value\`), and the currency of the reward per game. For \`bonus\_buy\` prepaids, the \`bet\_count\` does not matter. \`bet\_value\` specifies the worth of the bonus.

```json
{"openapi":"3.1.1","info":{"title":"Hub88","version":"2.0"},"tags":[{"name":"Freebets API","description":"Game Provider's methods that lets Hub88 grant reward(freebets or freespins)."}],"paths":{"/freebet/prepaids/list":{"post":{"tags":["Freebets API"],"summary":"","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prepaids"}}}}},"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":"Hub88Web.Controllers.Operator.Generic.V2.Freebet.Prepaids.do_list","description":"Returns the list of available prepaids. A prepaid is a reward template which specifies obtainable rounds or spins (`bet_count`), value of each round or spin (`bet_value`), and the currency of the reward per game. For `bonus_buy` prepaids, the `bet_count` does not matter. `bet_value` specifies the worth of the bonus.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["operator_id"],"properties":{"operator_id":{"$ref":"#/components/schemas/operator_id"},"game_code":{"$ref":"#/components/schemas/game_code"}}}}},"required":true,"description":""}}}},"components":{"schemas":{"Prepaids":{"type":"array","items":{"$ref":"#/components/schemas/Prepaid"}},"Prepaid":{"type":"object","title":"Prepaid","required":["currency","game_code","prepaid_uuid"],"properties":{"prepaid_uuid":{"$ref":"#/components/schemas/prepaid_uuid"},"game_code":{"$ref":"#/components/schemas/game_code"},"currency":{"$ref":"#/components/schemas/currency"},"bet_value":{"$ref":"#/components/schemas/money_amount"},"bet_count":{"$ref":"#/components/schemas/bet_count"},"bonus_buy":{"$ref":"#/components/schemas/bonus_buy"},"meta":{"$ref":"#/components/schemas/prepaids_meta"}},"description":"Prepaid defines the format and size of the rewards set by the game Supplier. If `bet_count` is set as `null`, there are no constraints applied to it. Bet size (`bet_value`) is defined by the number of lines, minimum and maximum bet limits and other in-game math."},"prepaid_uuid":{"type":"string","description":"Standard 16-byte prepaid's unique ID (UUID) on Hub88 side referencing a prepaid reward."},"game_code":{"type":"string","description":"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."},"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 currency code. The following list contains all currencies supported by the Hub88 system. Note that native game play support with these currencies may vary per Provider. "},"money_amount":{"type":"integer","description":"The amount of money is displayed in integers **(Int64)**. To convert real float value to integer Hub88 multiplys it by 100000. Example: `$3.56` must be represented as `356000`"},"bet_count":{"type":"integer","description":"The amount of spins / game rounds to be granted."},"bonus_buy":{"type":"boolean","nullable":false,"description":"The prepaids is meant to used for free bonus buy."},"prepaids_meta":{"nullable":false,"default":{},"type":"object","description":"Legacy support for bonus buy prepaids. Subject to deprecation. Kindly implement `bonus_buy` field only"},"operator_id":{"type":"integer","description":"The unique identifier of Hub88 configuration in the Supplier's system used to authorize incoming requests. Could be either `interger` or a `string`."}}}}
```

***

### Create a reward

***

## POST /freebet/rewards/create

> Endpoint for creating rewards. Should support creating rewards/bonuses.\
> \
> \*\*Creating a single-use reward:\*\*\
> &#x20;1\. The \`prepaid\_uuid\` is specified in the request.\
> &#x20;2\. If \`bet\_value\` and/or \`bet\_count\` in the prepaid is \`NULL\`, any values can be shared. Otherwise, the values from the prepaid will be used to create the reward.

```json
{"openapi":"3.1.1","info":{"title":"Hub88","version":"2.0"},"tags":[{"name":"Freebets API","description":"Game Provider's methods that lets Hub88 grant reward(freebets or freespins)."}],"paths":{"/freebet/rewards/create":{"post":{"tags":["Freebets API"],"summary":"","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reward"}}}}},"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":"Hub88Web.Controllers.Operator.Generic.V2.Freebet.Rewards.do_create","description":"Endpoint for creating rewards. Should support creating rewards/bonuses.\n\n**Creating a single-use reward:**\n 1. The `prepaid_uuid` is specified in the request.\n 2. If `bet_value` and/or `bet_count` in the prepaid is `NULL`, any values can be shared. Otherwise, the values from the prepaid will be used to create the reward.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user","operator_id"],"properties":{"reward_uuid":{"$ref":"#/components/schemas/reward_uuid"},"currency":{"$ref":"#/components/schemas/currency"},"user":{"$ref":"#/components/schemas/user"},"sub_partner_id":{"$ref":"#/components/schemas/sub_partner_id"},"start_time":{"$ref":"#/components/schemas/datetime"},"prepaid_uuid":{"$ref":"#/components/schemas/prepaid_uuid"},"operator_id":{"$ref":"#/components/schemas/operator_id"},"game_code":{"$ref":"#/components/schemas/game_code"},"end_time":{"$ref":"#/components/schemas/datetime"},"bet_value":{"$ref":"#/components/schemas/money_amount"},"bet_count":{"$ref":"#/components/schemas/bet_count"}}}}},"required":true,"description":""}}}},"components":{"schemas":{"Reward":{"type":"object","title":"Reward","required":["prepaid_uuid","reward_uuid","user"],"properties":{"user":{"$ref":"#/components/schemas/user"},"start_time":{"$ref":"#/components/schemas/datetime"},"reward_uuid":{"$ref":"#/components/schemas/reward_uuid"},"prepaid_uuid":{"$ref":"#/components/schemas/prepaid_uuid"},"game_code":{"$ref":"#/components/schemas/game_code"},"end_time":{"$ref":"#/components/schemas/datetime"},"currency":{"$ref":"#/components/schemas/currency"},"bet_value":{"$ref":"#/components/schemas/money_amount"},"bet_count":{"$ref":"#/components/schemas/bet_count"}},"description":"The Hub88 reward item"},"user":{"type":"string","description":"The unique user ID in the Hub88's system. In case of DEMO gameplay, this parameter may be omitted."},"datetime":{"type":"string","format":"ISO-8601","description":"The date and time combination in ISO 8601 Extended format (YYYY-MM-DDThh:mm:ss)."},"reward_uuid":{"type":"string","description":"The unique identifier for an reward on Hub88 side in standard 16-byte UUID format."},"prepaid_uuid":{"type":"string","description":"Standard 16-byte prepaid's unique ID (UUID) on Hub88 side referencing a prepaid reward."},"game_code":{"type":"string","description":"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."},"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 currency code. The following list contains all currencies supported by the Hub88 system. Note that native game play support with these currencies may vary per Provider. "},"money_amount":{"type":"integer","description":"The amount of money is displayed in integers **(Int64)**. To convert real float value to integer Hub88 multiplys it by 100000. Example: `$3.56` must be represented as `356000`"},"bet_count":{"type":"integer","description":"The amount of spins / game rounds to be granted."},"sub_partner_id":{"type":"string","description":"ID of an Hub88's sub-partner (brand, whitelabel, site, etc.) which uses the same integration and credentials as the Hub88. Used for detailed reporting and integration type switching."},"operator_id":{"type":"integer","description":"The unique identifier of Hub88 configuration in the Supplier's system used to authorize incoming requests. Could be either `interger` or a `string`."}}}}
```

***

### Cancel a reward

***

## POST /freebet/rewards/cancel

> Endpoint for canceling an reward. Please note that reward already claimed by user cannot be canceled.

```json
{"openapi":"3.1.1","info":{"title":"Hub88","version":"2.0"},"tags":[{"name":"Freebets API","description":"Game Provider's methods that lets Hub88 grant reward(freebets or freespins)."}],"paths":{"/freebet/rewards/cancel":{"post":{"tags":["Freebets API"],"summary":"","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reward"}}}}},"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":"Hub88Web.Controllers.Operator.Generic.V2.Freebet.Rewards.do_cancel","description":"Endpoint for canceling an reward. Please note that reward already claimed by user cannot be canceled.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["reward_uuid","operator_id"],"properties":{"reward_uuid":{"$ref":"#/components/schemas/reward_uuid"},"operator_id":{"$ref":"#/components/schemas/operator_id"}}}}},"required":true,"description":""}}}},"components":{"schemas":{"Reward":{"type":"object","title":"Reward","required":["prepaid_uuid","reward_uuid","user"],"properties":{"user":{"$ref":"#/components/schemas/user"},"start_time":{"$ref":"#/components/schemas/datetime"},"reward_uuid":{"$ref":"#/components/schemas/reward_uuid"},"prepaid_uuid":{"$ref":"#/components/schemas/prepaid_uuid"},"game_code":{"$ref":"#/components/schemas/game_code"},"end_time":{"$ref":"#/components/schemas/datetime"},"currency":{"$ref":"#/components/schemas/currency"},"bet_value":{"$ref":"#/components/schemas/money_amount"},"bet_count":{"$ref":"#/components/schemas/bet_count"}},"description":"The Hub88 reward item"},"user":{"type":"string","description":"The unique user ID in the Hub88's system. In case of DEMO gameplay, this parameter may be omitted."},"datetime":{"type":"string","format":"ISO-8601","description":"The date and time combination in ISO 8601 Extended format (YYYY-MM-DDThh:mm:ss)."},"reward_uuid":{"type":"string","description":"The unique identifier for an reward on Hub88 side in standard 16-byte UUID format."},"prepaid_uuid":{"type":"string","description":"Standard 16-byte prepaid's unique ID (UUID) on Hub88 side referencing a prepaid reward."},"game_code":{"type":"string","description":"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."},"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 currency code. The following list contains all currencies supported by the Hub88 system. Note that native game play support with these currencies may vary per Provider. "},"money_amount":{"type":"integer","description":"The amount of money is displayed in integers **(Int64)**. To convert real float value to integer Hub88 multiplys it by 100000. Example: `$3.56` must be represented as `356000`"},"bet_count":{"type":"integer","description":"The amount of spins / game rounds to be granted."},"operator_id":{"type":"integer","description":"The unique identifier of Hub88 configuration in the Supplier's system used to authorize incoming requests. Could be either `interger` or a `string`."}}}}
```

***
