(customer_portal.benefit_grants)
- list - List Benefit Grants
- get - Get Benefit Grant
- update - Update Benefit Grant
List benefits grants of the authenticated customer or user.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.customer_portal.benefit_grants.list()
while res is not None:
# Handle items
res = res.next()
models.CustomerPortalBenefitGrantsListResponse
Error Type |
Status Code |
Content Type |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Get a benefit grant by ID for the authenticated customer or user.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.customer_portal.benefit_grants.get(id="<value>")
# Handle response
print(res)
Parameter |
Type |
Required |
Description |
id |
str |
✔️ |
The benefit grant ID. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.CustomerBenefitGrant
Error Type |
Status Code |
Content Type |
models.ResourceNotFound |
404 |
application/json |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Update a benefit grant for the authenticated customer or user.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.customer_portal.benefit_grants.update(id="<value>", customer_benefit_grant_update={
"benefit_type": "license_keys",
})
# Handle response
print(res)
models.CustomerBenefitGrant
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 |
*/* |