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

# Realiza upgrade imediato do plano com proration



## OpenAPI

````yaml /openapi/extat-openapi.json post /billing/subscriptions/upgrade
openapi: 3.0.0
info:
  contact:
    email: contato@cernedigital.io
    name: Cerne Digital
    url: https://cernedigital.io
  description: >-
    API REST da Extat Plataforma usada pelo painel web. Artefato OpenAPI 3.0
    para a documentação Mintlify (tags em PT-BR).
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Extat Plataforma - API REST
  version: '1.0'
servers:
  - url: https://golang-api-vgnqx.ondigitalocean.app/v1
security: []
tags:
  - name: Autenticação
  - name: Bancos
  - name: Contas Bancárias
  - name: Plano e Assinaturas
  - name: Empresa
  - name: Centros de Custo
  - name: Painel
  - name: Demonstrativos
  - name: Saúde
  - name: Convites
  - name: Membros
  - name: Onboarding
  - name: Fornecedores
  - name: Usuário
paths:
  /billing/subscriptions/upgrade:
    post:
      tags:
        - Plano e Assinaturas
      summary: Realiza upgrade imediato do plano com proration
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dto.ChangePlanRequestDTO'
        description: novo plano e price
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.SubscriptionResponseDTO'
          description: OK
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: Unprocessable Entity
      security:
        - ApiKeyAuth: []
components:
  schemas:
    dto.ChangePlanRequestDTO:
      properties:
        plan_id:
          type: string
        plan_price_id:
          type: string
      required:
        - plan_id
        - plan_price_id
      type: object
    dto.SubscriptionResponseDTO:
      properties:
        cancel_at_period_end:
          type: boolean
        cancellation_requested_at:
          type: string
        current_period_end:
          type: string
        current_period_start:
          type: string
        grace_until:
          type: string
        id:
          type: string
        plan:
          $ref: '#/components/schemas/dto.PlanResponseDTO'
        plan_id:
          type: string
        plan_price_id:
          type: string
        retention_until:
          type: string
        status:
          type: string
        stripe_customer_id:
          type: string
        stripe_subscription_id:
          type: string
        user_id:
          type: string
      type: object
    handler.ErrorResponseDTO:
      properties:
        error:
          type: string
        message:
          type: string
      type: object
    dto.PlanResponseDTO:
      properties:
        active:
          type: boolean
        created_for_user_id:
          type: string
        description:
          type: string
        id:
          type: string
        kind:
          type: string
        limits:
          $ref: '#/components/schemas/dto.PlanLimitsDTO'
        name:
          type: string
        prices:
          items:
            $ref: '#/components/schemas/dto.PlanPriceDTO'
          type: array
        slug:
          type: string
        sort_order:
          type: integer
      type: object
    dto.PlanLimitsDTO:
      properties:
        dre_available:
          type: boolean
        max_companies:
          minimum: -1
          type: integer
        max_transactions_per_month:
          minimum: -1
          type: integer
        max_users_per_company:
          minimum: -1
          type: integer
      type: object
    dto.PlanPriceDTO:
      properties:
        active:
          type: boolean
        amount_cents:
          type: integer
        currency:
          type: string
        id:
          type: string
        period:
          type: string
        saving:
          type: integer
        stripe_price_id:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: >-
        Token da sessão no cabeçalho Authorization, no formato Bearer (mesmo
        esquema ApiKeyAuth do contrato).
      in: header
      name: Authorization
      type: apiKey

````