Skip to content

Latest commit

 

History

History
212 lines (145 loc) · 14.3 KB

README.md

File metadata and controls

212 lines (145 loc) · 14.3 KB

CheckoutLinks

(checkout_links)

Overview

Available Operations

  • list - List Checkout Links
  • create - Create Checkout Link
  • get - Get Checkout Link
  • update - Update Checkout Link
  • delete - Delete Checkout Link

list

List checkout links.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
    res = s.checkout_links.list()

    if res is not None:
        while True:
            # handle items

            res = res.next()
            if res is None:
                break

Parameters

Parameter Type Required Description
organization_id OptionalNullable[models.CheckoutLinksListQueryParamOrganizationIDFilter] Filter by organization ID.
product_id OptionalNullable[models.CheckoutLinksListQueryParamProductIDFilter] 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.CheckoutLinkSortProperty] 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.CheckoutLinksListResponse

Errors

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

create

Create a checkout link.

Example Usage

import polar_sdk
from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
    res = s.checkout_links.create(request={
        "product_id": "<value>",
        "payment_processor": polar_sdk.CheckoutLinkProductCreatePaymentProcessor.STRIPE,
    })

    if res is not None:
        # handle response
        pass

Parameters

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

Response

models.CheckoutLink

Errors

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

get

Get a checkout link by ID.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
    res = s.checkout_links.get(id="<value>")

    if res is not None:
        # handle response
        pass

Parameters

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

Response

models.CheckoutLink

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 link.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
    res = s.checkout_links.update(id="<value>", checkout_link_update={})

    if res is not None:
        # handle response
        pass

Parameters

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

Response

models.CheckoutLink

Errors

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

delete

Delete a checkout link.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
    s.checkout_links.delete(id="<value>")

    # Use the SDK ...

Parameters

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

Errors

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