Skip to content

Latest commit

 

History

History
236 lines (158 loc) · 8.97 KB

README.md

File metadata and controls

236 lines (158 loc) · 8.97 KB

LicenseKeys

(licenseKeys)

Overview

Available Operations

list

Get license keys connected to the given organization & filters.

Scopes: license_keys:read license_keys:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

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



$responses = $sdk->licenseKeys->list(
    organizationId: [
        '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
    ],
    benefitId: [
        '<value>',
    ],
    page: 1,
    limit: 10

);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
organizationId string|array|null Filter by organization ID.
benefitId string|array|null Filter by benefit ID.
page ?int Page number, defaults to 1.
limit ?int Size of a page, defaults to 10. Maximum is 100.

Response

?Operations\LicenseKeysListResponse

Errors

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

Get a license key.

Scopes: license_keys:read license_keys:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

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



$response = $sdk->licenseKeys->get(
    id: '<value>'
);

if ($response->licenseKeyWithActivations !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ N/A

Response

?Operations\LicenseKeysGetResponse

Errors

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

Update a license key.

Scopes: license_keys:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Components;

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

$licenseKeyUpdate = new Components\LicenseKeyUpdate();

$response = $sdk->licenseKeys->update(
    id: '<value>',
    licenseKeyUpdate: $licenseKeyUpdate

);

if ($response->licenseKeyRead !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ N/A
licenseKeyUpdate Components\LicenseKeyUpdate ✔️ N/A

Response

?Operations\LicenseKeysUpdateResponse

Errors

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 */*

getActivation

Get a license key activation.

Scopes: license_keys:read license_keys:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

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



$response = $sdk->licenseKeys->getActivation(
    id: '<value>',
    activationId: '<value>'

);

if ($response->licenseKeyActivationRead !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ N/A
activationId string ✔️ N/A

Response

?Operations\LicenseKeysGetActivationResponse

Errors

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 */*