- list - List License Keys
- get - Get License Key
- validate - Validate License Key
- activate - Activate License Key
- deactivate - Deactivate License Key
Scopes: customer_portal:read customer_portal:write
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Operations;
$sdk = Polar\Polar::builder()->build();
$requestSecurity = new Operations\CustomerPortalLicenseKeysListSecurity(
customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);
$responses = $sdk->customerPortal->licenseKeys->list(
security: $requestSecurity,
page: 1,
limit: 10
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
security |
Operations\CustomerPortalLicenseKeysListSecurity | ✔️ | The security requirements to use for the request. |
benefitId |
?string | ➖ | Filter by a specific benefit |
page |
?int | ➖ | Page number, defaults to 1. |
limit |
?int | ➖ | Size of a page, defaults to 10. Maximum is 100. |
?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 | */* |
Get a license key.
Scopes: customer_portal:read customer_portal:write
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Operations;
$sdk = Polar\Polar::builder()->build();
$requestSecurity = new Operations\CustomerPortalLicenseKeysGetSecurity(
customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);
$response = $sdk->customerPortal->licenseKeys->get(
security: $requestSecurity,
id: '<value>'
);
if ($response->licenseKeyWithActivations !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
security |
Operations\CustomerPortalLicenseKeysGetSecurity | ✔️ | The security requirements to use for the request. |
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 | */* |
Validate a license key.
This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the
/v1/license-keys/validateendpoint instead.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()->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 | */* |
Activate a license key instance.
This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the
/v1/license-keys/activateendpoint instead.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()->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.
This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the
/v1/license-keys/deactivateendpoint instead.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()->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 | */* |