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

# Change the subscription's plan/price, effective immediately



## OpenAPI

````yaml /openapi.json post /v1/billing/subscriptions/{id}/change-plan
openapi: 3.0.0
info:
  title: Kerne API
  description: >-
    Kerne SaaS Foundation as a Service - authentication, authorization, and
    billing management. Errors follow standardized error codes (K1xxx-K9xxx)
    documented at https://docs.kerne.io/errors
  version: 1.0.0
  contact:
    name: Kerne Team
    url: https://kerne.io
    email: support@kerne.io
  license:
    name: Proprietary
    url: https://kerne.io/license
servers:
  - url: https://api.kerne.io
    description: Production Server
security: []
tags:
  - name: Auth
    description: Authentication endpoints
  - name: Waitlist
    description: Waitlist management
  - name: Invitations
    description: Invitation system
  - name: Billing
    description: 'The tenant''s end users: subscription, entitlements, usage, checkout'
  - name: Pricing
    description: Public pricing page data
paths:
  /v1/billing/subscriptions/{id}/change-plan:
    post:
      tags:
        - Billing
      summary: Change the subscription's plan/price, effective immediately
      operationId: BillingController_changePlanPrice
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangePlanPriceDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionWithPlanResponseDto'
      security:
        - AppIdentifier: []
        - JWT: []
components:
  schemas:
    ChangePlanPriceDto:
      type: object
      properties:
        plan_price_id:
          type: string
        proration_behavior:
          type: string
          enum:
            - none
            - create_prorations
      required:
        - plan_price_id
    SubscriptionWithPlanResponseDto:
      type: object
      properties:
        id:
          type: string
        tenant_id:
          type: string
        customer:
          $ref: '#/components/schemas/CustomerSummaryDto'
        plan_price_id:
          type: string
        pack_id:
          type: string
          nullable: true
        pending_plan_price_id:
          type: string
          nullable: true
        pending_pack_id:
          type: string
          nullable: true
        provider:
          type: string
          enum:
            - STRIPE
            - POLAR
        provider_subscription_id:
          type: string
          nullable: true
        provider_customer_id:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - ACTIVE
            - TRIALING
            - PAST_DUE
            - CANCELED
            - UNPAID
            - PAUSED
        current_period_start:
          format: date-time
          type: string
          nullable: true
        current_period_end:
          format: date-time
          type: string
          nullable: true
        trial_start:
          format: date-time
          type: string
          nullable: true
        trial_end:
          format: date-time
          type: string
          nullable: true
        canceled_at:
          format: date-time
          type: string
          nullable: true
        ended_at:
          format: date-time
          type: string
          nullable: true
        created_at:
          format: date-time
          type: string
        updated_at:
          format: date-time
          type: string
        plan:
          $ref: '#/components/schemas/SubscriptionPlanSummaryDto'
        plan_price:
          $ref: '#/components/schemas/SubscriptionPriceSummaryDto'
        product:
          $ref: '#/components/schemas/SubscriptionPlanSummaryDto'
        pack:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SubscriptionPackSummaryDto'
        entitlements:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionEntitlementSummaryDto'
      required:
        - id
        - tenant_id
        - customer
        - plan_price_id
        - pack_id
        - pending_plan_price_id
        - pending_pack_id
        - provider
        - provider_subscription_id
        - provider_customer_id
        - status
        - current_period_start
        - current_period_end
        - trial_start
        - trial_end
        - canceled_at
        - ended_at
        - created_at
        - updated_at
        - plan
        - plan_price
        - product
        - pack
        - entitlements
    CustomerSummaryDto:
      type: object
      properties:
        id:
          type: string
        external_id:
          type: string
        email:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
      required:
        - id
        - external_id
        - email
        - name
    SubscriptionPlanSummaryDto:
      type: object
      properties:
        id:
          type: string
        slug:
          type: string
        name:
          type: string
      required:
        - id
        - slug
        - name
    SubscriptionPriceSummaryDto:
      type: object
      properties:
        id:
          type: string
        amount:
          type: number
        currency:
          type: string
        interval:
          type: string
        price_label_name:
          type: string
        price_label_slug:
          type: string
      required:
        - id
        - amount
        - currency
        - interval
        - price_label_name
        - price_label_slug
    SubscriptionPackSummaryDto:
      type: object
      properties:
        id:
          type: string
        version:
          type: number
        status:
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - ARCHIVED
      required:
        - id
        - version
        - status
    SubscriptionEntitlementSummaryDto:
      type: object
      properties:
        feature_id:
          type: string
        feature_key:
          type: string
        feature_name:
          type: string
        feature_type:
          type: string
        feature_unit_label:
          type: string
          nullable: true
        limit:
          type: number
          nullable: true
        value:
          type: string
          nullable: true
        overage:
          type: string
          enum:
            - BLOCK
            - ALLOW
            - BILL
        limit_binding:
          type: string
          enum:
            - CUSTOMER
            - DIMENSION
        cap_binding:
          type: string
          enum:
            - CUSTOMER
            - DIMENSION
        max_dimensions:
          type: number
          nullable: true
        overage_ceiling:
          type: string
          nullable: true
        overage_cap_amount:
          type: number
          nullable: true
        billed_amount:
          type: number
          nullable: true
        currency:
          type: string
          nullable: true
        cap_reached:
          type: boolean
      required:
        - feature_id
        - feature_key
        - feature_name
        - feature_type
        - feature_unit_label
        - limit
        - value
        - overage
        - limit_binding
        - cap_binding
        - max_dimensions
        - overage_ceiling
        - overage_cap_amount
        - billed_amount
        - currency
        - cap_reached
  securitySchemes:
    AppIdentifier:
      type: apiKey
      in: header
      name: x-app-id
      description: App identifier (App.id, sent as the x-app-id header)
    JWT:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: JWT token obtained from /v1/auth/token

````