(customer_portal.license_keys)
- 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
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.license_keys.list(security=polar_sdk.CustomerPortalLicenseKeysListSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), page=1, limit=10)
while res is not None:
# Handle items
res = res.next()| Parameter | Type | Required | Description |
|---|---|---|---|
security |
models.CustomerPortalLicenseKeysListSecurity | ✔️ | N/A |
benefit_id |
OptionalNullable[str] | ➖ | Filter by a specific benefit |
page |
Optional[int] | ➖ | Page number, defaults to 1. |
limit |
Optional[int] | ➖ | Size of a page, defaults to 10. Maximum is 100. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.CustomerPortalLicenseKeysListResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.Unauthorized | 401 | application/json |
| models.ResourceNotFound | 404 | application/json |
| models.HTTPValidationError | 422 | application/json |
| models.SDKError | 4XX, 5XX | */* |
Get a license key.
Scopes: customer_portal:read customer_portal:write
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.license_keys.get(security=polar_sdk.CustomerPortalLicenseKeysGetSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>")
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
security |
models.CustomerPortalLicenseKeysGetSecurity | ✔️ | N/A |
id |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.LicenseKeyWithActivations
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ResourceNotFound | 404 | application/json |
| models.HTTPValidationError | 422 | application/json |
| models.SDKError | 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.
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.license_keys.validate(request={
"key": "<key>",
"organization_id": "<value>",
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.LicenseKeyValidate | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ResourceNotFound | 404 | application/json |
| models.HTTPValidationError | 422 | application/json |
| models.SDKError | 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.
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.license_keys.activate(request={
"key": "<key>",
"organization_id": "<value>",
"label": "<value>",
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.LicenseKeyActivate | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.LicenseKeyActivationRead
| Error Type | Status Code | Content Type |
|---|---|---|
| models.NotPermitted | 403 | application/json |
| models.ResourceNotFound | 404 | application/json |
| models.HTTPValidationError | 422 | application/json |
| models.SDKError | 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.
from polar_sdk import Polar
with Polar() as polar:
polar.customer_portal.license_keys.deactivate(request={
"key": "<key>",
"organization_id": "<value>",
"activation_id": "<value>",
})
# Use the SDK ...| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.LicenseKeyDeactivate | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ResourceNotFound | 404 | application/json |
| models.HTTPValidationError | 422 | application/json |
| models.SDKError | 4XX, 5XX | */* |