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

# Promote a plan version

> Make a draft or an older version the plan's active version.

Makes the version named by number (`2`) or label (`2027-q1`) the one attach starts. The version that was active becomes legacy; every subscriber keeps the version they have. Promoting an older version back is a rollback, and promoting the active version changes nothing (`"changed": false`). No version is made.

Needs the **Catalog** permission at Write.


## OpenAPI

````yaml openapi.json POST /v1/plans/{id}/versions/{version}/promote
openapi: 3.1.0
info:
  title: Ledger API
  version: 0.1.0
servers:
  - url: https://api.integrateledger.com
    description: Hosted Ledger API
security: []
paths:
  /v1/plans/{id}/versions/{version}/promote:
    post:
      tags:
        - Plans
      summary: Promote a plan version
      description: >-
        Makes a draft or an older version the plan's active version, by number
        or label. New customers get it; every subscriber keeps the version they
        have, and the version that was active becomes legacy. Promoting an older
        version back is a rollback. Promoting the active version changes
        nothing.
      operationId: promotePlanVersion
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            pattern: ^[a-zA-Z0-9_-]+$
            description: The plan's ID.
          required: true
          description: The plan's ID.
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            maxLength: 60
            description: The version's number (such as 2) or its label (such as 2026-q4).
          required: true
          description: The version's number (such as 2) or its label (such as 2026-q4).
          name: version
          in: path
      responses:
        '200':
          description: The version is active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanVersionPromotion'
        '400':
          description: Invalid plan ID or version
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                    description: >-
                      What went wrong and what to do about it, for a person or
                      an agent to read. Every Ledger error has one. The wording
                      can change: branch on `error`, not on this text.
                    example: >-
                      No customer "user_123" exists in this environment. Create
                      it with POST /v1/customers, or check that the API key is
                      for the right environment.
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                    description: >-
                      With `invalid_request`: each field that failed validation
                      and why. `path` is empty for the body itself, such as an
                      unknown field.
                required:
                  - error
        '401':
          description: Invalid Ledger API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                    description: >-
                      What went wrong and what to do about it, for a person or
                      an agent to read. Every Ledger error has one. The wording
                      can change: branch on `error`, not on this text.
                    example: >-
                      No customer "user_123" exists in this environment. Create
                      it with POST /v1/customers, or check that the API key is
                      for the right environment.
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                    description: >-
                      With `invalid_request`: each field that failed validation
                      and why. `path` is empty for the body itself, such as an
                      unknown field.
                required:
                  - error
        '403':
          $ref: '#/components/responses/InsufficientPermissions'
        '404':
          description: >-
            No plan with this ID (plan_not_found), or no such version of it
            (plan_version_not_found)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                    description: >-
                      What went wrong and what to do about it, for a person or
                      an agent to read. Every Ledger error has one. The wording
                      can change: branch on `error`, not on this text.
                    example: >-
                      No customer "user_123" exists in this environment. Create
                      it with POST /v1/customers, or check that the API key is
                      for the right environment.
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                    description: >-
                      With `invalid_request`: each field that failed validation
                      and why. `path` is empty for the body itself, such as an
                      unknown field.
                required:
                  - error
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |-
            import os
            from integrateledger import ledger

            client = ledger(api_key=os.environ["LEDGER_API_KEY"])
            client.promote_plan_version("starter", 2)
        - lang: bash
          label: cURL
          source: >-
            curl --request POST
            'https://api.integrateledger.com/v1/plans/starter/versions/{version}/promote'
            \
              -H "Authorization: Bearer $LEDGER_API_KEY"
        - lang: typescript
          label: TypeScript SDK
          source: >-
            import ledger from "integrateledger";


            const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? ""
            });

            await client.promotePlanVersion({ id: "starter", version: "2" });
