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

# Create a Stripe checkout session



## OpenAPI

````yaml https://portal.unicontrol.me/v1/openapi post /v1/billing/checkout-sessions
openapi: 3.1.0
info:
  title: Unicontrol API
  description: Welcome
  version: 1.0.0
servers:
  - url: http://0.0.0.0:3000
    description: Local Server
  - url: https://portal.test.flexhome.casa
    description: Development
  - url: https://portal.unicontrol.me
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/billing/checkout-sessions:
    post:
      tags:
        - Billing
      summary: Create a Stripe checkout session
      operationId: postV1BillingCheckout-sessions
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                planId:
                  type: number
                  description: ID do plano a assinar
                redirectUrl:
                  type: string
                  format: uri
                  description: URL de redirecionamento pós-pagamento
              required:
                - planId
                - redirectUrl
            example:
              planId: 2
              redirectUrl: https://app.example.com/billing/success
        required: true
      responses:
        '200':
          description: Checkout session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: URL do checkout Stripe
              example:
                url: https://checkout.stripe.com/pay/cs_test_xxx
        '400':
          description: Dados inválidos
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              example:
                message: validation error
        '401':
          description: Não autenticado
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: unauthorized
        '500':
          description: Erro interno do servidor
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: internal_error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````