Skip to main content
GET
/
v1
/
license-keys
PHP (SDK)
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',
    page: 1,
    limit: 10

);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}
{
  "items": [
    {
      "id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "modified_at": "2023-11-07T05:31:56Z",
      "organization_id": "<string>",
      "customer_id": "<string>",
      "customer": {
        "id": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "modified_at": "2023-11-07T05:31:56Z",
        "metadata": {},
        "email_verified": true,
        "name": "John Doe",
        "billing_address": {
          "line1": "<string>",
          "line2": "<string>",
          "postal_code": "<string>",
          "city": "<string>",
          "state": "<string>"
        },
        "tax_id": {
          "[0]": "<string>"
        },
        "organization_id": "<string>",
        "deleted_at": "2023-11-07T05:31:56Z",
        "avatar_url": "<string>",
        "external_id": "usr_1337",
        "email": "customer@example.com",
        "locale": "<string>",
        "default_payment_method_id": "<string>"
      },
      "benefit_id": "<string>",
      "key": "<string>",
      "display_key": "<string>",
      "limit_activations": 123,
      "usage": 123,
      "limit_usage": 123,
      "validations": 123,
      "last_validated_at": "2023-11-07T05:31:56Z",
      "expires_at": "2023-11-07T05:31:56Z"
    }
  ],
  "pagination": {
    "total_count": 123,
    "max_page": 123
  }
}

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Query Parameters

organization_id

Filter by organization ID. The organization ID.

Example:

"1dbfc517-0bbf-4301-9ba8-555ca42b9737"

benefit_id

Filter by benefit ID. The benefit ID.

status

Filter by license key status.

Available options:
granted,
revoked,
disabled
page
integer
default:1

Page number, defaults to 1.

limit
integer
default:10

Size of a page, defaults to 10. Maximum is 100.

Response

Successful Response

items
LicenseKeyRead · object[]
required
pagination
Pagination · object
required