Skip to content

Latest commit

 

History

History
140 lines (94 loc) · 13.6 KB

README.md

File metadata and controls

140 lines (94 loc) · 13.6 KB

BenefitGrants

(customer_portal.benefit_grants)

Overview

Available Operations

  • list - List Benefit Grants
  • get - Get Benefit Grant
  • update - Update Benefit Grant

list

List benefits grants of the authenticated customer or user.

Example Usage

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()

Parameters

Parameter Type Required Description
type_filter OptionalNullable[models.QueryParamBenefitTypeFilter] Filter by benefit type.
benefit_id OptionalNullable[models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter] Filter by benefit ID.
organization_id OptionalNullable[models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter] Filter by organization ID.
checkout_id OptionalNullable[models.CheckoutIDFilter] Filter by checkout ID.
order_id OptionalNullable[models.OrderIDFilter] Filter by order ID.
subscription_id OptionalNullable[models.SubscriptionIDFilter] Filter by subscription ID.
page Optional[int] Page number, defaults to 1.
limit Optional[int] Size of a page, defaults to 10. Maximum is 100.
sorting List[models.CustomerBenefitGrantSortProperty] Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CustomerPortalBenefitGrantsListResponse

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*

get

Get a benefit grant by ID for the authenticated customer or user.

Example Usage

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)

Parameters

Parameter Type Required Description
id str ✔️ The benefit grant ID.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CustomerBenefitGrant

Errors

Error Type Status Code Content Type
models.ResourceNotFound 404 application/json
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*

update

Update a benefit grant for the authenticated customer or user.

Example Usage

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)

Parameters

Parameter Type Required Description
id str ✔️ The benefit grant ID.
customer_benefit_grant_update models.CustomerBenefitGrantUpdate ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CustomerBenefitGrant

Errors

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 */*