Skip to content

Revoke batch bonuses

This method revokes bonuses from players. If the bonus were successfully revoked, it would return a list of players’ bonus items. In case of an error, it will return a list of error bonus items.

NOTE: This method is optional. The PartnerBoard is the most reasonable way to revokes bonuses from players.

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

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',
    "bonusesIds" => [
        20
    ]
];

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

// x-sign-jws=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..dHeSv09pyg1TZOhAbrNobciONz2-rfUuoDojV-wrOJQ
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/revokeBatch';

$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.
bonusesIdsList of integerAn array of unique bonus identifiers assigned by Sportsbook. 

A response examples:

HTTP status code: 200

json
{
  "items":{
    "1243":{
      "id":1243,
      "templateId":359,
      "name":"Bonus freebet",
      "type":"freebet_standart",
      "userId":"6",
      "cid":"fbet",
      "stage":3,
      "disciplines":[
        "csgo"
      ],
      "activationDate":1707749397,
      "endingDate":null,
      "status":"revoked",
      "fromTime":1707609600,
      "toTime":1708041600,
      "freebetData":{
        "betAmount":5,
        "betCount":4,
        "availableBetCount":4,
        "maxWin":100,
        "currency":"USD",
        "minSelection":1,
        "maxSelection":2,
        "minOdd":1,
        "maxOdd":5
      },
      "availableCountries": null,
      "availableTournaments": null
    }
  },
  "errorItems":[]
}