Skip to content

Player bonuses

This method gets a list of bonuses of a particular user.

NOTE: This method is optional. The PartnerBoard is the most reasonable way to gets a list of bonuses of a particular user.

POST https://{S2S_API_URL}/bonuses/player/bonuses

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',
    'userId' => "3",
    "page" => 1,
];

$jwtParts = explode('.', JWT::encode($payload, $PARTNER_SECRET, 'HS256'));
$signature = implode('.', [$jwtParts[0], '', $jwtParts[2]]);

// x-sign-jws=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..E27-Bh7n58TVnU72qCjH-tIvRnd3Hh36nHcpiAsBr6E
echo "x-sign-jws=$signature";

// send the request
$body = json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);

$url = 'https://{S2S_API_URL}/bonuses/player/bonuses';

$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 following parameters:

ParameterTypeDescription
cidstringPartner API Key.
userIdstringThe unique player’s identifier assigned by the Partner.
pageintegerOptional parameter of the page number (default 1).

A response examples:

HTTP status code: 200

json
{
  "items":[
    {
      "id":1,
      "templateId":1,
      "name":"Bonus freebet",
      "type":"freebet_standart",
      "userId":"96d9d186-e9cc-4e2a-92c4-c459b43a7d3a",
      "cid":"fbet",
      "stage":2,
      "disciplines":[
        "csgo"
      ],
      "activationDate":1608809654,
      "endingDate":1608896054,
      "status":"revoked",
      "fromTime":1607558400,
      "toTime":1639094400,
      "freebetData":{
        "betAmount":0,
        "betCount":0,
        "availableBetCount":0,
        "maxWin":0,
        "currency":"USD",
        "minSelection":0,
        "maxSelection":0,
        "minOdd":0,
        "maxOdd":0
      },
      "availableCountries": null,
      "availableTournaments": null
    }
  ],
  "metadata":{
    "totalPages":1,
    "totalItems":1,
    "currentPage":1,
    "itemsPerPage":100
  }
}

The table below describes the following parameters:

ParameterTypeDescription
itemsList of <PlayerBonusItem>An array of dictionaries containing information about bonuses.
metadata<MetaDataItem>Pagination information.

The table below describes the PlayerBonusItem:

ParameterTypeDescription
idintegerUnique bonus identifier assigned by Sportsbook.
templateIdintegerA unique bonus template identifier assigned by Sportsbook.
namestringA bonus template’s name assigned by the Partner in the Backoffice.
typestringA bonus template type (freebet_standart).
userIdstringA unique player identifier assigned by the Partner.
cidstringPartner API Key.
stageintegerStage of the bet:
1. prematch
2. live
3. prematch and live
disciplinesarray of stringList of allowed disciplines in the bonus.
activationDateinteger or nullTimestamp in Unix Time indicating the date when the player activated the bonus.
endingDateinteger or nullTimestamp in Unix Time that indicates the date after which the activated bonus will expire.
statusstringNew: status after applying of butch bonuses (without forceActivated=true)  
Active: bonus is active for usage (activated after applying package bonuses with forceActivated=true)
Activated: a player used a bonus once.
Expired: the player has not used the bonus until the endingDate or time (toTime).
Revoked: bonus was revoked after the revoke batch.
Done: a player used the whole amount of bets.
fromTimeintegerA timestamp in Unix Time, indicating the time after which the player can activate the bonus.
toTimeintegerA timestamp in Unix Time, indicating the time after which the player loses the ability to activate the bonus.
freebetData<BonusFreebetDataItem>The dictionary describes the Freebet terms.
availableCountriesarray of stringList of allowed countries ISO 3166-1 alpha-2 in the bonus.
availableTournamentsarray of stringList of allowed tournaments in the bonus.

The table below describes the BonusFreebetDataItem:

ParameterTypeDescription
betAmountfloatThe amount of the Freebet, which will be given to the player.
betCountintegerThe total number of bonuses issued per player.
availableBetCountintegerThe number of bonuses issued per player.
maxWinfloatThe maximum possible win amount in the dollar equivalent.
maxWin = (betAmount*coefficient) - betAmount.
currencystringCurrency code. 
minSelectionintegerThe minimum number of selections in order or express that a player must add to apply for a bonus.
maxSelectionintegerThe maximum number of selections in order or express that a player must add to apply for a bonus.
minOddfloatThe minimum odds of each selection to use the bonus.
maxOddfloatThe maximum odds of each selection to use the bonus.

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.