(checkout_links)
- list - List Checkout Links
- create - Create Checkout Link
- get - Get Checkout Link
- update - Update Checkout Link
- delete - Delete Checkout Link
List checkout links.
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
models.CheckoutLinksListResponse
Error Type |
Status Code |
Content Type |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Create a checkout link.
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
models.CheckoutLink
Error Type |
Status Code |
Content Type |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Get a checkout link by ID.
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
Parameter |
Type |
Required |
Description |
id |
str |
✔️ |
The checkout link ID. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.CheckoutLink
Error Type |
Status Code |
Content Type |
models.ResourceNotFound |
404 |
application/json |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Update a checkout link.
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
models.CheckoutLink
Error Type |
Status Code |
Content Type |
models.ResourceNotFound |
404 |
application/json |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Delete a checkout link.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as s:
s.checkout_links.delete(id="<value>")
# Use the SDK ...
Parameter |
Type |
Required |
Description |
id |
str |
✔️ |
The checkout link ID. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Error Type |
Status Code |
Content Type |
models.ResourceNotFound |
404 |
application/json |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |