(users.license_keys)
List License Keys
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
res = s.users.license_keys.list()
if res is not None:
while True:
# handle items
res = res.next()
if res is None:
break
models.UsersLicenseKeysListResponse
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.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
res = s.users.license_keys.get(id="<value>")
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
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.Unauthorized |
401 |
application/json |
models.ResourceNotFound |
404 |
application/json |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Validate a license key.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
res = s.users.license_keys.validate(request={
"key": "<key>",
"organization_id": "<value>",
})
if res is not None:
# handle response
pass
models.ValidatedLicenseKey
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.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
res = s.users.license_keys.activate(request={
"key": "<key>",
"organization_id": "<value>",
"label": "<value>",
})
if res is not None:
# handle response
pass
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.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
s.users.license_keys.deactivate(request={
"key": "<key>",
"organization_id": "<value>",
"activation_id": "<value>",
})
# Use the SDK ...
Error Type |
Status Code |
Content Type |
models.ResourceNotFound |
404 |
application/json |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |