> ## 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.

# プランをキャンセル

> 課金プランをキャンセル

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


## OpenAPI

````yaml /openapi.ja.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: 課金プランをキャンセル
      description: アカウントの料金プランをキャンセルします。
      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: 検証エラー
      security:
        - PublicBearerAuth: []
components:
  schemas:
    BillingCancelPlanRequest:
      description: アカウントのサブスクリプションプランをキャンセルする顧客要求スキーマ。
      properties:
        cancel_at_period_end:
          default: true
          description: 請求期間の終了時にプランをキャンセルする
          title: 期間終了時にキャンセル
          type: boolean
        cancel_immediately:
          default: false
          description: すぐにプランをキャンセルしてください
          title: 直ちにキャンセル
          type: boolean
      title: BillingCancelPlanリクエスト
      type: object
    PublicBillingPlanOperationResponse:
      properties:
        account_status:
          anyOf:
            - type: string
            - type: 'null'
          description: 操作後のアカウントのステータス
          title: アカウントのステータス
        effective_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: 請求変更が有効になった時期
          title: 有効時
        eligible:
          anyOf:
            - type: boolean
            - type: 'null'
          description: アカウントが操作の対象となったかどうか
          title: 対象
        previous_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 以前の料金プラン ID
          title: 以前のプラン ID
        status:
          description: 課金動作状況
          title: ステータス
          type: string
        target_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 対象の料金プランID
          title: ターゲットプランID
      required:
        - status
      title: PublicBillingPlanOperationResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: 詳細
          type: array
      title: HTTPValidationエラー
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: 場所
          type: array
        msg:
          title: メッセージ
          type: string
        type:
          title: エラータイプ
          type: string
      required:
        - loc
        - msg
        - type
      title: Validationエラー
      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

````