Skip to content

Latest commit

 

History

History
298 lines (195 loc) · 18.9 KB

README.md

File metadata and controls

298 lines (195 loc) · 18.9 KB

Custom

(checkouts.custom)

Overview

Available Operations

list

List checkout sessions.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.checkouts.custom.list()

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description
organization_id OptionalNullable[models.CheckoutsCustomListQueryParamOrganizationIDFilter] Filter by organization ID.
product_id OptionalNullable[models.CheckoutsCustomListQueryParamProductIDFilter] Filter by product 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.CheckoutSortProperty] 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.CheckoutsCustomListResponse

Errors

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

create

Create a checkout session.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.checkouts.custom.create(request={
        "product_id": "<value>",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request models.CheckoutCreate ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.Checkout

Errors

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

get

Get a checkout session by ID.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.checkouts.custom.get(id="<value>")

    # Handle response
    print(res)

Parameters

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

Response

models.Checkout

Errors

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

update

Update a checkout session.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.checkouts.custom.update(id="<value>", checkout_update={})

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The checkout session ID.
checkout_update models.CheckoutUpdate ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.Checkout

Errors

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

client_get

Get a checkout session by client secret.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.checkouts.custom.client_get(client_secret="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
client_secret str ✔️ The checkout session client secret.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CheckoutPublic

Errors

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

client_update

Update a checkout session by client secret.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.checkouts.custom.client_update(client_secret="<value>", checkout_update_public={})

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
client_secret str ✔️ The checkout session client secret.
checkout_update_public models.CheckoutUpdatePublic ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CheckoutPublic

Errors

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

client_confirm

Confirm a checkout session by client secret.

Orders and subscriptions will be processed.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.checkouts.custom.client_confirm(client_secret="<value>", checkout_confirm_stripe={})

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
client_secret str ✔️ The checkout session client secret.
checkout_confirm_stripe models.CheckoutConfirmStripe ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CheckoutPublicConfirmed

Errors

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