(customerPortal->licenseKeys)
- activate - Activate License Key
- deactivate - Deactivate License Key
- get - Get License Key
- list - List License Keys
- validate - Validate License Key
Activate a license key instance.
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();
$request = new Components\LicenseKeyActivate(
key: '<key>',
organizationId: '<value>',
label: '<value>',
);
$response = $sdk->customerPortal->licenseKeys->activate(
request: $request
);
if ($response->licenseKeyActivationRead !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Components\LicenseKeyActivate | ✔️ | The request object to use for the request. |
?Operations\CustomerPortalLicenseKeysActivateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\NotPermitted | 403 | application/json |
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Deactivate a license key instance.
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();
$request = new Components\LicenseKeyDeactivate(
key: '<key>',
organizationId: '<value>',
activationId: '<value>',
);
$response = $sdk->customerPortal->licenseKeys->deactivate(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Components\LicenseKeyDeactivate | ✔️ | The request object to use for the request. |
?Operations\CustomerPortalLicenseKeysDeactivateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
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->customerPortal->licenseKeys->get(
id: '<value>'
);
if ($response->licenseKeyWithActivations !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
?Operations\CustomerPortalLicenseKeysGetResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
List License Keys
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$responses = $sdk->customerPortal->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 | ➖ | Filter by a specific benefit |
?Operations\CustomerPortalLicenseKeysListResponse
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 | */* |
Validate 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();
$request = new Components\LicenseKeyValidate(
key: '<key>',
organizationId: '<value>',
);
$response = $sdk->customerPortal->licenseKeys->validate(
request: $request
);
if ($response->validatedLicenseKey !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Components\LicenseKeyValidate | ✔️ | The request object to use for the request. |
?Operations\CustomerPortalLicenseKeysValidateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |