Skip to content

Latest commit

 

History

History
220 lines (142 loc) · 8.75 KB

README.md

File metadata and controls

220 lines (142 loc) · 8.75 KB

LicenseKeys

(licenseKeys)

Overview

Available Operations

get

Get a license key.

Example Usage

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
}

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

getActivation

Get a license key activation.

Example Usage

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
}

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

list

Get license keys connected to the given organization & filters.

Example Usage

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
    }
}

Parameters

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.

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

update

Update a license key.

Example Usage

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
}

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