A subscription associates one of your customers with one of your billing plans. You can safely give a customer multiple subscriptions to different plans.If you want to give a single customer multiple subscriptions to the same plan (for example, one for each of their environments), you can do that using subscription_filters. For more details on how to use them and what they do, see the subscription filters documentation.If any of your usage components has a prepaid charge associated with it, you can specify how many units they prepaid for as part of this call. If you don’t specify a value, the component’s default value will be used. If there was no default value, the susbcription creation will fail.
The date the subscription starts. This should be a string in YYYY-MM-DD format of the date in UTC time.
customer_id
string | null
required
write-only
The id provided when creating the customer
Minimum string length: 1
end_date
string<date-time>
The date the subscription ends. This should be a string in YYYY-MM-DD format of the date in UTC time. If you don’t set it (recommended), we will use the information in the billing plan to automatically calculate this.
auto_renew
boolean
Whether the subscription automatically renews. Defaults to true.
is_new
boolean
subscription_filters
object[]
Add filter key, value pairs that define which events will be applied to this plan subscription.
Show child attributes
plan_id
string<uuid> | null
write-only
The Lotus plan_id, found in the billing plan object. We will make a best-effort attempt to find the correct plan version (matching preferred currencies, prioritizing custom plans), but if more than one plan version or no plan version matches these criteria this will return an error.
component_fixed_charges_initial_units
object[]
The initial units for the plan components' prepaid fixed charges. This is only required if the plan has plan components where you did not specify the initial units.
Show child attributes
metadata
object
A JSON object containing additional information about the subscription.
Show child attributes
Response
201 - 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/create-subscription","slug":"/api-reference/subscriptions/create-subscription","pageMetadata":{"openapi":"POST /api/subscriptions/","title":"Create a subscription","description":"Add a plan to a customer's subscription","href":"/api-reference/subscriptions/create-subscription"},"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: \"Add a plan to a customer’s subscription\"\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={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`A subscription associates one of your customers with one of your billing plans. You can safely give a customer multiple subscriptions to different plans.`}),`\n`,_jsxs(_components.p,{children:[`If you want to give a single customer multiple subscriptions to the same plan (for example, one for each of their environments), you can do that using `,_jsx(_components.code,{children:`subscription_filters`}),`. For more details on how to use them and what they do, see the `,_jsx(_components.a,{href:`/plan-management/creating-plans#plan-components`,children:`subscription filters`}),` documentation.`]}),`\n`,_jsxs(_components.p,{children:[`If any of your usage components has a `,_jsx(_components.a,{href:`/plan-management/creating-plans#plan-components`,children:`prepaid charge`}),` associated with it, you can specify how many units they prepaid for as part of this call. If you don’t specify a value, the component’s default value will be used. If there was no default value, the susbcription creation will fail.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`5`,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:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`lotus.create_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_6c237d6c149c47db8f64246b78ecac13'`}),_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:` plan_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'plan_f17c6153807d4f4b812265a09cf06680'`}),_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:` start_date`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'2022-02-23 03:30:00+00:00'`}),_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:`5`,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:`5`,children:[_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:`createSubscription`}),_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:` customer_id:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"cust_6c237d6c149c47db8f64246b78ecac13\"`}),_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:` plan_id:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"plan_f17c6153807d4f4b812265a09cf06680\"`}),_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:` start_date:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2022-02-23 03:30:00+00:00\"`}),_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`]})})})]})]})}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":{"openapi":"POST /api/subscriptions/","title":"Create a subscription","description":"Add a plan to a customer's subscription","href":"/api-reference/subscriptions/create-subscription"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"api_subscriptions_create","tags":["api"],"requestBody":"f5208dc4-5d39-4a44-9640-b789f60f8821","security":["ee2ddd84-2d1d-4f3b-8dab-f7dc3c071300","64be6b5b-39e0-41a9-8bc9-363692303270"],"responses":{"201":"a1085ecb-1e2d-433b-a21e-a50fccee676d"},"method":"post","type":"path","servers":[],"path":"/api/subscriptions/","baseUrlOptions":["https://api.uselotus.io"],"title":"","description":"Add a plan to a customer's subscription","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"start_date":{"type":"string","format":"date-time","description":"The date the subscription starts. This should be a string in YYYY-MM-DD format of the date in UTC time.","isRequired":true,"uniqueKey":"start_date","typeLabel":"string\u003cdate-time>"},"customer_id":{"oneOf":[{"type":"string","minLength":1,"description":"The id provided when creating the customer","writeOnly":true,"isRequired":true,"uniqueKey":"customer_id.oneOf.0","typeLabel":"string"},{"type":"null","minLength":1,"description":"The id provided when creating the customer","writeOnly":true,"isRequired":true,"uniqueKey":"customer_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"customer_id","typeLabel":"string | null"},"end_date":{"type":"string","format":"date-time","description":"The date the subscription ends. This should be a string in YYYY-MM-DD format of the date in UTC time. If you don’t set it (recommended), we will use the information in the billing plan to automatically calculate this.","uniqueKey":"end_date","typeLabel":"string\u003cdate-time>"},"auto_renew":{"type":"boolean","description":"Whether the subscription automatically renews. Defaults to true.","uniqueKey":"auto_renew","typeLabel":"boolean"},"is_new":{"type":"boolean","uniqueKey":"is_new","typeLabel":"boolean"},"subscription_filters":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"subscription_filters.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":"subscription_filters.items.[INDEX].property_name","typeLabel":"string"}},"required":["property_name","value"],"uniqueKey":"subscription_filters.items.[INDEX]","typeLabel":"object"},"description":"Add filter key, value pairs that define which events will be applied to this plan subscription.","uniqueKey":"subscription_filters","typeLabel":"object[]"},"plan_id":{"oneOf":[{"type":"string","format":"uuid","writeOnly":true,"description":"The Lotus plan_id, found in the billing plan object. We will make a best-effort attempt to find the correct plan version (matching preferred currencies, prioritizing custom plans), but if more than one plan version or no plan version matches these criteria this will return an error.","uniqueKey":"plan_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","format":"uuid","writeOnly":true,"description":"The Lotus plan_id, found in the billing plan object. We will make a best-effort attempt to find the correct plan version (matching preferred currencies, prioritizing custom plans), but if more than one plan version or no plan version matches these criteria this will return an error.","uniqueKey":"plan_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan_id","typeLabel":"string\u003cuuid> | null"},"component_fixed_charges_initial_units":{"type":"array","items":{"type":"object","properties":{"metric_id":{"type":"string","format":"uuid","writeOnly":true,"description":"The id of the metric that this initial value is for","isRequired":true,"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX].metric_id","typeLabel":"string\u003cuuid>"},"units":{"type":"number","format":"double","maximum":10000000000,"minimum":0,"exclusiveMaximum":true,"description":"The number of units of the metric that this initial value is for","isRequired":true,"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX].units","typeLabel":"number\u003cdouble>"}},"required":["metric_id","units"],"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX]","typeLabel":"object"},"description":"The initial units for the plan components' prepaid fixed charges. This is only required if the plan has plan components where you did not specify the initial units.","uniqueKey":"component_fixed_charges_initial_units","typeLabel":"object[]"},"metadata":{"type":"object","additionalProperties":{"oneOf":[{}],"uniqueKey":"metadata.additionalProperties","typeLabel":"any"},"description":"A JSON object containing additional information about the subscription.","uniqueKey":"metadata","typeLabel":"object"}},"required":["customer_id","start_date"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"start_date":"2023-11-07T05:31:56Z","customer_id":"\u003cstring>","end_date":"2023-11-07T05:31:56Z","auto_renew":true,"is_new":true,"subscription_filters":[{"value":"\u003cstring>","property_name":"\u003cstring>"}],"plan_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","component_fixed_charges_initial_units":[{"metric_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","units":5000000000}],"metadata":{}}}},"exampleType":"generated"},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"start_date":{"type":"string","format":"date-time","description":"The date the subscription starts. This should be a string in YYYY-MM-DD format of the date in UTC time.","isRequired":true,"uniqueKey":"start_date","typeLabel":"string\u003cdate-time>"},"customer_id":{"oneOf":[{"type":"string","minLength":1,"description":"The id provided when creating the customer","writeOnly":true,"isRequired":true,"uniqueKey":"customer_id.oneOf.0","typeLabel":"string"},{"type":"null","minLength":1,"description":"The id provided when creating the customer","writeOnly":true,"isRequired":true,"uniqueKey":"customer_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"customer_id","typeLabel":"string | null"},"end_date":{"type":"string","format":"date-time","description":"The date the subscription ends. This should be a string in YYYY-MM-DD format of the date in UTC time. If you don’t set it (recommended), we will use the information in the billing plan to automatically calculate this.","uniqueKey":"end_date","typeLabel":"string\u003cdate-time>"},"auto_renew":{"type":"boolean","description":"Whether the subscription automatically renews. Defaults to true.","uniqueKey":"auto_renew","typeLabel":"boolean"},"is_new":{"type":"boolean","uniqueKey":"is_new","typeLabel":"boolean"},"subscription_filters":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"subscription_filters.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":"subscription_filters.items.[INDEX].property_name","typeLabel":"string"}},"required":["property_name","value"],"uniqueKey":"subscription_filters.items.[INDEX]","typeLabel":"object"},"description":"Add filter key, value pairs that define which events will be applied to this plan subscription.","uniqueKey":"subscription_filters","typeLabel":"object[]"},"plan_id":{"oneOf":[{"type":"string","format":"uuid","writeOnly":true,"description":"The Lotus plan_id, found in the billing plan object. We will make a best-effort attempt to find the correct plan version (matching preferred currencies, prioritizing custom plans), but if more than one plan version or no plan version matches these criteria this will return an error.","uniqueKey":"plan_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","format":"uuid","writeOnly":true,"description":"The Lotus plan_id, found in the billing plan object. We will make a best-effort attempt to find the correct plan version (matching preferred currencies, prioritizing custom plans), but if more than one plan version or no plan version matches these criteria this will return an error.","uniqueKey":"plan_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan_id","typeLabel":"string\u003cuuid> | null"},"component_fixed_charges_initial_units":{"type":"array","items":{"type":"object","properties":{"metric_id":{"type":"string","format":"uuid","writeOnly":true,"description":"The id of the metric that this initial value is for","isRequired":true,"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX].metric_id","typeLabel":"string\u003cuuid>"},"units":{"type":"number","format":"double","maximum":10000000000,"minimum":0,"exclusiveMaximum":true,"description":"The number of units of the metric that this initial value is for","isRequired":true,"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX].units","typeLabel":"number\u003cdouble>"}},"required":["metric_id","units"],"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX]","typeLabel":"object"},"description":"The initial units for the plan components' prepaid fixed charges. This is only required if the plan has plan components where you did not specify the initial units.","uniqueKey":"component_fixed_charges_initial_units","typeLabel":"object[]"},"metadata":{"type":"object","additionalProperties":{"oneOf":[{}],"uniqueKey":"metadata.additionalProperties","typeLabel":"any"},"description":"A JSON object containing additional information about the subscription.","uniqueKey":"metadata","typeLabel":"object"}},"required":["customer_id","start_date"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"start_date":"2023-11-07T05:31:56Z","customer_id":"\u003cstring>","end_date":"2023-11-07T05:31:56Z","auto_renew":true,"is_new":true,"subscription_filters":[{"value":"\u003cstring>","property_name":"\u003cstring>"}],"plan_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","component_fixed_charges_initial_units":[{"metric_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","units":5000000000}],"metadata":{}}}},"exampleType":"generated"},"multipart/form-data":{"schema":{"type":"object","properties":{"start_date":{"type":"string","format":"date-time","description":"The date the subscription starts. This should be a string in YYYY-MM-DD format of the date in UTC time.","isRequired":true,"uniqueKey":"start_date","typeLabel":"string\u003cdate-time>"},"customer_id":{"oneOf":[{"type":"string","minLength":1,"description":"The id provided when creating the customer","writeOnly":true,"isRequired":true,"uniqueKey":"customer_id.oneOf.0","typeLabel":"string"},{"type":"null","minLength":1,"description":"The id provided when creating the customer","writeOnly":true,"isRequired":true,"uniqueKey":"customer_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"customer_id","typeLabel":"string | null"},"end_date":{"type":"string","format":"date-time","description":"The date the subscription ends. This should be a string in YYYY-MM-DD format of the date in UTC time. If you don’t set it (recommended), we will use the information in the billing plan to automatically calculate this.","uniqueKey":"end_date","typeLabel":"string\u003cdate-time>"},"auto_renew":{"type":"boolean","description":"Whether the subscription automatically renews. Defaults to true.","uniqueKey":"auto_renew","typeLabel":"boolean"},"is_new":{"type":"boolean","uniqueKey":"is_new","typeLabel":"boolean"},"subscription_filters":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"subscription_filters.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":"subscription_filters.items.[INDEX].property_name","typeLabel":"string"}},"required":["property_name","value"],"uniqueKey":"subscription_filters.items.[INDEX]","typeLabel":"object"},"description":"Add filter key, value pairs that define which events will be applied to this plan subscription.","uniqueKey":"subscription_filters","typeLabel":"object[]"},"plan_id":{"oneOf":[{"type":"string","format":"uuid","writeOnly":true,"description":"The Lotus plan_id, found in the billing plan object. We will make a best-effort attempt to find the correct plan version (matching preferred currencies, prioritizing custom plans), but if more than one plan version or no plan version matches these criteria this will return an error.","uniqueKey":"plan_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","format":"uuid","writeOnly":true,"description":"The Lotus plan_id, found in the billing plan object. We will make a best-effort attempt to find the correct plan version (matching preferred currencies, prioritizing custom plans), but if more than one plan version or no plan version matches these criteria this will return an error.","uniqueKey":"plan_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"plan_id","typeLabel":"string\u003cuuid> | null"},"component_fixed_charges_initial_units":{"type":"array","items":{"type":"object","properties":{"metric_id":{"type":"string","format":"uuid","writeOnly":true,"description":"The id of the metric that this initial value is for","isRequired":true,"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX].metric_id","typeLabel":"string\u003cuuid>"},"units":{"type":"number","format":"double","maximum":10000000000,"minimum":0,"exclusiveMaximum":true,"description":"The number of units of the metric that this initial value is for","isRequired":true,"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX].units","typeLabel":"number\u003cdouble>"}},"required":["metric_id","units"],"uniqueKey":"component_fixed_charges_initial_units.items.[INDEX]","typeLabel":"object"},"description":"The initial units for the plan components' prepaid fixed charges. This is only required if the plan has plan components where you did not specify the initial units.","uniqueKey":"component_fixed_charges_initial_units","typeLabel":"object[]"},"metadata":{"type":"object","additionalProperties":{"oneOf":[{}],"uniqueKey":"metadata.additionalProperties","typeLabel":"any"},"description":"A JSON object containing additional information about the subscription.","uniqueKey":"metadata","typeLabel":"object"}},"required":["customer_id","start_date"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"start_date":"2023-11-07T05:31:56Z","customer_id":"\u003cstring>","end_date":"2023-11-07T05:31:56Z","auto_renew":true,"is_new":true,"subscription_filters":[{"value":"\u003cstring>","property_name":"\u003cstring>"}],"plan_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","component_fixed_charges_initial_units":[{"metric_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","units":5000000000}],"metadata":{}}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"a1085ecb-1e2d-433b-a21e-a50fccee676d":{"content":{"application/json":{"schema":{"type":"object","properties":{"subscription_id":{"type":"string","isRequired":true,"uniqueKey":"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":"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":"end_date","typeLabel":"string\u003cdate-time>"},"auto_renew":{"type":"boolean","description":"Whether the subscription automatically renews. Defaults to true.","isRequired":true,"uniqueKey":"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":"is_new","typeLabel":"boolean"},"subscription_filters":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","isRequired":true,"uniqueKey":"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":"subscription_filters.items.[INDEX].property_name","typeLabel":"string"}},"required":["property_name","value"],"uniqueKey":"subscription_filters.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"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":"customer.customer_name.oneOf.0","typeLabel":"string"},{"type":"null","readOnly":true,"description":"The display name of the customer","isRequired":true,"uniqueKey":"customer.customer_name.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"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":"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":"customer.email.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"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":"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":"customer.customer_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"customer.customer_id","typeLabel":"string | null"}},"required":["customer_id","customer_name","email"],"isRequired":true,"uniqueKey":"customer","typeLabel":"object"},"billing_plan":{"type":"object","properties":{"plan_name":{"type":"string","readOnly":true,"isRequired":true,"uniqueKey":"billing_plan.plan_name","typeLabel":"string"},"plan_id":{"type":"string","isRequired":true,"uniqueKey":"billing_plan.plan_id","typeLabel":"string"},"version_id":{"type":"string","readOnly":true,"isRequired":true,"uniqueKey":"billing_plan.version_id","typeLabel":"string"},"version":{"oneOf":[{"type":"integer","isRequired":true,"uniqueKey":"billing_plan.version.oneOf.0","typeLabel":"integer"},{"type":"string","enum":["custom_version"],"isRequired":true,"uniqueKey":"billing_plan.version.oneOf.1","typeLabel":"enum\u003cstring>"}],"isRequired":true,"uniqueKey":"billing_plan.version","typeLabel":"integer | enum\u003cstring>"}},"required":["plan_id","plan_name","version","version_id"],"isRequired":true,"uniqueKey":"billing_plan","typeLabel":"object"},"fully_billed":{"type":"boolean","readOnly":true,"isRequired":true,"uniqueKey":"fully_billed","typeLabel":"boolean"},"addons":{"type":"array","items":{"type":"object","properties":{"addon_subscription_id":{"type":"string","isRequired":true,"uniqueKey":"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":"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":"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":"addons.items.[INDEX].addon.addon_name","typeLabel":"string"},"addon_id":{"type":"string","description":"The ID of the add-on plan.","isRequired":true,"uniqueKey":"addons.items.[INDEX].addon.addon_id","typeLabel":"string"},"addon_type":{"enum":["flat","usage_based"],"type":"string","readOnly":true,"isRequired":true,"uniqueKey":"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":"addons.items.[INDEX].addon.billing_frequency","typeLabel":"enum\u003cstring>"}},"required":["addon_id","addon_name","addon_type","billing_frequency"],"isRequired":true,"uniqueKey":"addons.items.[INDEX].addon","typeLabel":"object"},"fully_billed":{"type":"boolean","readOnly":true,"isRequired":true,"uniqueKey":"addons.items.[INDEX].fully_billed","typeLabel":"boolean"}},"required":["addon","addon_subscription_id","end_date","fully_billed","start_date"],"uniqueKey":"addons.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"addons","typeLabel":"object[]"},"metadata":{"type":"object","additionalProperties":{"oneOf":[{}],"uniqueKey":"metadata.additionalProperties","typeLabel":"any"},"isRequired":true,"uniqueKey":"metadata","typeLabel":"object"}},"required":["addons","auto_renew","billing_plan","customer","end_date","fully_billed","is_new","metadata","start_date","subscription_filters","subscription_id"],"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":{"ee2ddd84-2d1d-4f3b-8dab-f7dc3c071300":{"knoxTokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\"","scopes":[]}},"64be6b5b-39e0-41a9-8bc9-363692303270":{"OrganizationApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","scopes":[]},"TokenAuth":{"$ref":"e4c743ce-da98-4bb9-8248-15b556344f33","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":"Create a subscription - Lotus","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-06T22:43:31.529Z","originalFileLocation":"api-reference/subscriptions/create-subscription.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=\"Add a plan to a customer\u0026#x27;s subscription\">\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=\"Create a subscription - Lotus\">\u003cmeta data-mint-head property=\"og:description\" content=\"Add a plan to a customer\u0026#x27;s subscription\">\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/create-subscription\">\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=Subscriptions\u0026amp;title=Create+a+subscription\u0026amp;description=Add+a+plan+to+a+customer%27s+subscription\u0026amp;theme=850f94eaa8b43b0c4fea2974\u0026amp;signature=8022af850247e6792b56c839098cd59d091d0ee2308a45b0e6b0438f4db312e4\">\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=\"Create a subscription - Lotus\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Add a plan to a customer\u0026#x27;s subscription\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lotus.mintlify.site/_mintlify/api/og/v2?division=Subscriptions\u0026amp;title=Create+a+subscription\u0026amp;description=Add+a+plan+to+a+customer%27s+subscription\u0026amp;theme=850f94eaa8b43b0c4fea2974\u0026amp;signature=8022af850247e6792b56c839098cd59d091d0ee2308a45b0e6b0438f4db312e4\">\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/create-subscription\">\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/create-subscription.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/create-subscription#webpage\",\"url\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription\",\"name\":\"Create a subscription\",\"description\":\"Add a plan to a customer's subscription\",\"dateModified\":\"2026-01-06T22:43:31.529Z\",\"isPartOf\":{\"@id\":\"https://docs.uselotus.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.uselotus.io/api-reference/api-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a subscription\",\"item\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription#apireference\",\"headline\":\"Create a subscription\",\"name\":\"Create a subscription\",\"description\":\"Add a plan to a customer's subscription\",\"url\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription\",\"mainEntityOfPage\":{\"@id\":\"https://docs.uselotus.io/api-reference/subscriptions/create-subscription#webpage\"},\"dateModified\":\"2026-01-06T22:43:31.529Z\",\"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/create-subscription.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","description":null,"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","description":"Cancels a subscription. You can modify the behavior of the cancellation based on the arguments passed to the call.","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","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/","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":"Create 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"]}