(licenseKeys)
- get - Get License Key
- getActivation - Get Activation
- list - List License Keys
- update - Update License Key
Get a license key.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->licenseKeys->get(
id: '<value>'
);
if ($response->licenseKeyWithActivations !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
?Operations\LicenseKeysGetResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\Unauthorized | 401 | application/json |
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get a license key activation.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->licenseKeys->getActivation(
id: '<value>',
activationId: '<value>'
);
if ($response->licenseKeyActivationRead !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
activationId |
string | ✔️ | N/A |
?Operations\LicenseKeysGetActivationResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\Unauthorized | 401 | application/json |
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get license keys connected to the given organization & filters.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$responses = $sdk->licenseKeys->list(
page: 1,
limit: 10,
organizationId: [
'<value>',
],
benefitId: [
'<value>',
]
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
page |
?int | ➖ | Page number, defaults to 1. |
limit |
?int | ➖ | Size of a page, defaults to 10. Maximum is 100. |
organizationId |
string|array|null | ➖ | Filter by organization ID. |
benefitId |
string|array|null | ➖ | Filter by benefit ID. |
?Operations\LicenseKeysListResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\Unauthorized | 401 | application/json |
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Update a license key.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$licenseKeyUpdate = new Components\LicenseKeyUpdate();
$response = $sdk->licenseKeys->update(
id: '<value>',
licenseKeyUpdate: $licenseKeyUpdate
);
if ($response->licenseKeyRead !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
licenseKeyUpdate |
Components\LicenseKeyUpdate | ✔️ | N/A |
?Operations\LicenseKeysUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\Unauthorized | 401 | application/json |
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |