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

# Delete or archive a plan

> **Archive-by-default.** If the plan has any subscriptions it is *archived* (`active=false`): existing subscribers keep billing, history is preserved, and it stops accepting new sign-ups. Only a plan that was never subscribed is permanently hard-deleted. Historical invoices are never affected either way (they snapshot the amount at billing time).




## OpenAPI

````yaml DELETE /v1/plans/{id}
openapi: 3.0.3
info:
  title: Plinth API
  version: 0.9.0
  description: >
    Recurring billing for Nigerian SaaS — card charging, bank transfers via
    virtual accounts,

    proration, dunning, and recovery in one API.


    All amounts are in **kobo** (1/100th of a Naira). ₦5,000 = `500000`.
servers:
  - url: https://api.useplinth.com
    description: Production
  - url: http://localhost:7331
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: Sandbox
    description: Create an isolated sandbox environment for testing. No auth required.
  - name: Customers
    description: Who you are billing. One customer can have multiple subscriptions.
  - name: Plans
    description: Plan groups and the plans within them. Customers subscribe to plans.
  - name: Subscriptions
    description: The recurring billing relationship between a customer and a plan.
  - name: Virtual Accounts
    description: Dedicated bank account numbers for customers who pay by transfer.
  - name: Invoices
    description: Created at each billing cycle. Tracks what a customer owes for a period.
  - name: Webhooks
    description: >-
      Register endpoints that receive signed, retried events. See Receiving
      webhooks.
  - name: Admin
    description: Test clock control, billing tick, and suspense resolution. Test-mode only.
paths:
  /v1/plans/{id}:
    delete:
      tags:
        - Plans
      summary: Delete or archive a plan
      description: >
        **Archive-by-default.** If the plan has any subscriptions it is
        *archived* (`active=false`): existing subscribers keep billing, history
        is preserved, and it stops accepting new sign-ups. Only a plan that was
        never subscribed is permanently hard-deleted. Historical invoices are
        never affected either way (they snapshot the amount at billing time).
      operationId: delete-plan
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: pln_01JABC...
      responses:
        '200':
          description: Plan archived or deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - plan
                  id:
                    type: string
                  archived:
                    type: boolean
                    description: >-
                      true = archived (had subscribers); false = hard-deleted
                      (was unused)
                  deleted:
                    type: boolean
              examples:
                archived:
                  summary: Plan had subscribers → archived
                  value:
                    object: plan
                    id: pln_01JABC...
                    archived: true
                    deleted: false
                deleted:
                  summary: Plan was unused → hard-deleted
                  value:
                    object: plan
                    id: pln_01JABC...
                    archived: false
                    deleted: true
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Use `sk_test_` keys for sandbox. Use `sk_live_` keys for production.
        Obtain your key from the dashboard.

````