---
title: "Create Checkout Session"
method: POST
path: "/api/v1/billing/checkout-sessions"
tags: ["billing"]
---

# Create Checkout Session

`POST /api/v1/billing/checkout-sessions`

## Request

- Base URL: `https://api.gnosari.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gnosari.com/api/v1/billing/checkout-sessions`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-AUTH-TOKEN`

Create Stripe Checkout Session for new subscription.

Validates:
- Plan exists and is active
- Account doesn't already have active subscription
- Billing interval is valid for the plan

## Request body

- CreateCheckoutSessionRequest: Request schema for creating a checkout session.
  - `plan_identifier` string, required: Subscription plan identifier
  - `billing_interval` string, required: Billing interval (month or year)
  - `success_url` string, required: URL to redirect after successful payment
  - `cancel_url` string, required: URL to redirect after canceling payment

## Response `200`

Successful Response

- CreateCheckoutSessionResponse: Response schema for checkout session creation.
  - `checkout_url` string, required: Stripe Checkout URL
  - `session_id` string, required: Stripe Session ID

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/gnosari/apis/gnosari-api.md) · [All operations](https://skmtc.dev/gnosari/apis/gnosari-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gnosari/apis/gnosari-api/revisions/f299cf53ae5f?raw)
