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

# Create Checkout Session

Create a Stripe Checkout session for a customer to subscribe to a plan. Returns a `client_secret` that you pass to Stripe's embedded checkout component.

**Auth:** `pk_` (publishable key) or `sk_` (secret key).

<ParamField body="customer_id" type="string" required>
  External customer ID. The customer must already exist.
</ParamField>

<ParamField body="plan_code" type="string" required>
  The plan code to subscribe the customer to (e.g. `pro`).
</ParamField>

<ParamField body="success_url" type="string">
  URL to redirect the customer to after successful checkout. Defaults to your configured redirect URL.
</ParamField>

### Response

<ResponseField name="client_secret" type="string" required>
  Stripe Checkout Session client secret. Pass this to `stripe.initEmbeddedCheckout()`.
</ResponseField>

<ResponseField name="invoice_id" type="string">
  The Lago invoice ID associated with this checkout.
</ResponseField>

<ResponseField name="amount_cents" type="number">
  Total amount in cents.
</ResponseField>

<ResponseField name="currency" type="string">
  ISO 4217 currency code.
</ResponseField>
