Appearance
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:
| Parameter | Type | Description |
|---|---|---|
| cid | string | Partner API Key. |
| userId | string | The unique player’s identifier assigned by the Partner. |
| page | integer | Optional 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:
| Parameter | Type | Description |
|---|---|---|
| items | List of <PlayerBonusItem> | An array of dictionaries containing information about bonuses. |
| metadata | <MetaDataItem> | Pagination information. |
The table below describes the PlayerBonusItem:
| Parameter | Type | Description |
|---|---|---|
| id | integer | Unique bonus identifier assigned by Sportsbook. |
| templateId | integer | A unique bonus template identifier assigned by Sportsbook. |
| name | string | A bonus template’s name assigned by the Partner in the Backoffice. |
| type | string | A bonus template type (freebet_standart). |
| userId | string | A unique player identifier assigned by the Partner. |
| cid | string | Partner API Key. |
| stage | integer | Stage of the bet: 1. prematch 2. live 3. prematch and live |
| disciplines | array of string | List of allowed disciplines in the bonus. |
| activationDate | integer or null | Timestamp in Unix Time indicating the date when the player activated the bonus. |
| endingDate | integer or null | Timestamp in Unix Time that indicates the date after which the activated bonus will expire. |
| status | string | New: 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. |
| fromTime | integer | A timestamp in Unix Time, indicating the time after which the player can activate the bonus. |
| toTime | integer | A 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. |
| availableCountries | array of string | List of allowed countries ISO 3166-1 alpha-2 in the bonus. |
| availableTournaments | array of string | List of allowed tournaments in the bonus. |
The table below describes the BonusFreebetDataItem:
| Parameter | Type | Description |
|---|---|---|
| betAmount | float | The amount of the Freebet, which will be given to the player. |
| betCount | integer | The total number of bonuses issued per player. |
| availableBetCount | integer | The number of bonuses issued per player. |
| maxWin | float | The maximum possible win amount in the dollar equivalent. maxWin = (betAmount*coefficient) - betAmount. |
| currency | string | Currency code. |
| minSelection | integer | The minimum number of selections in order or express that a player must add to apply for a bonus. |
| maxSelection | integer | The maximum number of selections in order or express that a player must add to apply for a bonus. |
| minOdd | float | The minimum odds of each selection to use the bonus. |
| maxOdd | float | The maximum odds of each selection to use the bonus. |
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. |