Appearance
Templates
With this method, you can get a list of available bonus templates.
NOTE: This method is optional. The PartnerBoard is the most reasonable way to get a list of available bonus templates.
POST https://{S2S_API_URL}/bonuses/templates
A request examples:
An example using firebase/php-jwt and guzzlehttp/guzzle packages:
php
use Firebase\JWT\JWT;
use GuzzleHttp\Client;
$PARTNER_SECRET = 'testdemo';
$payload = [
'cid' => 'fbet',
'page' => 1,
];
$jwtParts = explode('.', JWT::encode($payload, $PARTNER_SECRET, 'HS256'));
$signature = implode('.', [$jwtParts[0], '', $jwtParts[2]]);
// x-sign-jws=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..3siG0YndUOiR7HRecGQMe87nuL3ty_HZhVjhkFPRXbs
echo "x-sign-jws=$signature";
// send the request
$body = json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$url = 'https://{S2S_API_URL}/bonuses/templates';
$client = new Client();
$response = $client->request('POST', $url, [
'body' => $body,
'headers' => [
"Content-type" => "application/json",
"x-sign-jws" => $signature
]
]);
echo $response->getBody()->getContents();The table below describes the parameters:
| Parameter | Type | Description |
|---|---|---|
| cid | string | Partner API Key. |
| page | integer | An optional parameter of the page number (default 1). |
A response examples:
HTTP status code: 200
Example response body:
json
{
"items":[
{
"id":5514,
"name":"Bonus freebet",
"isEnable":true,
"type":"freebet_standart",
"cid":"fbet",
"stage":2,
"fromTime":1707490086,
"toTime":1707491886,
"daysToUse":1,
"disciplines":[
"csgo"
],
"freebetData":{
"minSelection":1,
"maxSelection":2,
"minOdd":1.01,
"maxOdd":3,
"betAmount":5,
"betCount":1,
"maxWin":4,
"currency":"USD",
"maxWinCurrency": "USD"
},
"availableCountries": null,
"availableTournaments": null
}
],
"metadata":{
"totalPages":56,
"totalItems":5514,
"currentPage":1,
"itemsPerPage":100
}
}The table below describes the following parameters:
| Parameter | Type | Description |
|---|---|---|
| items | List of <BonusTemplateItem> | An array of dictionaries that contains information about templates. |
| metadata | <MetaDataItem> | Pagination information. |
The table below describes the BonusTemplateItem:
| Parameter | Type | Description |
|---|---|---|
| id | integer | Unique bonus template identifier assigned by Sportsbook. |
| name | string | Bonus template’s name assigned by the Partner in the Backoffice. |
| isEnable | boolean | Indicator of the template readiness for use when issuing bonuses. |
| type | string | Bonus template type (freebet_standart). |
| cid | string | Partner API Key. |
| stage | integer | Stage of bet: 1 - prematch 2 - live 3 - prematch and live |
| fromTime | integer | Timestamp in Unix Time defines the start date of the template to issue bonuses. |
| toTime | integer | Timestamp in Unix Time defines the end date of the template to issue bonuses. After this time, the player will not be able to use the bonus. |
| daysToUse | integer | The number of days after the bonus activation when the player has to use the bonus. |
| disciplines | array of string | Allowed disciplines in the bonus. |
| freebetData | <TemplateFreebetDataItem> | The dictionary describes the conditions for generating bonuses according to the given template. |
| availableCountries | array of string | Allowed countries ISO 3166-1 alpha-2 in the bonus. |
| availableTournaments | array of string | Allowed tournaments in the bonus. |
The table below describes the TemplateFreebetDataItem:
| Parameter | Type | Description |
|---|---|---|
| minSelection | integer | The minimum number of selections in order or express that a player must add to receive a bonus. |
| maxSelection | integer | The maximum number of selections in order or express that a player must add to receive a bonus. |
| minOdd | float | The minimum odds of each bet selection to use the bonus. |
| maxOdd | float | The maximum odds of each bet selection to use the bonus. |
| betAmount | float | The bet amount of bonuses can be issued per player according to the bonus template. |
| betCount | integer | According to the bonus template, the count of bonuses can be issued per player. |
| maxWin | float | The maximum possible amount of winnings in the currency specified in the maxWinCurrency value. maxWin = (betAmount*coefficient) - betAmount. |
| currency | string | Currency code. |
| maxWinCurrency | string | Currency code for the maxWin value. |
The table below describes the MetaDataItem:
| Parameter | Type | Description |
|---|---|---|
| totalPages | integer | The total number of pages of the query result. |
| totalItems | integer | The total number of items of the query result. |
| currentPage | integer | The number of the current page of the query result. |
| itemsPerPage | integer | The items amount per page. |