---
title: "POST /api/subscriptions/add/"
method: POST
path: "/api/subscriptions/add/"
tags: ["api"]
---

# POST /api/subscriptions/add/

`POST /api/subscriptions/add/`

A simple ViewSet for viewing and editing Subscriptions.

## Request body

- SubscriptionRecordCreateRequest
  - `start_date` string, date-time, required — The date the subscription starts. This should be a string in YYYY-MM-DD format of the date in UTC time.
  - `end_date` string, date-time — The date the subscription ends. This should be a string in YYYY-MM-DD format of the date in UTC time. If you don’t set it (recommended), we will use the information in the billing plan to automatically calculate this.
  - `auto_renew` boolean — Whether the subscription automatically renews. Defaults to true.
  - `is_new` boolean
  - `subscription_filters` SubscriptionCategoricalFilterRequest[] — Add filter key, value pairs that define which events will be applied to this plan subscription.
    - `value` string, required
    - `property_name` string, required — The string name of the property to filter on. Example: 'product_id'
  - `customer_id` string, required — The id provided when creating the customer
  - `plan_id` string, uuid, required — The Lotus plan_id, found in the billing plan object

## Response `200`

- SubscriptionRecord
  - `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.
  - `is_new` boolean, required — Whether this subscription came from a renewal or from a first-time. Defaults to true on creation.
  - `subscription_filters` SubscriptionCategoricalFilter[], required
    - `value` string, required
    - `property_name` string, required — The string name of the property to filter on. Example: 'product_id'
  - `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, 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` integer, required
  - `fully_billed` boolean, required — Whether the subscription has been fully billed and finalized.

## Changes

- **2023-01-16** `36b48cae00a3` — 10 breaking, 5 info
  - the request property `customer_id` became not nullable (media type: application/json)
  - the request property `customer_id` became not nullable (media type: application/x-www-form-urlencoded)
  - the request property `customer_id` became not nullable (media type: multipart/form-data)
  - the request property `plan_id` became required (media type: application/json)
  - …11 more

[Change history](https://skmtc.dev/uselotus/apis/lotus-api/changes/api/subscriptions/add/post.md)

---

[API](https://skmtc.dev/uselotus/apis/lotus-api.md) · [All operations](https://skmtc.dev/uselotus/apis/lotus-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/uselotus/lotus-api/revisions/36b48cae00a3/schema)
