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

# Archive a Subscription Plan

> Soft-archive a plan so no new subscriptions can enroll. Existing subscribers continue until their next renewal.

`DELETE /subscription/plan/{id}` soft-archives a plan by setting its `deletedAt` timestamp. Existing subscriptions on the archived plan continue billing normally. At each subscriber's next renewal date, Therius will cancel those subscriptions rather than renewing them. No new subscribers can enroll in an archived plan.

<Note>
  This is a soft-delete — the plan row is not permanently removed, so it stays in the database for audit purposes. It is, however, **excluded from `GET /subscription/plan` list results** once archived (that endpoint filters out deleted plans); look it up directly via `GET /subscription/plan/{id}` if you need to inspect an archived plan.
</Note>

Returns `200 OK` with `{ "deleted": true }`.

## Errors

| Code  | Meaning                   |
| ----- | ------------------------- |
| `404` | Plan not found.           |
| `409` | Plan is already archived. |

<Warning>
  Once a plan is archived, existing subscribers will be automatically cancelled at their next renewal. Migrate subscribers to a new plan using [change-plan](/api-reference/subscriptions/change-plan) before archiving if you want them to continue billing uninterrupted.
</Warning>

<RequestExample>
  ```bash cURL theme={"dark"}
  curl -X DELETE "https://api.therius.io/v1/subscription/plan/42?merchantCode=MERCHANT_001" \
    -H "Authorization: Bearer prv_production_your_key_here"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={"dark"}
  { "deleted": true }
  ```
</ResponseExample>


## OpenAPI

````yaml DELETE /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}:
    delete:
      tags:
        - Plans
      summary: Archive a subscription plan
      operationId: archivePlan
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: merchantCode
          in: query
          required: true
          description: >-
            Your merchant account identifier. Validated against the Bearer key's
            merchant.
          schema:
            type: string
      responses:
        '200':
          description: Plan archived
          content:
            application/json:
              schema:
                type: object
                properties:
                  deleted:
                    type: boolean
                    example: true
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret API key: `Bearer prv_production_xxx` (production) or `Bearer
        prv_sandbox_xxx` (sandbox).

````