POST
/
api
/
subscriptions
/
add
/
curl --request POST \
  --url https://api.uselotus.io/api/subscriptions/add/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "start_date": "2023-11-07T05:31:56Z",
  "end_date": "2023-11-07T05:31:56Z",
  "auto_renew": true,
  "is_new": true,
  "subscription_filters": [
    {
      "value": "<string>",
      "property_name": "<string>"
    }
  ],
  "customer_id": "<string>",
  "plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}'
{
  "subscription_id": "<string>",
  "start_date": "2023-11-07T05:31:56Z",
  "end_date": "2023-11-07T05:31:56Z",
  "auto_renew": true,
  "is_new": true,
  "subscription_filters": [
    {
      "value": "<string>",
      "property_name": "<string>"
    }
  ],
  "customer": {
    "customer_name": "<string>",
    "email": "jsmith@example.com",
    "customer_id": "<string>"
  },
  "billing_plan": {
    "plan_name": "<string>",
    "plan_id": "<string>",
    "version_id": "<string>",
    "version": 123
  },
  "fully_billed": true,
  "addons": [
    {
      "addon_subscription_id": "<string>",
      "start_date": "2023-11-07T05:31:56Z",
      "end_date": "2023-11-07T05:31:56Z",
      "addon": {
        "addon_name": "<string>",
        "addon_id": "<string>",
        "addon_type": "flat",
        "billing_frequency": "one_time"
      },
      "fully_billed": true
    }
  ],
  "metadata": {}
}

A subscription associates one of your customers with one of your billing plans. You can define multiple subscriptions of the same plan for a single customer by using the subscription filters.

lotus.create_subscription(
  customer_id='cust_0569173ee6654369',
  plan_id='premium_plan_7ui9op',
  start_date='2020-01-01',
)

Authorizations

Authorization
string
header
required

Token-based authentication with required prefix "Token"

Body

Response

200 - application/json

The response is of type object.