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

# Remove Subscription Add-on

> Detach an add-on from a subscription; the change takes effect from the next recurring invoice.

Detaches an add-on from a subscription. The add-on stops appearing as a line
from the **next** recurring invoice; invoices already issued are untouched and
no credit is posted for the current period. Find the `addonId` with
[List Subscription Add-ons](/api-reference/subscriptions/addons-list); attach
one again with
[Add Subscription Add-on](/api-reference/subscriptions/addons-add).

The add-on must belong to the subscription in the path — a valid add-on ID from
another subscription returns `404`.

## Path Parameters

| Parameter | Type          | Required | Description                                          |
| --------- | ------------- | -------- | ---------------------------------------------------- |
| `id`      | string (uuid) | Yes      | The subscription ID.                                 |
| `addonId` | string (uuid) | Yes      | The add-on ID (the `id` field of the add-on object). |

## Example Request

```bash theme={null}
curl -X DELETE https://api.recurso.dev/v1/subscriptions/b9071c55-0e14-4720-80f3-665613ceb7de/addons/d3a7f1c2-5b8e-4c90-a6d1-2e3f4a5b6c7d \
  -H "Authorization: Bearer $API_KEY"
```

## Response

Returns `204 No Content` with an empty body.

## Errors

| Status | Code                | When                                                                                                                     | Fix                                                                                                               |
| ------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| 400    | `validation_failed` | `id` or `addonId` is not a valid UUID.                                                                                   | Pass the subscription's UUID and the add-on's UUID.                                                               |
| 401    | `unauthorized`      | API key missing or invalid (`invalid_api_key`), or a live/test mode mismatch (`key_mode_mismatch`).                      | Send `Authorization: Bearer <api_key>` with a key for the right mode.                                             |
| 404    | `not_found`         | The subscription does not exist in your tenant, or the add-on does not exist or is attached to a different subscription. | List the subscription's add-ons with `GET /v1/subscriptions/{id}/addons` and use one of the returned `id` values. |

Errors use the standard envelope — see [Errors](/api-reference/errors).


## OpenAPI

````yaml DELETE /v1/subscriptions/{id}/addons/{addonId}
openapi: 3.1.0
info:
  title: Recurso API
  version: 1.0.0
  description: |
    The Recurso billing engine REST API.

    Authenticate by passing your API key as a bearer token:

        Authorization: Bearer <api_key>

    Obtain an API key by registering a tenant via `POST /auth/register`.
    All authenticated endpoints live under the `/v1` prefix. Mutating
    endpoints support idempotency via the `Idempotency-Key` header.
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://billing.example.com
    description: >-
      Example deployment — substitute the base URL of your own Recurso
      deployment.
security:
  - bearerAuth: []
tags:
  - name: System
    description: Health, version, and API metadata
  - name: Auth
    description: Tenant registration
  - name: Plans
    description: Product catalog plans
  - name: Customers
    description: Customer management
  - name: Subscriptions
    description: Subscription lifecycle
  - name: Invoices
    description: Invoices, PDFs, and Indian GST e-invoicing
  - name: Coupons
    description: Discounts
  - name: Usage
    description: Metered usage events
  - name: Credit Notes
    description: Customer credits
  - name: Quotes
    description: Quote-to-invoice lifecycle
  - name: Webhooks
    description: Webhook endpoint management and event feed
  - name: Analytics
    description: Revenue analytics
  - name: Checkout
    description: Public hosted checkout for invoices
  - name: Payments
    description: Payment order creation
  - name: Inbound Webhooks
    description: Receivers for payment-gateway callbacks (Razorpay, Stripe)
  - name: Customer Portal
    description: Customer-facing portal — magic-link auth and session-scoped data
  - name: Developer
    description: API key management
  - name: Account
    description: Tenant account settings
  - name: Finance
    description: Ledger accounts, entries, reconciliation, and revenue recognition
  - name: Settings
    description: Tax (GST) and e-invoicing (IRP) configuration
  - name: Consents
    description: Consent records for RBI-compliant recurring billing
  - name: Referrals
    description: Customer referral program
  - name: Gifts
    description: Gift subscriptions
  - name: Mandates
    description: UPI Autopay mandates
  - name: Offline Payments
    description: Virtual accounts and manually recorded payments
  - name: Organizations
    description: Multi-entity organizations grouping several tenants
  - name: Accounting
    description: QuickBooks / Xero accounting integrations
  - name: Churn
    description: Churn risk scoring and alerts
  - name: Cancel Flows
    description: Configurable retention flows shown at cancellation time
  - name: Dunning
    description: Dunning analytics and multi-channel dunning campaigns
paths:
  /v1/subscriptions/{id}/addons/{addonId}:
    delete:
      tags:
        - Subscriptions
      summary: Detach an add-on from a subscription
      description: >
        Removes the add-on from the subscription. The change takes effect from
        the next recurring invoice.
      operationId: removeSubscriptionAddon
      parameters:
        - $ref: '#/components/parameters/PathID'
        - name: addonId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: Add-on removed.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    PathID:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  responses:
    BadRequest:
      description: The request body or parameters are invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid credentials (API key or session cookie).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          description: Structured error detail.
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
              examples:
                - validation_failed
                - unauthorized
                - forbidden
                - not_found
                - conflict
                - rate_limited
                - internal_error
                - invalid_api_key
                - key_mode_mismatch
                - over_refund
                - invoice_not_paid
                - invoice_already_paid
            message:
              type: string
              description: Human-readable explanation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Tenant API key obtained from `POST /auth/register` or `POST
        /v1/developer/keys`.

````