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

# Cancelar plan

> Cancelar plan de facturación

<script src="/locale-bridge.js" />


## OpenAPI

````yaml /openapi.es.json POST /v1/public/accounts/{account_id}/billing/cancel-plan
openapi: 3.1.0
info:
  title: Code API (Public)
  version: 1.0.0
servers:
  - url: https://api.hybridbox.io
security: []
paths:
  /v1/public/accounts/{account_id}/billing/cancel-plan:
    post:
      tags:
        - public-accounts
        - public-billing
      summary: Cancelar plan de facturación
      description: Cancelar el plan de facturación de la cuenta.
      operationId: >-
        cancel_public_billing_plan_v1_public_accounts__account_id__billing_cancel_plan_post
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            format: uuid
            title: Account Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingCancelPlanRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicBillingPlanOperationResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Error de validación
      security:
        - PublicBearerAuth: []
components:
  schemas:
    BillingCancelPlanRequest:
      description: >-
        Esquema de solicitud de cliente para cancelar el plan de suscripción de
        una cuenta.
      properties:
        cancel_at_period_end:
          default: true
          description: Cancelar el plan al final del período de facturación
          title: Cancelar al final del período
          type: boolean
        cancel_immediately:
          default: false
          description: Cancelar el plan inmediatamente
          title: Cancelar inmediatamente
          type: boolean
      title: BillingCancelPlanRequest
      type: object
    PublicBillingPlanOperationResponse:
      properties:
        account_status:
          anyOf:
            - type: string
            - type: 'null'
          description: Estado de la cuenta después de la operación.
          title: Estado de la cuenta
        effective_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Cuándo entró en vigor el cambio de facturación
          title: Efectivo en
        eligible:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Si la cuenta era elegible para la operación
          title: Elegible
        previous_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: ID del plan de facturación anterior
          title: Identificación del plan anterior
        status:
          description: Estado de la operación de facturación
          title: Estado
          type: string
        target_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: ID del plan de facturación objetivo
          title: ID del plan objetivo
      required:
        - status
      title: PublicBillingPlanOperationResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detalle
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Ubicación
          type: array
        msg:
          title: Mensaje
          type: string
        type:
          title: Tipo de error
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    PublicBearerAuth:
      bearerFormat: JWT or Hybridbox Service account token
      description: >-
        Public API bearer credential sent as `Authorization: Bearer <token>`.
        Use either an OAuth access token or a Hybridbox Service account token.
      scheme: bearer
      type: http

````