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

# Create Checkout Session

`POST /v1/billing/payments/create-checkout-session`

## Request body

- CheckoutSessionRequest
  - `subscription_id` integer, required — Subscription plan ID to purchase
  - `billing_period` 'monthly' | 'yearly' | 'annual'
  - `auto_renew` boolean — Enable automatic recurring payments
  - `success_url` string, nullable
  - `cancel_url` string, nullable

## Response `201`

Successful Response

- CheckoutSessionResponse
  - `checkout_url` string, required
  - `invoice_id` string, required
  - `payment_id` integer, required
  - `billing_period` string, required
  - `auto_renew` boolean, required
  - `message` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/kodik/apis/kodik-api.md) · [All operations](https://skmtc.dev/kodik/apis/kodik-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kodik/kodik-api/revisions/55c71b347360/schema)
