Skip to content

Latest commit

 

History

History
92 lines (59 loc) · 4.36 KB

README.md

File metadata and controls

92 lines (59 loc) · 4.36 KB

Checkouts

(checkouts)

Overview

Available Operations

  • create - Create Checkout ⚠️ Deprecated Use create instead.
  • get - Get Checkout ⚠️ Deprecated

create

Create a checkout session.

⚠️ DEPRECATED: This API is deprecated. We recommend you to use the new custom checkout API, which is more flexible and powerful. Please refer to the documentation for more information.. Use create instead.

Example Usage

from polar_sdk import Polar

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

    res = polar.checkouts.create(request={
        "product_price_id": "<value>",
        "success_url": "http://limp-pastry.org",
    })

    # Handle response
    print(res)

Parameters

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

Response

models.CheckoutLegacy

Errors

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

get

Get an active checkout session by ID.

⚠️ DEPRECATED: This API is deprecated. We recommend you to use the new custom checkout API, which is more flexible and powerful. Please refer to the documentation for more information..

Example Usage

from polar_sdk import Polar

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

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

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CheckoutLegacy

Errors

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