Create a subscription
/api/subscriptions/add/
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/add/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"customer_id": "<customer_id>",
"start_date": "<start_date>"
}'
{
"addons": [
{
"addon": {
"addon_id": "string",
"addon_name": "string",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"addon_subscription_id": "string",
"end_date": "string",
"fully_billed": "boolean",
"start_date": "string"
}
],
"auto_renew": "boolean",
"billing_plan": {
"plan_id": "string",
"plan_name": "string",
"version_id": "string"
},
"customer": {
"customer_id": "string",
"customer_name": "string",
"email": "string"
},
"end_date": "string",
"fully_billed": "boolean",
"is_new": "boolean",
"metadata": "object",
"start_date": "string",
"subscription_filters": [
{
"property_name": "string",
"value": "string"
}
],
"subscription_id": "string"
}
A subscription associates one of your customers with one of your billing plans. You can define multiple subscriptions of the same plan for a single customer by using the subscription filters.
lotus.create_subscription(
customer_id='cust_0569173ee6654369',
plan_id='premium_plan_7ui9op',
start_date='2020-01-01',
)
Authorizations
Token-based authentication with required prefix "Token"
Body
Whether the subscription automatically renews. Defaults to true.
The id provided when creating the customer
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.
The Lotus plan_id, found in the billing plan object. This field has been deprecated in favor of version_id for the sake of being explicit. If used, a best effort will be made to find the correct plan version (matching preferred currencies, prioritizing custom plans), but if more than one plan versions matches this criteria this will return an error.
The date the subscription starts. This should be a string in YYYY-MM-DD format of the date in UTC time.
Add filter key, value pairs that define which events will be applied to this plan subscription.
Response
Whether the subscription automatically renews. Defaults to true.
The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
Whether this subscription came from a renewal or from a first-time. Defaults to true on creation.
The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/add/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"customer_id": "<customer_id>",
"start_date": "<start_date>"
}'
{
"addons": [
{
"addon": {
"addon_id": "string",
"addon_name": "string",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"addon_subscription_id": "string",
"end_date": "string",
"fully_billed": "boolean",
"start_date": "string"
}
],
"auto_renew": "boolean",
"billing_plan": {
"plan_id": "string",
"plan_name": "string",
"version_id": "string"
},
"customer": {
"customer_id": "string",
"customer_name": "string",
"email": "string"
},
"end_date": "string",
"fully_billed": "boolean",
"is_new": "boolean",
"metadata": "object",
"start_date": "string",
"subscription_filters": [
{
"property_name": "string",
"value": "string"
}
],
"subscription_id": "string"
}