---
title: "POST /api/subscriptions/{subscription_id}/addons/attach/"
method: POST
path: "/api/subscriptions/{subscription_id}/addons/attach/"
tags: ["api"]
---

# POST /api/subscriptions/{subscription_id}/addons/attach/

`POST /api/subscriptions/{subscription_id}/addons/attach/`

## Path parameters

- `subscription_id` string, required

## Request body

- AddOnSubscriptionRecordCreateRequest
  - `addon_id` string, uuid — The add-on to be applied to the subscription.
  - `quantity` integer — The quantity of the add-on to be applied to the subscription. Flat fees of add-ons will be multiplied by this quantity. Usage-based components of add-ons will be unaffected by the quantity.
  - `metadata` object — A JSON object containing additional information about the add-on subscription. This will be returned in the response when you retrieve the add-on subscription.

## Response `200`

- AddOnSubscriptionRecord
  - `addon_subscription_id` string, required
  - `customer` LightweightCustomer, required
    - `customer_name` string, nullable, required — The display name of the customer
    - `email` string, email, nullable, required — The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider
    - `customer_id` string, nullable, required — The id provided when creating the customer, we suggest matching with your internal customer id in your backend
  - `addon` LightweightAddOn, required
    - `addon_name` string, required — The name of the add-on plan.
    - `addon_id` string, required — The ID of the add-on plan.
    - `addon_type` 'flat' | 'usage_based', required
    - `billing_frequency` 'one_time' | 'recurring', required — * `one_time` - one_time * `recurring` - recurring
  - `start_date` string, date-time, required — The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
  - `end_date` string, date-time, required — The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
  - `parent` LightweightSubscriptionRecord, required
    - `fully_billed` boolean, required
    - `plan_detail` LightweightPlanVersion, required
      - `plan_name` string, required
      - `plan_id` string, required
      - `version_id` string, required
      - `version` union, required
        - integer
        - 'custom_version'
    - `subscription_id` string, required
    - `metadata` object, required
    - `subscription_filters` SubscriptionFilter[], required
      - `value` string, required
      - `property_name` string, required — The string name of the property to filter on. Example: 'product_id'
    - `addons` LightweightAddOnSubscriptionRecord[], required
      - `addon_subscription_id` string, required
      - `start_date` string, date-time, required — The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
      - `end_date` string, date-time, required — The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
      - `addon` LightweightAddOn, required
        - `addon_name` string, required — The name of the add-on plan.
        - `addon_id` string, required — The ID of the add-on plan.
        - `addon_type` 'flat' | 'usage_based', required
        - `billing_frequency` 'one_time' | 'recurring', required — * `one_time` - one_time * `recurring` - recurring
      - `fully_billed` boolean, required
    - `is_new` boolean, required — Whether this subscription came from a renewal or from a first-time. Defaults to true on creation.
    - `customer` LightweightCustomer, required
      - `customer_name` string, nullable, required — The display name of the customer
      - `email` string, email, nullable, required — The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider
      - `customer_id` string, nullable, required — The id provided when creating the customer, we suggest matching with your internal customer id in your backend
    - `billing_plan` LightweightPlanVersion, required
      - `plan_name` string, required
      - `plan_id` string, required
      - `version_id` string, required
      - `version` union, required
        - integer
        - 'custom_version'
    - `start_date` string, date-time, required — The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
    - `end_date` string, date-time, required — The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
    - `auto_renew` boolean, required — Whether the subscription automatically renews. Defaults to true.
  - `fully_billed` boolean, required
  - `auto_renew` boolean, required — Whether the subscription automatically renews. Defaults to true.
  - `metadata` object, required

---

[API](https://skmtc.net/uselotus/apis/lotus-api.md) · [All operations](https://skmtc.net/uselotus/apis/lotus-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/uselotus/lotus-api/versions/1f59f4fea13f/schema)
