API Reference
- GETAPI Overview
- SDK Setup
- Events
- Customers
- Entitlements
- Subscriptions
- Plans
- Invoices
- Credits
Subscriptions
Cancel an Add-On
Cancel an addon in the customer’s subscription
POST
/
api
/
subscriptions
/
{subscription_id}
/
addons
/
{addon_id}
/
cancel
/
Copy
Ask AI
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/{addon_id}/cancel/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"flat_fee_behavior": "refund",
"usage_behavior": "bill_full",
"invoicing_behavior": "invoice_now"
}'
Copy
Ask AI
[
{
"addon_subscription_id": "<string>",
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"addon": {
"addon_name": "<string>",
"addon_id": "<string>",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"parent": {
"fully_billed": true,
"plan_detail": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"subscription_id": "<string>",
"metadata": {},
"subscription_filters": [
{
"value": "<string>",
"property_name": "<string>"
}
],
"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
}
],
"is_new": true,
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"billing_plan": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"auto_renew": true
},
"fully_billed": true,
"auto_renew": true,
"metadata": {}
}
]
Copy
Ask AI
lotus.cancel_addon(
subscription_id='sub_e953bfbf42a442ca90079c8f1656d306',
addon_id='addon_5af61a194ca144478fb2721dd34c9049',
flat_fee_behavior='charge_prorated',
invoicing_behavior='invoice_now'
)
Authorizations
Token-based authentication with required prefix "Token"
Path Parameters
The ID of the addon within the subscription update.
The ID of the subscription to update.
Body
Response
200 - application/json
The response is of type object[]
.
Copy
Ask AI
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/{addon_id}/cancel/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"flat_fee_behavior": "refund",
"usage_behavior": "bill_full",
"invoicing_behavior": "invoice_now"
}'
Copy
Ask AI
[
{
"addon_subscription_id": "<string>",
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"addon": {
"addon_name": "<string>",
"addon_id": "<string>",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"parent": {
"fully_billed": true,
"plan_detail": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"subscription_id": "<string>",
"metadata": {},
"subscription_filters": [
{
"value": "<string>",
"property_name": "<string>"
}
],
"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
}
],
"is_new": true,
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"billing_plan": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"auto_renew": true
},
"fully_billed": true,
"auto_renew": true,
"metadata": {}
}
]
Assistant
Responses are generated using AI and may contain mistakes.