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

# Archive a plan

> Hide a plan from new Checkouts while preserving existing subscription history.

Archives the current plan with this stable `id`. A successful response is `{ "archived": true }`; the plan disappears from [List active plans](https://docs.integrateledger.com/api-reference/plans/list.md) and cannot start a new attach request. Existing subscriptions and credit allocations keep their referenced plan version and history.

An unknown or already archived ID returns `404 not_found`. You may create a new current plan with the same ID later, which is a new version for future customers. Archiving does not cancel a Stripe subscription; manage an existing customer's billing separately. See [Catalog](https://docs.integrateledger.com/catalog.md) for the full lifecycle.


## OpenAPI

````yaml openapi.json DELETE /v1/plans/{id}
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}:
    delete:
      tags:
        - Plans
      summary: Archive a plan
      operationId: archivePlan
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            pattern: ^[a-zA-Z0-9_-]+$
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Plan archived
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanArchived'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          description: Invalid Ledger API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Item not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl --request DELETE
            'https://api.integrateledger.com/v1/plans/starter' \
              -H "Authorization: Bearer $LEDGER_API_KEY"
        - lang: python
          label: Python SDK (source only)
          source: |-
            import os
            from ledger_sdk import Ledger

            ledger = Ledger(api_key=os.environ["LEDGER_API_KEY"])
            ledger.archive_plan("starter")
        - lang: typescript
          label: TypeScript SDK (source only)
          source: >-
            import { Ledger } from "@ledger/sdk";


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

            await ledger.archivePlan({ id: "starter" });
components:
  schemas:
    PlanArchived:
      type: object
      properties:
        archived:
          type: boolean
      required:
        - archived
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer

````

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