curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/cancel/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"flat_fee_behavior": "refund",
"usage_behavior": "bill_full",
"invoicing_behavior": "invoice_now"
}'
{
"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": {}
}
Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/cancel/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"flat_fee_behavior": "refund",
"usage_behavior": "bill_full",
"invoicing_behavior": "invoice_now"
}'
{
"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.cancel_subscription(
subscription_id='sub_a623349004cd4947aca1851c64aa6fbd',
flat_fee_behavior='charge_prorated',
usage_behavior='bill_full',
invoicing_behavior='invoice_now'
)
Token-based authentication with required prefix "Token"
The ID of the subscription to cancel.
The response is of type object
.