Create Checkout Session
Create a checkout session.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Create a new checkout session from a product.
Metadata set on the checkout will be copied to the resulting order and/or subscription.
ID of the product to checkout. First available price will be selected.
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 boolean
You can store up to 50 key-value pairs.
Key-value object storing custom field values.
ID of the discount to apply to the checkout.
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.
Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices.
50 < x < 99999999
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.
Name of the customer.
Email address of the customer.
Billing address of the customer.
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 boolean
You can store up to 50 key-value pairs.
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.
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.
1 - 2083
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.
Response
Checkout session data retrieved using an access token.
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Payment processor used.
stripe
Status of the checkout session.
open
, expired
, confirmed
, succeeded
, failed
Client secret used to update and complete the checkout session from the client.
URL where the customer can access the checkout session.
Expiration date and time of the checkout session.
URL where the customer will be redirected after a successful payment.
When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page.
Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices.
50 < x < 99999999
Computed tax amount to pay in cents.
Currency code of the checkout session.
Subtotal amount in cents, including discounts and before tax.
Total amount to pay in cents, including discounts and after tax.
ID of the product to checkout.
ID of the product price to checkout.
ID of the discount applied to the checkout.
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.
Whether the discount is applicable to the checkout. Typically, free and custom prices are not discountable.
Whether the product price is free, regardless of discounts.
Whether the checkout requires payment, e.g. in case of free products or discounts that cover the total amount.
Whether the checkout requires setting up a payment method, regardless of the amount, e.g. subscriptions that have first free cycles.
Whether the checkout requires a payment form, whether because of a payment or payment method setup.
Name of the customer.
Email address of the customer.
Billing address of the customer.
Product data for a checkout session.
A recurring price for a product, i.e. a subscription.
Schema for a fixed amount discount that is applied once or forever.
Key-value object storing custom field values.
Was this page helpful?