class

Polar::Api::CustomerPortal::LicenseKeys

Inherits Reference < Object

API client for license_keys operations in customer_portal context

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new LicenseKeys instance

@param client [Client] The Polar API client instance

Source

Instance methods

Activate License Key

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/activate endpoint instead.

Endpoint: POST /v1/customer-portal/license-keys/activate

Parameters:

  • body (required): Request body as Polar::Models::LicenseKeyActivate

Returns: Polar::Models::LicenseKeyActivationRead

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Deactivate License Key

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/deactivate endpoint instead.

Endpoint: POST /v1/customer-portal/license-keys/deactivate

Parameters:

  • body (required): Request body as Polar::Models::LicenseKeyDeactivate

Returns: JSON response string

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Get License Key

Get a license key.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/license-keys/{id}

Parameters:

  • id (required): Path parameter

Returns: Polar::Models::LicenseKeyWithActivations

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list(benefit_id : String | Nil = nil, page : Int32 | Nil = nil, limit : Int32 | Nil = nil) : Polar::Models::ListResource(Polar::Models::LicenseKeyRead)

List License Keys

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/license-keys/

Parameters:

  • benefit_id (optional): Filter by a specific benefit
  • page (optional): Page number, defaults to 1.
  • limit (optional): Size of a page, defaults to 10. Maximum is 100.

Returns: Polar::Models::ListResource(Polar::Models::LicenseKeyRead)

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Validate License Key

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/validate endpoint instead.

Endpoint: POST /v1/customer-portal/license-keys/validate

Parameters:

  • body (required): Request body as Polar::Models::LicenseKeyValidate

Returns: Polar::Models::ValidatedLicenseKey

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source