Skip to content

Bonus

This method gets certain bonus information using the bonus ID.

NOTE: This method is optional. The PartnerBoard is the most reasonable way to gets certain bonus information using the bonus ID.

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

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',
    'bonusId' => 1,
];

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

// x-sign-jws=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..srahalBpaMslp6utKqEKxzeBUBwOduMDCs6BujxIyTs
echo "x-sign-jws=$signature";

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

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

$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. bonusId integer Unique bonus identifier assigned by the Partner.

ParameterTypeDescription
cidstringPartner API Key.
bonusIdintegerUnique bonus identifier assigned by the Partner.

A response examples:

HTTP status code: 200

json
{
  "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":"new",
  "fromTime":1607558400,
  "toTime":1639094400,
  "freebetData":{
    "betAmount": 5,
    "betCount": 1,
    "availableBetCount": 1,
    "maxWin": 4,
    "currency": "USD",
    "minSelection": 1,
    "maxSelection": 2,
    "minOdd": 1,
    "maxOdd": 3
  },
  "availableCountries": null,
  "availableTournaments": null
}