---
title: "Create a Stripe Checkout session for a subscription plan"
method: POST
path: "/api/stripe/create-checkout-session"
tags: ["Stripe"]
---

# Create a Stripe Checkout session for a subscription plan

`POST /api/stripe/create-checkout-session`

## Request

- Base URL: `https://api.hiyd.ai`
- URL: `https://api.hiyd.ai/api/stripe/create-checkout-session`
- Auth: HTTP bearer

## Request body

- object
  - `plan_id` string, uuid, required: Subscription plan ID to purchase

## Response `200`

Checkout session created

- object
  - `sessionId` string
  - `url` string: Redirect user to this URL for payment

## Other responses

- `400`: Validation error or plan not found
- `401`: Unauthorized

---

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