Token-based authentication with required prefix "Token"
Query Parameters
customer_id
string | null
required
Filter to a specific customer.
Minimum string length: 1
plan_id
string<uuid>
Filter to a specific plan. If not specified, all plans will be included in the cancellation request.
subscription_filters
object[]
Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.
When canceling a subscription, the behavior used to calculate the flat fee. If null or not provided, the charge's default behavior will be used according to the subscription's start and end dates. If charge_full, the full flat fee will be charged, regardless of the duration of the subscription. If refund, the flat fee will not be charged. If charge_prorated, the prorated flat fee will be charged.
refund - Refund
charge_prorated - Prorate
charge_full - Charge Full
Available options:
refund,
charge_prorated,
charge_full,
null
usage_behavior
enum<string>
default:bill_full
If bill_full, current usage will be billed on the invoice. If bill_none, current unbilled usage will be dropped from the invoice. Defaults to bill_full.
bill_full - Bill Full
bill_none - Bill None
Available options:
bill_full,
bill_none
invoicing_behavior
enum<string>
default:invoice_now
Whether to invoice now or invoice at the end of the billing period. Defaults to invoice now.
add_to_next_invoice - Add to Next Invoice
invoice_now - Invoice Now
Available options:
add_to_next_invoice,
invoice_now
Response
200 - application/json
subscription_id
string
required
start_date
string<date-time>
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<date-time>
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
Show child attributes
customer
object
required
Show child attributes
billing_plan
object
required
Show child attributes
fully_billed
boolean
required
read-only
addons
object[]
required
Show child attributes
metadata
object
required
Show child attributes
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Lotus","colors":{"primary":"#C3986B","light":"#FFECD2","dark":"#3A3A3A"},"favicon":"https://mintcdn.com/lotus/HlrVno1vSHfnJwCd/favicon.png?fit=max\u0026auto=format\u0026n=HlrVno1vSHfnJwCd\u0026q=85\u0026s=f00ab5bfd2b64dc25cf303cb98465466","logo":{"light":"https://mintcdn.com/lotus/HlrVno1vSHfnJwCd/logo/light.svg?fit=max\u0026auto=format\u0026n=HlrVno1vSHfnJwCd\u0026q=85\u0026s=4682f6784b28863e5693f044eeb5cc43","dark":"https://mintcdn.com/lotus/HlrVno1vSHfnJwCd/logo/dark.svg?fit=max\u0026auto=format\u0026n=HlrVno1vSHfnJwCd\u0026q=85\u0026s=72afa819a0c40b3f39e7528d403b1fc8"},"api":{"openapi":"openapi.yaml","mdx":{"server":"https://api.uselotus.io","auth":{"method":"key","name":"X-API-KEY"}}},"background":{"decoration":null,"color":{"light":null,"dark":"#171717"}},"navbar":{"links":[{"label":"GitHub Repo","href":"https://github.com/uselotus/lotus"}],"primary":{"type":"button","label":"Sign Up","href":"https://form.typeform.com/to/pehx2YSQ"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/uselotusio/","twitter":"https://twitter.com/uselotusio","instagram":"https://www.instagram.com/uselotusio/"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lotus","hasAudioNarration":false,"actualSubdomain":"lotus","customDomains":["docs.uselotus.io"],"gitSource":{"type":"github","owner":"uselotus","repo":"lotus","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a98bddf12e4713d1d355344","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"API Reference","count":60},{"language":"default","tag":"Documentation","count":24},{"language":"default","tag":"Subscriptions","count":11},{"language":"default","tag":"Credits","count":5},{"language":"default","tag":"External Integrations","count":5},{"language":"default","tag":"Subscription Lifecycle","count":5},{"language":"default","tag":"Overview","count":4},{"language":"default","tag":"Customers","count":3},{"language":"default","tag":"Invoices","count":3},{"language":"default","tag":"Deprecated Methods","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/subscriptions/cancel-subscription-old","slug":"/api-reference/subscriptions/cancel-subscription-old","pageMetadata":{"title":"Cancel a subscription","description":"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.","openapi":"POST /api/subscriptions/cancel/","href":"/api-reference/subscriptions/cancel-subscription-old"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,hr:`hr`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);return _jsxs(_Fragment,{children:[_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`25`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`25`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`lotus.cancel_subscription(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` customer_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'cust_0569173ee6654369'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` subscription_filters`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"property_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` flat_fee_behavior`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'charge_prorated'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` bill_usage`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` invoicing_behavior`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'add_to_next_invoice'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`lotus.cancel_subscription(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` plan_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'plan_A'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` subscription_filters`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"property_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"created_date\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2020-08-15\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` flat_fee_behavior`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'charge_full'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` bill_usage`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` invoicing_behavior`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'invoice_now'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Typescript`,numberOfLines:`10`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lotus`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`cancelSubscription`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` planId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"plan234234\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` billUsage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"false\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customerId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` invoicingBehavior`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"add_to_next_invoice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` flatFeeBehavior`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"prorate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` usageBehavior`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bill_none\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` subscriptionFilters`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`property_name:project_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`value:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`23414`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(_components.hr,{})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Cancel a subscription","description":"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.","openapi":"POST /api/subscriptions/cancel/","href":"/api-reference/subscriptions/cancel-subscription-old"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"api_subscriptions_cancel_create","parameters":["5f689364-abfb-4294-baef-c0e57ebfc372","9f68a30f-55ee-4bcc-86dc-4878f21b258c","50473ef4-cc04-4b09-a47f-f3207afd514a"],"tags":["api"],"requestBody":"15264dfb-3034-42f4-9fd4-0b941301d52d","security":["f9193beb-510b-485b-9af9-1c5a06ea0906","7be9ef7f-3d60-4d16-b551-4072db89b91a"],"deprecated":true,"responses":{"200":"7835bb4f-98cd-4bd8-9383-af96f2105ee6"},"method":"post","type":"path","servers":[],"path":"/api/subscriptions/cancel/","baseUrlOptions":["https://api.uselotus.io"],"title":"","description":"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"5f689364-abfb-4294-baef-c0e57ebfc372":{"in":"query","name":"customer_id","schema":{"oneOf":[{"type":"string","minLength":1,"description":"Filter to a specific customer.","isRequired":true,"uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","minLength":1,"description":"Filter to a specific customer.","isRequired":true,"uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"","typeLabel":"string | null"},"description":"Filter to a specific customer.","required":true},"9f68a30f-55ee-4bcc-86dc-4878f21b258c":{"in":"query","name":"plan_id","schema":{"type":"string","format":"uuid","description":"Filter to a specific plan. If not specified, all plans will be included in the cancellation request.","uniqueKey":"","typeLabel":"string\u003cuuid>"},"description":"Filter to a specific plan. If not specified, all plans will be included in the cancellation request."},"50473ef4-cc04-4b09-a47f-f3207afd514a":{"in":"query","name":"subscription_filters","schema":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"items.[INDEX].value","typeLabel":"string"},"property_name":{"type":"string","minLength":1,"description":"The string name of the property to filter on. Example: 'product_id'","isRequired":true,"uniqueKey":"items.[INDEX].property_name","typeLabel":"string"}},"required":["property_name","value"],"uniqueKey":"items.[INDEX]","typeLabel":"object"},"description":"Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.","uniqueKey":"","typeLabel":"object[]"},"description":"Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"flat_fee_behavior":{"oneOf":[{"enum":["refund","charge_prorated","charge_full",null],"type":"string","description":"When canceling a subscription, the behavior used to calculate the flat fee. If null or not provided, the charge's default behavior will be used according to the subscription's start and end dates. If charge_full, the full flat fee will be charged, regardless of the duration of the subscription. If refund, the flat fee will not be charged. If charge_prorated, the prorated flat fee will be charged.\n\n* `refund` - Refund\n* `charge_prorated` - Prorate\n* `charge_full` - Charge Full","uniqueKey":"flat_fee_behavior.oneOf.0","typeLabel":"enum\u003cstring>"},{"enum":["refund","charge_prorated","charge_full",null],"type":"null","description":"When canceling a subscription, the behavior used to calculate the flat fee. If null or not provided, the charge's default behavior will be used according to the subscription's start and end dates. If charge_full, the full flat fee will be charged, regardless of the duration of the subscription. If refund, the flat fee will not be charged. If charge_prorated, the prorated flat fee will be charged.\n\n* `refund` - Refund\n* `charge_prorated` - Prorate\n* `charge_full` - Charge Full","uniqueKey":"flat_fee_behavior.oneOf.1","typeLabel":"null"}],"uniqueKey":"flat_fee_behavior","typeLabel":"enum\u003cstring> | null"},"usage_behavior":{"enum":["bill_full","bill_none"],"type":"string","default":"bill_full","description":"If bill_full, current usage will be billed on the invoice. If bill_none, current unbilled usage will be dropped from the invoice. Defaults to bill_full.\n\n* `bill_full` - Bill Full\n* `bill_none` - Bill None","uniqueKey":"usage_behavior","typeLabel":"enum\u003cstring>"},"invoicing_behavior":{"enum":["add_to_next_invoice","invoice_now"],"type":"string","default":"invoice_now","description":"Whether to invoice now or invoice at the end of the billing period. Defaults to invoice now.\n\n* `add_to_next_invoice` - Add to Next Invoice\n* `invoice_now` - Invoice Now","uniqueKey":"invoicing_behavior","typeLabel":"enum\u003cstring>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"usage_behavior":"bill_full","invoicing_behavior":"invoice_now"}}},"exampleType":"generated"},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"flat_fee_behavior":{"oneOf":[{"enum":["refund","charge_prorated","charge_full",null],"type":"string","description":"When canceling a subscription, the behavior used to calculate the flat fee. If null or not provided, the charge's default behavior will be used according to the subscription's start and end dates. If charge_full, the full flat fee will be charged, regardless of the duration of the subscription. If refund, the flat fee will not be charged. If charge_prorated, the prorated flat fee will be charged.\n\n* `refund` - Refund\n* `charge_prorated` - Prorate\n* `charge_full` - Charge Full","uniqueKey":"flat_fee_behavior.oneOf.0","typeLabel":"enum\u003cstring>"},{"enum":["refund","charge_prorated","charge_full",null],"type":"null","description":"When canceling a subscription, the behavior used to calculate the flat fee. If null or not provided, the charge's default behavior will be used according to the subscription's start and end dates. If charge_full, the full flat fee will be charged, regardless of the duration of the subscription. If refund, the flat fee will not be charged. If charge_prorated, the prorated flat fee will be charged.\n\n* `refund` - Refund\n* `charge_prorated` - Prorate\n* `charge_full` - Charge Full","uniqueKey":"flat_fee_behavior.oneOf.1","typeLabel":"null"}],"uniqueKey":"flat_fee_behavior","typeLabel":"enum\u003cstring> | null"},"usage_behavior":{"enum":["bill_full","bill_none"],"type":"string","default":"bill_full","description":"If bill_full, current usage will be billed on the invoice. If bill_none, current unbilled usage will be dropped from the invoice. Defaults to bill_full.\n\n* `bill_full` - Bill Full\n* `bill_none` - Bill None","uniqueKey":"usage_behavior","typeLabel":"enum\u003cstring>"},"invoicing_behavior":{"enum":["add_to_next_invoice","invoice_now"],"type":"string","default":"invoice_now","description":"Whether to invoice now or invoice at the end of the billing period. Defaults to invoice now.\n\n* `add_to_next_invoice` - Add to Next Invoice\n* `invoice_now` - Invoice Now","uniqueKey":"invoicing_behavior","typeLabel":"enum\u003cstring>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"usage_behavior":"bill_full","invoicing_behavior":"invoice_now"}}},"exampleType":"generated"},"multipart/form-data":{"schema":{"type":"object","properties":{"flat_fee_behavior":{"oneOf":[{"enum":["refund","charge_prorated","charge_full",null],"type":"string","description":"When canceling a subscription, the behavior used to calculate the flat fee. If null or not provided, the charge's default behavior will be used according to the subscription's start and end dates. If charge_full, the full flat fee will be charged, regardless of the duration of the subscription. If refund, the flat fee will not be charged. If charge_prorated, the prorated flat fee will be charged.\n\n* `refund` - Refund\n* `charge_prorated` - Prorate\n* `charge_full` - Charge Full","uniqueKey":"flat_fee_behavior.oneOf.0","typeLabel":"enum\u003cstring>"},{"enum":["refund","charge_prorated","charge_full",null],"type":"null","description":"When canceling a subscription, the behavior used to calculate the flat fee. If null or not provided, the charge's default behavior will be used according to the subscription's start and end dates. If charge_full, the full flat fee will be charged, regardless of the duration of the subscription. If refund, the flat fee will not be charged. If charge_prorated, the prorated flat fee will be charged.\n\n* `refund` - Refund\n* `charge_prorated` - Prorate\n* `charge_full` - Charge Full","uniqueKey":"flat_fee_behavior.oneOf.1","typeLabel":"null"}],"uniqueKey":"flat_fee_behavior","typeLabel":"enum\u003cstring> | null"},"usage_behavior":{"enum":["bill_full","bill_none"],"type":"string","default":"bill_full","description":"If bill_full, current usage will be billed on the invoice. If bill_none, current unbilled usage will be dropped from the invoice. Defaults to bill_full.\n\n* `bill_full` - Bill Full\n* `bill_none` - Bill None","uniqueKey":"usage_behavior","typeLabel":"enum\u003cstring>"},"invoicing_behavior":{"enum":["add_to_next_invoice","invoice_now"],"type":"string","default":"invoice_now","description":"Whether to invoice now or invoice at the end of the billing period. Defaults to invoice now.\n\n* `add_to_next_invoice` - Add to Next Invoice\n* `invoice_now` - Invoice Now","uniqueKey":"invoicing_behavior","typeLabel":"enum\u003cstring>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"usage_behavior":"bill_full","invoicing_behavior":"invoice_now"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"7835bb4f-98cd-4bd8-9383-af96f2105ee6":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"subscription_id":{"type":"string","isRequired":true,"uniqueKey":"items.[INDEX].subscription_id","typeLabel":"string"},"start_date":{"type":"string","format":"date-time","description":"The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.","isRequired":true,"uniqueKey":"items.[INDEX].start_date","typeLabel":"string\u003cdate-time>"},"end_date":{"type":"string","format":"date-time","description":"The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.","isRequired":true,"uniqueKey":"items.[INDEX].end_date","typeLabel":"string\u003cdate-time>"},"auto_renew":{"type":"boolean","description":"Whether the subscription automatically renews. Defaults to true.","isRequired":true,"uniqueKey":"items.[INDEX].auto_renew","typeLabel":"boolean"},"is_new":{"type":"boolean","description":"Whether this subscription came from a renewal or from a first-time. Defaults to true on creation.","isRequired":true,"uniqueKey":"items.[INDEX].is_new","typeLabel":"boolean"},"subscription_filters":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","isRequired":true,"uniqueKey":"items.[INDEX].subscription_filters.items.[INDEX].value","typeLabel":"string"},"property_name":{"type":"string","description":"The string name of the property to filter on. Example: 'product_id'","isRequired":true,"uniqueKey":"items.[INDEX].subscription_filters.items.[INDEX].property_name","typeLabel":"string"}},"required":["property_name","value"],"uniqueKey":"items.[INDEX].subscription_filters.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"items.[INDEX].subscription_filters","typeLabel":"object[]"},"customer":{"type":"object","properties":{"customer_name":{"oneOf":[{"type":"string","readOnly":true,"description":"The display name of the customer","isRequired":true,"uniqueKey":"items.[INDEX].customer.customer_name.oneOf.0","typeLabel":"string"},{"type":"null","readOnly":true,"description":"The display name of the customer","isRequired":true,"uniqueKey":"items.[INDEX].customer.customer_name.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"items.[INDEX].customer.customer_name","typeLabel":"string | null"},"email":{"oneOf":[{"type":"string","format":"email","readOnly":true,"description":"The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider","isRequired":true,"uniqueKey":"items.[INDEX].customer.email.oneOf.0","typeLabel":"string\u003cemail>"},{"type":"null","format":"email","readOnly":true,"description":"The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider","isRequired":true,"uniqueKey":"items.[INDEX].customer.email.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"items.[INDEX].customer.email","typeLabel":"string\u003cemail> | null"},"customer_id":{"oneOf":[{"type":"string","readOnly":true,"description":"The id provided when creating the customer, we suggest matching with your internal customer id in your backend","isRequired":true,"uniqueKey":"items.[INDEX].customer.customer_id.oneOf.0","typeLabel":"string"},{"type":"null","readOnly":true,"description":"The id provided when creating the customer, we suggest matching with your internal customer id in your backend","isRequired":true,"uniqueKey":"items.[INDEX].customer.customer_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"items.[INDEX].customer.customer_id","typeLabel":"string | null"}},"required":["customer_id","customer_name","email"],"isRequired":true,"uniqueKey":"items.[INDEX].customer","typeLabel":"object"},"billing_plan":{"type":"object","properties":{"plan_name":{"type":"string","readOnly":true,"isRequired":true,"uniqueKey":"items.[INDEX].billing_plan.plan_name","typeLabel":"string"},"plan_id":{"type":"string","isRequired":true,"uniqueKey":"items.[INDEX].billing_plan.plan_id","typeLabel":"string"},"version_id":{"type":"string","readOnly":true,"isRequired":true,"uniqueKey":"items.[INDEX].billing_plan.version_id","typeLabel":"string"},"version":{"oneOf":[{"type":"integer","isRequired":true,"uniqueKey":"items.[INDEX].billing_plan.version.oneOf.0","typeLabel":"integer"},{"type":"string","enum":["custom_version"],"isRequired":true,"uniqueKey":"items.[INDEX].billing_plan.version.oneOf.1","typeLabel":"enum\u003cstring>"}],"isRequired":true,"uniqueKey":"items.[INDEX].billing_plan.version","typeLabel":"integer | enum\u003cstring>"}},"required":["plan_id","plan_name","version","version_id"],"isRequired":true,"uniqueKey":"items.[INDEX].billing_plan","typeLabel":"object"},"fully_billed":{"type":"boolean","readOnly":true,"isRequired":true,"uniqueKey":"items.[INDEX].fully_billed","typeLabel":"boolean"},"addons":{"type":"array","items":{"type":"object","properties":{"addon_subscription_id":{"type":"string","isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].addon_subscription_id","typeLabel":"string"},"start_date":{"type":"string","format":"date-time","readOnly":true,"description":"The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.","isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].start_date","typeLabel":"string\u003cdate-time>"},"end_date":{"type":"string","format":"date-time","readOnly":true,"description":"The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.","isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].end_date","typeLabel":"string\u003cdate-time>"},"addon":{"type":"object","properties":{"addon_name":{"type":"string","description":"The name of the add-on plan.","isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].addon.addon_name","typeLabel":"string"},"addon_id":{"type":"string","description":"The ID of the add-on plan.","isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].addon.addon_id","typeLabel":"string"},"addon_type":{"enum":["flat","usage_based"],"type":"string","readOnly":true,"isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].addon.addon_type","typeLabel":"enum\u003cstring>"},"billing_frequency":{"enum":["one_time","recurring"],"description":"* `one_time` - one_time\n* `recurring` - recurring","readOnly":true,"type":"string","isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].addon.billing_frequency","typeLabel":"enum\u003cstring>"}},"required":["addon_id","addon_name","addon_type","billing_frequency"],"isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].addon","typeLabel":"object"},"fully_billed":{"type":"boolean","readOnly":true,"isRequired":true,"uniqueKey":"items.[INDEX].addons.items.[INDEX].fully_billed","typeLabel":"boolean"}},"required":["addon","addon_subscription_id","end_date","fully_billed","start_date"],"uniqueKey":"items.[INDEX].addons.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"items.[INDEX].addons","typeLabel":"object[]"},"metadata":{"type":"object","additionalProperties":{"oneOf":[{}],"uniqueKey":"items.[INDEX].metadata.additionalProperties","typeLabel":"any"},"isRequired":true,"uniqueKey":"items.[INDEX].metadata","typeLabel":"object"}},"required":["addons","auto_renew","billing_plan","customer","end_date","fully_billed","is_new","metadata","start_date","subscription_filters","subscription_id"],"uniqueKey":"items.[INDEX]","typeLabel":"object"},"uniqueKey":"","typeLabel":"object[]"},"examples":{"Example":{"title":"Example","value":[{"subscription_id":"\u003cstring>","start_date":"2023-11-07T05:31:56Z","end_date":"2023-11-07T05:31:56Z","auto_renew":true,"is_new":true,"subscription_filters":[{"value":"\u003cstring>","property_name":"\u003cstring>"}],"customer":{"customer_name":"\u003cstring>","email":"jsmith@example.com","customer_id":"\u003cstring>"},"billing_plan":{"plan_name":"\u003cstring>","plan_id":"\u003cstring>","version_id":"\u003cstring>","version":123},"fully_billed":true,"addons":[{"addon_subscription_id":"\u003cstring>","start_date":"2023-11-07T05:31:56Z","end_date":"2023-11-07T05:31:56Z","addon":{"addon_name":"\u003cstring>","addon_id":"\u003cstring>","addon_type":"flat","billing_frequency":"one_time"},"fully_billed":true}],"metadata":{}}]}},"exampleType":"generated"}},"description":"","exampleType":"generated"}},"security":{"f9193beb-510b-485b-9af9-1c5a06ea0906":{"knoxTokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\"","scopes":[]}},"7be9ef7f-3d60-4d16-b551-4072db89b91a":{"OrganizationApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","scopes":[]},"TokenAuth":{"$ref":"d63a4023-500e-4ba4-a5cf-4822bb5b0285","scopes":[]}}},"servers":{},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\"","scopes":[]},"schema":{"title":"Authorization","type":"string","description":"Token-based authentication with required prefix \"Token\"","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"knoxTokenAuth","name":"Authorization"}],"title":"knoxTokenAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"X-API-KEY","scopes":[]},"schema":{"title":"X-API-KEY","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"OrganizationApiKeyAuth","name":"X-API-KEY"}],"title":"OrganizationApiKeyAuth"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"lotus","siteName":"Lotus","title":"Cancel a subscription - Lotus","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-06T22:43:31.526Z","originalFileLocation":"api-reference/subscriptions/cancel-subscription-old.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Lotus\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Cancel a subscription - Lotus\">\u003cmeta data-mint-head property=\"og:description\" content=\"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Lotus\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lotus.mintlify.site/_mintlify/api/og/v2?division=Deprecated+Methods\u0026amp;title=Cancel+a+subscription\u0026amp;description=Cancels+a+subscription.+You+can+modify+the+behavior+of+the+cancellation+based+on+the+arguments+passed+to+the+call.\u0026amp;theme=850f94eaa8b43b0c4fea2974\u0026amp;signature=7520e0c5375c4617b5393fb0f3d5cadef1d40edd5968e58744ea64f447ffedd8\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Cancel a subscription - Lotus\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lotus.mintlify.site/_mintlify/api/og/v2?division=Deprecated+Methods\u0026amp;title=Cancel+a+subscription\u0026amp;description=Cancels+a+subscription.+You+can+modify+the+behavior+of+the+cancellation+based+on+the+arguments+passed+to+the+call.\u0026amp;theme=850f94eaa8b43b0c4fea2974\u0026amp;signature=7520e0c5375c4617b5393fb0f3d5cadef1d40edd5968e58744ea64f447ffedd8\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/lotus/MiITvKPMr80Jfh6t/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Lotus\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#C3986B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/subscriptions/cancel-subscription-old.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.uselotus.io/#organization\",\"name\":\"Lotus\",\"url\":\"https://docs.uselotus.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lotus/HlrVno1vSHfnJwCd/logo/light.svg?fit=max\u0026auto=format\u0026n=HlrVno1vSHfnJwCd\u0026q=85\u0026s=4682f6784b28863e5693f044eeb5cc43\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.uselotus.io#website\",\"name\":\"Lotus\",\"url\":\"https://docs.uselotus.io\",\"publisher\":{\"@id\":\"https://docs.uselotus.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old#webpage\",\"url\":\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old\",\"name\":\"Cancel a subscription\",\"description\":\"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.\",\"dateModified\":\"2026-01-06T22:43:31.526Z\",\"isPartOf\":{\"@id\":\"https://docs.uselotus.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.uselotus.io/api-reference/api-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Subscriptions\",\"item\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Deprecated Methods\",\"item\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription-old\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Cancel a subscription\",\"item\":\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old#apireference\",\"headline\":\"Cancel a subscription\",\"name\":\"Cancel a subscription\",\"description\":\"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.\",\"url\":\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old\",\"mainEntityOfPage\":{\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/cancel-subscription-old#webpage\"},\"dateModified\":\"2026-01-06T22:43:31.526Z\",\"publisher\":{\"@id\":\"https://docs.uselotus.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.uselotus.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Lotus\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Lotus\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/subscriptions/cancel-subscription-old.md","siteName":"Lotus","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/overview/why-lotus"}]},{"anchor":"API Reference","icon":"square-terminal","groups":[{"group":"API Reference","pages":[{"title":"API Overview","openapi":"GET /api/ping/","href":"/api-reference/api-overview"},{"group":"SDK Setup","pages":[{"title":"Python Library","href":"/api-reference/python-guide"},{"title":"Typescript Library","href":"/api-reference/typescript-guide"}]},{"group":"Events","pages":[{"openapi":"POST /api/track/","title":null,"href":"/api-reference/events/tracking"},{"openapi":"POST /api/verify_idems_received/","title":"Verify Event Ingestion","href":"/api-reference/events/verify-ingestion"}]},{"group":"Customers","pages":[{"title":"Create a customer","openapi":"POST /api/customers/","href":"/api-reference/customers/create-customer"},{"title":"Get a customer","openapi":"GET /api/customers/{customer_id}/","href":"/api-reference/customers/retrieve-customer"},{"title":"List customers","openapi":"GET /api/customers/","href":"/api-reference/customers/list-customers"}]},{"group":"Entitlements","pages":[{"openapi":"GET /api/feature_access/","title":"Get Feature Access","href":"/api-reference/access/feature-access"},{"openapi":"GET /api/metric_access/","title":"Get Metric Access","href":"/api-reference/access/metric-access"}]},{"group":"Subscriptions","pages":[{"openapi":"POST /api/subscriptions/","title":"Create a subscription","href":"/api-reference/subscriptions/create-subscription"},{"title":"Cancel a subscription","openapi":"POST /api/subscriptions/{subscription_id}/cancel/","href":"/api-reference/subscriptions/cancel-subscription"},{"title":"Update a subscription","openapi":"POST /api/subscriptions/{subscription_id}/update/","href":"/api-reference/subscriptions/change-subscription"},{"title":"Switch a subscription's plan","openapi":"POST /api/subscriptions/{subscription_id}/switch_plan/","href":"/api-reference/subscriptions/switch-subscription-plan"},{"title":"Change Prepaid Units","openapi":"POST /api/subscriptions/{subscription_id}/components/{metric_id}/change_prepaid_units/","href":"/api-reference/subscriptions/change-prepaid-units"},{"openapi":"POST /api/subscriptions/{subscription_id}/addons/attach/","title":"Attach an Add-On","href":"/api-reference/subscriptions/attach-addon"},{"openapi":"POST /api/subscriptions/{subscription_id}/addons/{addon_id}/cancel/","title":"Cancel an Add-On","href":"/api-reference/subscriptions/cancel-addon"},{"title":"List subscriptions","openapi":"GET /api/subscriptions/","href":"/api-reference/subscriptions/list-subscriptions"},{"group":"Deprecated Methods","pages":[{"openapi":"POST /api/subscriptions/add/","title":"Create a subscription","description":"Add a plan to a customer's subscription","href":"/api-reference/subscriptions/create-subscription-old"},{"title":"Cancel a subscription","openapi":"POST /api/subscriptions/cancel/","href":"/api-reference/subscriptions/cancel-subscription-old"},{"title":"Update a subscription","openapi":"POST /api/subscriptions/update/","description":"Upgrade, downgrade or cancel autorenew for a subscription plan","href":"/api-reference/subscriptions/change-subscription-old"}]}]},{"group":"Plans","pages":[{"title":"List plans","openapi":"GET /api/plans/","href":"/api-reference/plans/list-plans"},{"openapi":"GET /api/plans/{plan_id}/","title":"Get Plan","href":"/api-reference/plans/retrieve-plan"}]},{"group":"Invoices","pages":[{"title":"List invoices","openapi":"GET /api/invoices/","href":"/api-reference/invoices/list-invoices"},{"title":"Get invoice","openapi":"GET /api/invoices/{invoice_id}/","href":"/api-reference/invoices/get-invoice"},{"title":"Get Invoice PDF","openapi":"GET /api/invoices/{invoice_id}/pdf_url/","href":"/api-reference/invoices/get-invoice-pdf"}]},{"group":"Credits","pages":[{"title":"List credits","openapi":"GET /api/credits/","href":"/api-reference/credits/list-credits"},{"title":"Create a credit","openapi":"POST /api/credits/","href":"/api-reference/credits/create-credit"},{"title":"Void credit","openapi":"POST /api/credits/{credit_id}/void/","href":"/api-reference/credits/void-credit"},{"title":"Update credit","openapi":"POST /api/credits/{credit_id}/update/","href":"/api-reference/credits/update-credit"}]}]}]},{"anchor":"Blog","href":"https://www.uselotus.io/journal","icon":"newspaper"},{"anchor":"Github","href":"https://github.com/uselotus/lotus","icon":"github"},{"anchor":"Community","href":"https://join.slack.com/t/lotus-community/shared_invite/zt-1ghi61p9j-ADYbp3tEL~N16AxQr2mlzA","icon":"slack"}]},"basePath":"","title":"Cancel a subscription - Lotus","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C6Z1vAfX.js","snippetPresets-Bjd6OXRM.js","utils-QL6OhUyF.js","style-to-object-BY3JEAdk.js","utils-Dsq-HLeF.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-CEYfmkoV.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CHgPjMM8.js","_Uint8Array-IXRJ_ueo.js","isObject-FP1Yky1u.js","ApiExamples-pq4ns9YA.js","usePlaygroundInputsStore-D-gnigmo.js","shallow-DIfWGPrf.js","isEqual-DDFuixlH.js","CodeSnippets-8g5rilZj.js","CodeSnippet-C_J7pouP.js","use-playground-group-access-bkOyfPao.js","Page-B_smDgrp.js","api-description-markdown-DtcP2u3s.js","DynamicMarkdown-DOefW1_8.js","SectionHeading-Cg4lfWZw.js","MethodPill-BnqygvYm.js","getPastedJson-BGXYEZ3P.js","Check2Icon-BBeO3TOS.js","axios-CsQoIw0U.js","Markdown-D5IqLG6A.js","AssistantPageLink-_S2h4i6W.js","dist-DzZqOeCq.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}