POST
/
api
/
subscriptions
/
{subscription_id}
/
update
/
curl --request POST \
  --url https://api.uselotus.io/api/subscriptions/{subscription_id}/update/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "turn_off_auto_renew": true,
  "end_date": "2023-11-07T05:31:56Z",
  "metadata": {}
}'
{
  "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": {}
}
lotus.update_subscription(
  subscription_id='sub_a623349004cd4947aca1851c64aa6fbd',
  turn_off_auto_renew=True
)

lotus.update_subscription(
  subscription_id='sub_a623349004cd4947aca1851c64aa6fbd',
  end_date='2022-02-23 03:30:00+00:00',
)

Authorizations

Authorization
string
headerrequired

Token-based authentication with required prefix "Token"

Path Parameters

subscription_id
string
required

The ID of the subscription to update.

Body

turn_off_auto_renew
boolean

Turn off auto renew for the subscription

end_date
string

Change the end date for the subscription.

metadata
object

Update the metadata for the subscription.

Response

200 - application/json
subscription_id
string
required
start_date
string
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
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
object[]
required
customer
object
required
billing_plan
object
required
fully_billed
boolean
required
addons
object[]
required
metadata
object
required