Skip to content

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:

ParameterTypeDescription
cidstringPartner API Key.
pageintegerAn 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:

ParameterTypeDescription
itemsList of <BonusTemplateItem>An array of dictionaries that contains information about templates.
metadata<MetaDataItem>Pagination information.

The table below describes the BonusTemplateItem:

ParameterTypeDescription
idintegerUnique bonus template identifier assigned by Sportsbook.
namestringBonus template’s name assigned by the Partner in the Backoffice.
isEnablebooleanIndicator of the template readiness for use when issuing bonuses.
typestringBonus template type (freebet_standart).
cidstringPartner API Key.
stageintegerStage of bet:
1 - prematch
2 - live
3 - prematch and live
fromTimeintegerTimestamp in Unix Time defines the start date of the template to issue bonuses.
toTimeintegerTimestamp 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.
daysToUseintegerThe number of days after the bonus activation when the player has to use the bonus.
disciplinesarray of stringAllowed disciplines in the bonus.
freebetData<TemplateFreebetDataItem>The dictionary describes the conditions for generating bonuses according to the given template.
availableCountriesarray of stringAllowed countries ISO 3166-1 alpha-2 in the bonus.
availableTournamentsarray of stringAllowed tournaments in the bonus.

The table below describes the TemplateFreebetDataItem:

ParameterTypeDescription
minSelectionintegerThe minimum number of selections in order or express that a player must add to receive a bonus.
maxSelectionintegerThe maximum number of selections in order or express that a player must add to receive a bonus.
minOddfloatThe minimum odds of each bet selection to use the bonus.
maxOddfloatThe maximum odds of each bet selection to use the bonus.
betAmountfloatThe bet amount of bonuses can be issued per player according to the bonus template.
betCountintegerAccording to the bonus template, the count of bonuses can be issued per player.
maxWinfloatThe maximum possible amount of winnings in the currency specified in the maxWinCurrency value. maxWin = (betAmount*coefficient) - betAmount.
currencystringCurrency code. 
maxWinCurrencystringCurrency code for the maxWin value.

The table below describes the MetaDataItem:

ParameterTypeDescription
totalPagesintegerThe total number of pages of the query result.
totalItemsintegerThe total number of items of the query result.
currentPageintegerThe number of the current page of the query result.
itemsPerPageintegerThe items amount per page.