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

# Atualize um plano de assinatura

> Atualize o nome, a descrição, o status ativo ou a disponibilidade por país de um plano. O valor e o intervalo não podem ser alterados.

export const SchemaLangNote = ({lang}) => {
  const text = ({
    es: "Los nombres de campos y el esquema de solicitud/respuesta que se muestran a continuación están en inglés — se generan a partir de la especificación OpenAPI. El texto explicativo de esta página está traducido.",
    pt: "Os nomes dos campos e o esquema de requisição/resposta exibidos abaixo estão em inglês — são gerados a partir da especificação OpenAPI. O texto explicativo desta página está traduzido."
  })[lang] || "Field names and the request/response schema shown below are in English — they are generated from the OpenAPI specification.";
  return <Note>{text}</Note>;
};

`PATCH /subscription/plan/{id}` atualiza os campos mutáveis de um plano existente. Você pode renomeá-lo, atualizar a descrição dele, alternar o status ativo dele para parar de aceitar novos assinantes, ou ajustar os países onde ele está disponível — tudo sem afetar os assinantes existentes.

<SchemaLangNote lang="pt" />

<Note>
  `amount`, `interval`, `intervalCount` e `currency` são imutáveis e não podem ser alterados por este endpoint. Para mudar o preço ou a cadência de faturamento, crie um novo plano usando `POST /subscription/plan` e migre os assinantes usando [change-plan](/api-reference/subscriptions/change-plan).
</Note>

Inclua apenas os campos que você quer mudar — os omitidos ficam inalterados (veja o painel de parâmetros acima para a lista completa; `availableCountries` é uma substituição completa, não uma mesclagem).

Devolve `200 OK` com o objeto de plano atualizado completo.

## Erros

| Código | Significado                                                                                               |
| ------ | --------------------------------------------------------------------------------------------------------- |
| `404`  | Plano não encontrado.                                                                                     |
| `422`  | Erro de validação — p. ex. um código de país não reconhecido ou uma tentativa de mutar um campo imutável. |

<RequestExample>
  ```bash cURL theme={"dark"}
  curl -X PATCH https://api.therius.io/v1/subscription/plan/42 \
    -H "Authorization: Bearer prv_production_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "merchantCode": "MERCHANT_001",
      "name": "Pro Monthly (Revised)",
      "isActive": false
    }'
  ```
</RequestExample>


## OpenAPI

````yaml PATCH /subscription/plan/{id}
openapi: 3.1.0
info:
  title: Therius API
  description: REST API for payments, subscriptions, and billing plans.
  version: 1.0.0
servers:
  - url: https://api.therius.io/v1
    description: Production
  - url: https://api-sandbox.therius.io/v1
    description: Sandbox
security:
  - bearerAuth: []
paths:
  /subscription/plan/{id}:
    patch:
      tags:
        - Plans
      summary: Update a subscription plan
      operationId: updatePlan
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - merchantCode
              properties:
                merchantCode:
                  type: string
                  description: Your merchant account identifier.
                name:
                  type: string
                  description: New plan name.
                description:
                  type: string
                  description: New description.
                isActive:
                  type: boolean
                  description: >-
                    Set `false` to stop the plan accepting new subscribers.
                    `amount` and `interval` cannot be changed - create a new
                    plan and use change-plan instead.
                availableCountries:
                  type: array
                  items:
                    type: string
                  description: >-
                    Replacement list of ISO 3166-1 alpha-2 codes. Send `[]` to
                    make the plan global.
      responses:
        '200':
          description: Updated plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
components:
  schemas:
    Plan:
      type: object
      description: >-
        A reusable billing plan. `amount` is a flat integer in the currency
        minor units (with separate `currency` + `exponent`) - not an Amount
        object.
      properties:
        id:
          type: integer
          description: The plan unique integer ID.
        merchantId:
          type: integer
          description: The merchant account that owns the plan.
        name:
          type: string
        description:
          type: string
        interval:
          type: string
          enum:
            - day
            - week
            - month
            - year
          description: Billing interval unit. Immutable after creation.
        intervalCount:
          type: integer
          description: >-
            Number of `interval` units between charges - `month` + `3` bills
            quarterly.
        amount:
          type: integer
          description: >-
            Recurring charge in the currency minor units (e.g. `2999` = $29.99
            at exponent 2). Immutable after creation.
        currency:
          type: string
          description: ISO 4217 currency code. Immutable after creation.
        exponent:
          type: integer
          description: >-
            Decimal places for `amount` / `introAmount` - `2` for USD, `0` for
            JPY.
        trialPeriodDays:
          type: integer
          description: Free-trial length in days before the first charge. `0` for no trial.
        introAmount:
          type: integer
          description: >-
            Introductory charge in minor units for the first
            `introBillingCycles` cycles, if set.
        introBillingCycles:
          type: integer
          description: >-
            How many initial cycles are billed at `introAmount` before the rate
            reverts to `amount`.
        maxBillingCycles:
          type: integer
          description: >-
            Total cycles after which the subscription auto-completes. `0` =
            open-ended.
        availableCountries:
          type: array
          items:
            type: string
          description: >-
            ISO 3166-1 alpha-2 codes the plan is offered in. Empty = available
            everywhere.
        isActive:
          type: boolean
          description: >-
            Whether the plan accepts new subscribers. Existing subscriptions are
            unaffected when this is `false`.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret API key: `Bearer prv_production_xxx` (production) or `Bearer
        prv_sandbox_xxx` (sandbox).

````