Subscriptions
Update a subscription
Cancel auto-renew or change the end date of a subscription.
POST
/
api
/
subscriptions
/
{subscription_id}
/
update
/
Authorization
Path
Body
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/update/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"end_date": "2023-11-07T05:31:56Z",
"metadata": {},
"turn_off_auto_renew": true
}'
{
"addons": [
{
"addon": {
"addon_id": "<string>",
"addon_name": "<string>",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"addon_subscription_id": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"fully_billed": true,
"start_date": "2023-11-07T05:31:56Z"
}
],
"auto_renew": true,
"billing_plan": {
"plan_id": "<string>",
"plan_name": "<string>",
"version": 123,
"version_id": "<string>"
},
"customer": {
"customer_id": "<string>",
"customer_name": "<string>",
"email": "jsmith@example.com"
},
"end_date": "2023-11-07T05:31:56Z",
"fully_billed": true,
"is_new": true,
"metadata": {},
"start_date": "2023-11-07T05:31:56Z",
"subscription_filters": [
{
"property_name": "<string>",
"value": "<string>"
}
],
"subscription_id": "<string>"
}
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
headerrequiredToken-based authentication with required prefix "Token"
Path Parameters
subscription_id
string
requiredThe ID of the subscription to update.
Body
end_date
string
Change the end date for the subscription.
metadata
object
Update the metadata for the subscription.
turn_off_auto_renew
boolean
Turn off auto renew for the subscription
Response
200 - application/json
addons
object[]
requiredauto_renew
boolean
requiredWhether the subscription automatically renews. Defaults to true.
billing_plan
object
requiredcustomer
object
requiredend_date
string
requiredThe time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
fully_billed
boolean
requiredis_new
boolean
requiredWhether this subscription came from a renewal or from a first-time. Defaults to true on creation.
metadata
object
requiredstart_date
string
requiredThe time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
subscription_filters
object[]
requiredsubscription_id
string
requiredcurl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/update/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"end_date": "2023-11-07T05:31:56Z",
"metadata": {},
"turn_off_auto_renew": true
}'
{
"addons": [
{
"addon": {
"addon_id": "<string>",
"addon_name": "<string>",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"addon_subscription_id": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"fully_billed": true,
"start_date": "2023-11-07T05:31:56Z"
}
],
"auto_renew": true,
"billing_plan": {
"plan_id": "<string>",
"plan_name": "<string>",
"version": 123,
"version_id": "<string>"
},
"customer": {
"customer_id": "<string>",
"customer_name": "<string>",
"email": "jsmith@example.com"
},
"end_date": "2023-11-07T05:31:56Z",
"fully_billed": true,
"is_new": true,
"metadata": {},
"start_date": "2023-11-07T05:31:56Z",
"subscription_filters": [
{
"property_name": "<string>",
"value": "<string>"
}
],
"subscription_id": "<string>"
}