Skip to content

Latest commit

 

History

History
43 lines (38 loc) · 55.8 KB

File metadata and controls

43 lines (38 loc) · 55.8 KB

CheckoutCreate

Create a new checkout session from a list of products. Customers will be able to switch between those products.

Metadata set on the checkout will be copied to the resulting order and/or subscription.

Fields

Field Type Required Description Example
trial_interval OptionalNullable[models.TrialInterval] The interval unit for the trial period.
trial_interval_count OptionalNullable[int] The number of interval units for the trial period.
metadata Dict[str, models.CheckoutCreateMetadata] Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters.
The value must be either:

* A string with a maximum length of 500 characters
* An integer
* A floating-point number
* A boolean

You can store up to 50 key-value pairs.
custom_field_data Dict[str, Nullable[models.CheckoutCreateCustomFieldData]] Key-value object storing custom field values.
discount_id OptionalNullable[str] ID of the discount to apply to the checkout.
allow_discount_codes Optional[bool] Whether to allow the customer to apply discount codes. If you apply a discount through discount_id, it'll still be applied, but the customer won't be able to change it.
require_billing_address Optional[bool] Whether to require the customer to fill their full billing address, instead of just the country. Customers in the US will always be required to fill their full address, regardless of this setting. If you preset the billing address, this setting will be automatically set to true.
amount OptionalNullable[int] N/A
seats OptionalNullable[int] Predefined number of seats (works with seat-based pricing only)
min_seats OptionalNullable[int] Minimum number of seats (works with seat-based pricing only)
max_seats OptionalNullable[int] Maximum number of seats (works with seat-based pricing only)
allow_trial Optional[bool] Whether to enable the trial period for the checkout session. If false, the trial period will be disabled, even if the selected product has a trial configured.
customer_id OptionalNullable[str] ID of an existing customer in the organization. The customer data will be pre-filled in the checkout form. The resulting order will be linked to this customer.
is_business_customer Optional[bool] Whether the customer is a business or an individual. If true, the customer will be required to fill their full billing address and billing name.
external_customer_id OptionalNullable[str] ID of the customer in your system. If a matching customer exists on Polar, the resulting order will be linked to this customer. Otherwise, a new customer will be created with this external ID set.
customer_name OptionalNullable[str] N/A John Doe
customer_email OptionalNullable[str] N/A
customer_ip_address OptionalNullable[str] N/A
customer_billing_name OptionalNullable[str] N/A
customer_billing_address OptionalNullable[models.AddressInput] N/A
customer_tax_id OptionalNullable[str] N/A
customer_metadata Dict[str, models.CheckoutCreateCustomerMetadata] Key-value object allowing you to store additional information that'll be copied to the created customer.

The key must be a string with a maximum length of 40 characters.
The value must be either:

* A string with a maximum length of 500 characters
* An integer
* A floating-point number
* A boolean

You can store up to 50 key-value pairs.
subscription_id OptionalNullable[str] ID of a subscription to upgrade. It must be on a free pricing. If checkout is successful, metadata set on this checkout will be copied to the subscription, and existing keys will be overwritten.
success_url OptionalNullable[str] URL where the customer will be redirected after a successful payment.You can add the checkout_id={CHECKOUT_ID} query parameter to retrieve the checkout session id.
return_url OptionalNullable[str] When set, a back button will be shown in the checkout to return to this URL.
embed_origin OptionalNullable[str] If you plan to embed the checkout session, set this to the Origin of the embedding page. It'll allow the Polar iframe to communicate with the parent page.
locale OptionalNullable[str] N/A en
currency OptionalNullable[models.PresentmentCurrency] N/A
products List[str] ✔️ List of product IDs available to select at that checkout. The first one will be selected by default.
prices Dict[str, List[models.CheckoutCreatePrices]] Optional mapping of product IDs to a list of ad-hoc prices to create for that product. If not set, catalog prices of the product will be used.