POST
/
v1
/
benefits
/
PHP (SDK)
declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Components;

$sdk = Polar\Polar::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$request = new Components\BenefitLicenseKeysCreate(
    description: 'mature emergent at outside arrogantly gadzooks zealous equatorial notwithstanding',
    properties: new Components\BenefitLicenseKeysCreateProperties(),
);

$response = $sdk->benefits->create(
    request: $request
);

if ($response->benefit !== null) {
    // handle response
}
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "type": "<string>",
  "description": "<string>",
  "selectable": true,
  "deletable": true,
  "organization_id": "<string>",
  "metadata": {},
  "properties": {
    "note": "<string>"
  }
}

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Body

application/json

Schema to create a benefit of type custom.

Response

201
application/json

Benefit created.

A benefit of type custom.

Use it to grant any kind of benefit that doesn't fit in the other types.