components:
  schemas:
    PlanVersionPromotion:
      type: object
      properties:
        planId:
          type: string
        changed:
          type: boolean
        active:
          $ref: '#/components/schemas/PlanVersion'
        stripeSync:
          type: string
          enum:
            - synced
            - pending
            - failed
            - awaiting_connection
      required:
        - planId
        - changed
        - active
    PlanVersion:
      type: object
      properties:
        version:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
          description: 1, 2, 3 in the order the versions were made.
        versionLabel:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - active
            - draft
            - legacy
          description: >-
            active: what attach starts by default. draft: made but not sold;
            attach starts it only when named, in Sandbox. legacy: an older
            version its subscribers keep; attach can still name it.
        subscribers:
          type: integer
          minimum: 0
          description: Subscriptions on this version that haven't ended.
        createdAt:
          type: string
          format: date-time
        terms:
          type: object
          properties:
            name:
              type: string
            monthlyCredits:
              type: integer
            priceCents:
              type: integer
            billingInterval:
              type: string
              enum:
                - month
                - year
                - one_off
            resetInterval:
              type: string
              enum:
                - month
                - year
                - never
            overageUnitAmountCents:
              type:
                - integer
                - 'null'
            overageBillingUnits:
              type: integer
            overageCapCents:
              type:
                - integer
                - 'null'
            items:
              type: array
              items:
                $ref: '#/components/schemas/PlanFeatureItem'
            group:
              type: string
              description: 'The plan''s product line: `default` unless set.'
            addOn:
              type: boolean
              description: Whether the plan is a recurring add-on.
            maxQuantity:
              type:
                - integer
                - 'null'
              description: 'How many of an add-on one customer or entity may hold. Null: 1.'
            entityGrants:
              type: string
              enum:
                - own
                - pooled
              description: >-
                Where the plan's grants go when attached to an entity: `own` or
                `pooled`.
            licenses:
              type: array
              items:
                $ref: '#/components/schemas/PlanLicense'
              description: >-
                Seats of other plans this plan sells, by seat plan;
                seatPriceCents and maxSeats only when set. Empty for none.
            stripeSyncStatus:
              type:
                - string
                - 'null'
              enum:
                - pending
                - synced
                - failed
                - null
            trial:
              $ref: '#/components/schemas/PlanTrial'
          required:
            - name
            - monthlyCredits
            - priceCents
            - billingInterval
            - resetInterval
            - overageUnitAmountCents
            - overageBillingUnits
            - overageCapCents
            - items
            - group
            - addOn
            - maxQuantity
            - entityGrants
            - stripeSyncStatus
      required:
        - version
        - versionLabel
        - status
        - subscribers
        - createdAt
        - terms
    InsufficientPermissionsError:
      type: object
      properties:
        error:
          type: string
          example: insufficient_permissions
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
        requiredScope:
          type: string
          example: customers:read
      required:
        - error
        - requiredScope
    RateLimitError:
      type: object
      properties:
        error:
          type: string
          example: rate_limited
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
      required:
        - error
    PlanFeatureItem:
      type: object
      properties:
        featureId:
          type: string
          description: The feature's ID.
        included:
          type:
            - integer
            - 'null'
          description: >-
            Units per period (metered) or the most held at once (held). Null
            when unlimited, and for boolean and credits items.
        unlimited:
          type: boolean
        overageUnitAmountCents:
          type:
            - integer
            - 'null'
          description: >-
            Price in cents per overageBillingUnits units past `included`. Null:
            no overage.
        overageBillingUnits:
          type: integer
          description: Units billed per overageUnitAmountCents.
        overageTiers:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              upTo:
                type:
                  - integer
                  - 'null'
              unitAmountCents:
                type: integer
              flatAmountCents:
                type: integer
            required:
              - upTo
              - unitAmountCents
              - flatAmountCents
        overageTiersMode:
          type:
            - string
            - 'null'
          enum:
            - graduated
            - volume
            - null
        price:
          type:
            - object
            - 'null'
          properties:
            model:
              type: string
              enum:
                - per_unit
                - measured
            billingUnits:
              type: integer
            unitAmountCents:
              type:
                - integer
                - 'null'
            tiers:
              type:
                - array
                - 'null'
              items:
                type: object
                properties:
                  upTo:
                    type:
                      - integer
                      - 'null'
                  unitAmountCents:
                    type: integer
                required:
                  - upTo
                  - unitAmountCents
            tiersMode:
              type:
                - string
                - 'null'
              enum:
                - graduated
                - volume
                - null
            includedQuantity:
              type: integer
            proration:
              type: object
              properties:
                onIncrease:
                  type: string
                  enum:
                    - next_invoice
                    - charge_now
                    - none
                onDecrease:
                  type: string
                  enum:
                    - next_invoice
                    - none
              required:
                - onIncrease
                - onDecrease
          required:
            - model
            - billingUnits
            - unitAmountCents
            - tiers
            - tiersMode
            - includedQuantity
            - proration
          description: >-
            A held item's price on the amount held, with its defaults. Null: not
            billed by count.
        trialIncluded:
          type:
            - integer
            - 'null'
          description: >-
            A metered item's units for the plan's trial. Null: `included`
            applies in the trial too.
        rollover:
          $ref: '#/components/schemas/RolloverSettings'
        prepaid:
          type:
            - object
            - 'null'
          properties:
            billingUnits:
              type: integer
              exclusiveMinimum: 0
              maximum: 2147483647
              description: >-
                Units in one pack: what the customer buys at a time, such as
                1000. 1 or more.
            unitAmountCents:
              type: integer
              maximum: 2147483647
              exclusiveMinimum: 0
              description: >-
                Price in US cents of one pack per billing interval of the plan,
                above 0.
            maxQuantity:
              type: integer
              exclusiveMinimum: 0
              maximum: 2147483647
              description: >-
                The most one customer may hold a period, the included units
                counted. Above them, by whole packs
                (`prepaid_max_below_included`, `prepaid_max_not_multiple`).
                Omitted: no maximum.
          required:
            - billingUnits
            - unitAmountCents
          additionalProperties: false
          description: >-
            A metered item's units sold in prepaid packs; maxQuantity only when
            set. Null: none.
      required:
        - featureId
        - included
        - unlimited
        - overageUnitAmountCents
        - overageBillingUnits
        - overageTiers
        - overageTiersMode
        - price
        - rollover
    PlanLicense:
      type: object
      properties:
        planId:
          type: string
          minLength: 1
          maxLength: 100
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            The seat plan: the public ID of an active plan in this environment,
            not an add-on, a one-off plan or a plan with licenses of its own.
            Each seat gets its allowances.
        seatFeatureId:
          type: string
          minLength: 1
          maxLength: 100
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            The held feature that counts the seats. No item on it, in this plan
            or the seat plan: the license holds the count.
        includedSeats:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Seats the plan's price includes. 0 or more.
        seatPriceCents:
          type: integer
          maximum: 2147483647
          exclusiveMinimum: 0
          description: >-
            Price in US cents per seat per billing interval of this plan, above
            0. Omitted: the seat plan's own price, read when Stripe syncs this
            version (changing the seat plan's price later doesn't reprice it);
            the seat plan must then bill at this plan's interval.
        maxSeats:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: >-
            The most seats one customer may hold, at least includedSeats.
            Omitted: no maximum.
      required:
        - planId
        - seatFeatureId
        - includedSeats
      additionalProperties: false
      description: >-
        Seats of a seat plan this plan sells: Team is $40 a seat, each seat gets
        100 summaries a month. Attach sells seats with the plan (licenseSeats),
        and POST /v1/licenses/assign gives one to an entity.
    PlanTrial:
      type:
        - object
        - 'null'
      properties:
        days:
          type: integer
        cardRequired:
          type: boolean
        onEnd:
          type: string
          enum:
            - bill
            - revert
        credits:
          type: integer
          description: Credits granted to the pool for the trial.
      required:
        - days
        - cardRequired
        - onEnd
        - credits
    RolloverSettings:
      type:
        - object
        - 'null'
      properties:
        maxCredits:
          type:
            - integer
            - 'null'
        maxPercent:
          type:
            - integer
            - 'null'
        periods:
          type:
            - integer
            - 'null'
          description: 'Allowance periods a rolled grant lasts. Null: until used.'
      required:
        - maxCredits
        - maxPercent
        - periods
      description: 'Rollover of unused allowance. Null: off.'
  responses:
    InsufficientPermissions:
      description: >-
        The API key works but lacks the permission this endpoint needs, named in
        requiredScope. See the API keys guide.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InsufficientPermissionsError'
    RateLimited:
      description: >-
        Too many requests. Wait Retry-After seconds, then retry. See the rate
        limits guide.
      headers:
        Retry-After:
          description: Seconds until a request is allowed again
          schema:
            type: integer
        RateLimit-Limit:
          description: 'The burst: requests allowed at once'
          schema:
            type: integer
        RateLimit-Remaining:
          description: Requests left right now
          schema:
            type: integer
        RateLimit-Reset:
          description: Seconds until the full burst is back
          schema:
            type: integer
        RateLimit-Policy:
          description: >-
            The sustained rate per second and the burst, such as
            200;w=1;burst=1000
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.