Deprecated Methods
Update a subscription
POST

/api/subscriptions/update/

X-API-KEY*
Authorization*
curl --request POST \
  --url https://api.uselotus.io/api/subscriptions/update/ \
  --header 'Authorization: <authorization>' \
  --header 'X-API-KEY: <x-api-key>'
lotus.update_subscription(
  customer_id='cust_0569173ee6654369',
  plan_id="plan_123",
  replace_plan_id="plan_456",
  invocing_behavior="add_to_next_invoice",
  turn_off_auto_renew=True
)

lotus.update_subscription(
  customer_id='cust_0569173ee6654369',
  plan_id="plan_123",
  subscription_filters=[{"property_name": "status", "value": "active"}],
  end_date=datetime.date(2022, 12, 8),
)

Authorizations

Authorization[header]required
string

Token-based authentication with required prefix "Token"

Query Parameters

customer_idrequired
string

Filter to a specific customer.

plan_idrequired
string

Filter to a specific plan.

subscription_filters
array

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'.

Body

end_date
string

Change the end date for the subscription.

invoicing_behaviorDefault: "invoice_now"
string

The invoicing behavior to use when replacing the plan. Invoice now will invoice the customer for the prorated difference of the old plan and the new plan, whereas add_to_next_invoice will wait until the end of the subscription to do the calculation.

  • add_to_next_invoice - Add to Next Invoice
  • invoice_now - Invoice Now
Available options:
add_to_next_invoice,
invoice_now
replace_plan_id
string

[DEPRECATED] Will currently perform a best-effort attempt to find the correct plan version to replace the current plan with. If more than one plan version matches the criteria, this will return an error. Use the change_plan method of a subscription instance instead.

turn_off_auto_renew
boolean

Turn off auto renew for the subscription

usage_behaviorDefault: "transfer_to_new_subscription"
string

The usage behavior to use when replacing the plan. Transfer to new subscription will transfer the usage from the old subscription to the new subscription, whereas keep_separate will reset the usage to 0 for the new subscription, while keeping the old usage on the old subscription and charging for that appropriately at the end of the month.

  • transfer_to_new_subscription - Transfer to New Subscription
  • keep_separate - Keep Separate
Available options:
transfer_to_new_subscription,
keep_separate

Response

array