> ## Documentation Index
> Fetch the complete documentation index at: https://polar.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkout

> Checkout Links vs. Checkout Sessions, and what a completed checkout creates.

**Checkout** is where a customer picks a product, enters their payment and billing details, and pays. Polar hosts the checkout page, calculates tax for the customer's location, and handles the payment.

Every purchase goes through a **checkout session**: a short-lived object holding one purchase attempt. There are two ways to create one.

## Checkout Links and Checkout Sessions

| | Checkout Link | Checkout Session |
| - | - | - |
| **Created** | Once, in the dashboard or API | Per purchase, from your backend |
| **Lifetime** | Permanent URL you can share anywhere | Expires if not completed |
| **Code needed** | None | An API call |
| **Best for** | Websites, emails, social posts | Signed-in users, per-customer data |

A Checkout Link is a reusable URL that creates a fresh checkout session each time someone opens it. Always share the link, never the session URL behind it.

Create a Checkout Session yourself when you know who the customer is. Pass their `external_customer_id`, prefill their email, or attach metadata, then redirect them to the session's `url`.

You can offer several products in one checkout. The customer picks one of them; products aren't bundled into a single order.

## What a checkout creates

```mermaid theme={null}
flowchart LR
  CS[Checkout session] -->|succeeded| C[Customer]
  CS --> O[Order]
  CS -->|recurring product| S[Subscription]
  O --> G[Benefit grants]
  S --> G
```

When the checkout succeeds, Polar:

1. Finds or creates the [customer](https://polar.sh/docs/concepts/customers.md).
2. Creates an [order](https://polar.sh/docs/concepts/orders-and-subscriptions.md) for the payment.
3. Creates a subscription, if the product is recurring.
4. Grants the product's [benefits](https://polar.sh/docs/concepts/benefits.md).

A session moves through the statuses `open`, `confirmed`, and then `succeeded` or `failed`. Sessions that are never completed become `expired`. The dashboard lists every session with its status (**Open**, **Confirmed**, **Succeeded**, **Failed**, **Expired**) under **Sales → Checkouts**.

## Customizing checkout

* **Discounts** can be preset on a link or session, or entered by the customer as a code. See [Discounts](https://polar.sh/docs/features/discounts.md).
* **Custom fields** collect extra information, like a company name or a terms checkbox. See [Custom fields](https://polar.sh/docs/features/custom-fields.md).
* **Ad-hoc prices** set a price for a single session without changing your catalog. See [Ad-hoc prices](https://polar.sh/docs/features/checkout/session.md#ad-hoc-prices).
* **Embedded checkout** opens the checkout on your own site instead of redirecting. See [Embedded checkout](https://polar.sh/docs/features/checkout/embed.md).

## In the dashboard, CLI or your agent

Checkout Sessions are created from your backend with the SDK or API. Checkout Links and the list of sessions also work from the dashboard, the CLI or your agent:

| Task | Dashboard | CLI | MCP operation |
| - | - | - | - |
| Create a Checkout Link | **Products → Checkout Links** | `polar checkout_links create` | `checkout_links_create` |
| List checkout sessions | **Sales → Checkouts** | `polar checkouts list` | `checkouts_list` |

## Learn more

| Resource | Description |
| - | - |
| [Checkout Links](https://polar.sh/docs/features/checkout/links.md) | Create and share no-code checkout URLs |
| [Checkout API](https://polar.sh/docs/features/checkout/session.md) | Create checkout sessions from your backend |
| [Payment methods](https://polar.sh/docs/features/checkout/payment-methods.md) | Payment methods available at checkout |
| [Create Checkout Session API](https://polar.sh/docs/api-reference/current/checkouts/create-checkout-session.md) | API reference |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.