---
title: "Create Checkout Session"
method: POST
path: "/payments/create-checkout-session"
tags: ["payments"]
---

# Create Checkout Session

`POST /payments/create-checkout-session`

## Request

- Base URL: `https://api.oxlo.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.oxlo.ai/payments/create-checkout-session`
- Auth: HTTP bearer

Create a Stripe Checkout Session for subscribing to a plan.

This redirects the user to Stripe's hosted payment page where Stripe
handles ALL payment complexity: card input, 3DS/SCA, OTP, validation.

After successful payment, Stripe:
1. Creates the subscription automatically
2. Redirects user back to our success URL
3. Fires checkout.session.completed webhook
4. Our webhook handler activates the subscription in our DB

This is the RECOMMENDED approach for new subscriptions.
For upgrades (Pro → Premium), use /subscribe which modifies the existing sub.

## Request body

- CheckoutRequest: Request to create a Stripe Checkout Session for new subscriptions.
  - `plan` string, required
  - `promo_code` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/oxlo/apis/oxlo-backend.md) - [All operations](https://skmtc.dev/oxlo/apis/oxlo-backend/llms.txt) - [OpenAPI document](https://skmtc.dev/oxlo/apis/oxlo-backend/revisions/bc2ecdc94f31?raw)
