> ## Documentation Index
> Fetch the complete documentation index at: https://formbnb.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Checkout Session

> Create a new Stripe checkout session for upgrading to a paid plan.



## OpenAPI

````yaml POST /billing/checkout
openapi: 3.1.0
info:
  title: FormBnB API
  version: 1.0.0
  description: API for FormBnB - Form backend as a service
servers:
  - url: https://api.formbnb.com
security: []
paths:
  /billing/checkout:
    post:
      tags:
        - Billing
      summary: Create a Stripe checkout session
      description: Create a new Stripe checkout session for upgrading to a paid plan.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutRequest'
      responses:
        '200':
          description: Checkout session created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutResponse'
        '400':
          description: Invalid plan or configuration error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    CheckoutRequest:
      type: object
      properties:
        plan:
          type: string
          enum:
            - starter
            - pro
          description: The subscription plan to checkout
        interval:
          type: string
          enum:
            - month
            - year
          default: month
          description: Billing interval
      required:
        - plan
    CheckoutResponse:
      type: object
      properties:
        url:
          type: string
          nullable: true
          format: uri
          description: Stripe checkout session URL
      required:
        - url
    BillingErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: >-
        Authentication using either a FormBnB session JWT (issued by /auth) or
        an API key (prefixed with sk_). Both token types are passed as Bearer
        tokens in the Authorization header.

````