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

# Archive a subscription plan

> Archives a subscription plan by setting its active status to false. Existing subscriptions using this plan will continue, but no new subscriptions can be created with this plan.



## OpenAPI

````yaml /api-reference/orchestrator-openapi.json delete /v1/plans/{id}
openapi: 3.0.0
info:
  title: Payment Orchestrator API
  description: API documentation for the Payment Orchestrator service
  version: 1.0.0
servers:
  - url: https://api.sandbox.cheqpay.mx/pos
    description: Sandbox environment
  - url: https://prod.cheqpay.mx/pos
    description: Production environment
security:
  - ApiKeyAuth: []
    MerchantIdAuth: []
tags:
  - name: Customer
    description: Customer management endpoints (v1)
  - name: Customer V2
    description: >-
      Customer management endpoints (v2) - merchant-scoped, no external ID
      required
  - name: Payment Order
    description: Payment order management endpoints
  - name: Checkout
    description: Payment checkout endpoints
  - name: Payment Method
    description: Payment method management endpoints
  - name: Subscription Plan
    description: Subscription plan management endpoints for recurring payments
  - name: Subscription
    description: Subscription management endpoints for recurring billing
  - name: Subscription Invoice
    description: Subscription invoice management endpoints
paths:
  /v1/plans/{id}:
    delete:
      tags:
        - Subscription Plan
      summary: Archive a subscription plan
      description: >-
        Archives a subscription plan by setting its active status to false.
        Existing subscriptions using this plan will continue, but no new
        subscriptions can be created with this plan.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Subscription plan unique identifier
      responses:
        '200':
          description: Subscription plan archived successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionPlanResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: Subscription plan not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
components:
  schemas:
    SubscriptionPlanResponse:
      type: object
      required:
        - id
        - merchantId
        - name
        - amount
        - currency
        - interval
        - intervalCount
        - active
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique plan identifier
          example: 123e4567-e89b-12d3-a456-426614174000
        merchantId:
          type: string
          description: Merchant identifier
          example: merchant_123
        externalId:
          type: string
          nullable: true
          description: External plan ID from merchant system
          example: PLAN-MONTHLY-001
        name:
          type: string
          description: Plan name
          example: Monthly Premium Plan
        description:
          type: string
          nullable: true
          description: Plan description
          example: Premium subscription with all features included
        amount:
          type: string
          description: Amount in smallest currency unit (string representation of BigInt)
          example: '9900'
        currency:
          type: string
          description: Currency code
          example: MXN
        interval:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
          description: Billing interval
          example: MONTH
        intervalCount:
          type: integer
          description: Number of intervals between billings
          example: 1
        trialDays:
          type: integer
          nullable: true
          description: Number of trial days
          example: 14
        active:
          type: boolean
          description: Whether the plan is active
          example: true
        metadata:
          type: object
          additionalProperties: true
          nullable: true
          description: Additional metadata
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
          example: '2025-01-15T10:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
          example: '2025-01-15T10:00:00.000Z'
    UnauthorizedError:
      type: object
      description: Unauthorized error response
      properties:
        message:
          type: string
          description: Error message
          example: Invalid api key
      example:
        message: Invalid api key
    NotFoundError:
      type: object
      description: Not found error response
      properties:
        message:
          type: string
          description: Error message
          example: Merchant not found
      example:
        message: Merchant not found
    InternalError:
      type: object
      description: Error response
      properties:
        message:
          type: string
          description: Error message
          example: Error message
      example:
        message: Error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication (required)
    MerchantIdAuth:
      type: apiKey
      in: header
      name: x-merchant-id
      description: Merchant ID for identifying the merchant (required)

````