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

# Create a Stripe Checkout session

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

## Request

- Base URL: `https://api.xpoz.ai`
- URL: `https://api.xpoz.ai/api/stripe/create-checkout-session`
- Auth: none required

Create a Checkout session for a subscription or one-time payment.

## Request body

- object
  - `priceId` string, required
  - `quantity` integer
  - `mode` 'subscription' | 'payment'
  - `successUrl` string, uri, required
  - `cancelUrl` string, uri, required
  - `customerEmail` string, email
  - `descopeUserId` string, required
  - `metadata` object

## Response `200`

Session.

- object
  - `sessionId` string, required
  - `url` string, nullable, required

## Other responses

- `400`: Missing fields, or the user already has an active subscription.
- `500`: Server error.

---

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