---
title: "Create checkout session"
method: POST
path: "/v1/subscription/checkout"
tags: ["Subscription"]
---

# Create checkout session

`POST /v1/subscription/checkout`

## Request

- Base URL: `https://api.astrocal.dev`
- URL: `https://api.astrocal.dev/v1/subscription/checkout`
- Auth: HTTP bearer

Creates a Stripe Checkout Session for upgrading to a paid plan. Returns a URL to redirect the user to Stripe's hosted checkout page.

## Request body

- object
  - `plan` 'starter' | 'pro' | 'business', required
  - `interval` 'monthly' | 'annual'

## Response `200`

Checkout session created

- object
  - `checkout_url` string, required

## Other responses

- `400`: Invalid plan or price not configured
- `401`: Unauthorized
- `409`: Already subscribed to this plan

---

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