---
title: "Create a subscription Checkout session"
method: POST
path: "/api/v1/checkout"
tags: ["Billing", "User"]
---

# Create a subscription Checkout session

`POST /api/v1/checkout`

Requires a Secure, SameSite browser session and X-CSRF-Token. Trial policy is server-owned: clients cannot send trial_days or no_default_trial. Idempotency is scoped to user, plan and billing period before Stripe.

## Headers

- `X-CSRF-Token` string, required
- `Idempotency-Key` string

## Request body

- object
  - `plan` 'profesional' | 'max' | 'pro' | 'business' | 'agency', required
  - `billing` 'monthly' | 'yearly' | 'anual'
  - `coupon` string
  - `csrf` string — Body fallback accepted by the runtime; prefer X-CSRF-Token.
  - `idempotency_key` string

## Response `200`

Checkout URL and Stripe session id

- StripeSessionResponse
  - `url` string, uri, required
  - `session_id` string, required

## Other responses

- `400` — Invalid request
- `401` — Authentication required (no active session)
- `403` — Invalid CSRF token
- `413` — Request body too large
- `429` — Rate limit exceeded
- `503` — Action budget or Stripe unavailable

---

[API](https://skmtc.net/openmercantil/apis/openmercantil-public-api.md) · [All operations](https://skmtc.net/openmercantil/apis/openmercantil-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openmercantil/openmercantil-public-api/versions/996f96a11758/schema)
