---
title: "POST /api/subscriptions/update/"
method: POST
path: "/api/subscriptions/update/"
tags: ["api"]
---

# POST /api/subscriptions/update/

`POST /api/subscriptions/update/`

## Query parameters

- `customer_id` string, required
- `plan_id` string, uuid, required
- `subscription_filters` SubscriptionCategoricalFilterRequest[]
  - `value` string, required
  - `property_name` string, required — The string name of the property to filter on. Example: 'product_id'

## Request body

- SubscriptionRecordUpdateRequest
  - `replace_plan_id` string, uuid — If provided, will replace the current subscription's plan with this plan. If this is provided,turn_off_auto_renew and end_date will be ignored. The provided plan must have the same duration as the current plan.
  - `invoicing_behavior` 'add_to_next_invoice' | 'invoice_now' — 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.
  - `usage_behavior` 'transfer_to_new_subscription' | 'keep_separate' — 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 reset_usage 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.
  - `turn_off_auto_renew` boolean — Turn off auto renew for the subscription
  - `end_date` string, date-time — Change the end date for the subscription.

## Response `200`

- SubscriptionRecord[]
  - `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` SubscriptionCategoricalFilter[], required
    - `value` string, required
    - `property_name` string, required — The string name of the property to filter on. Example: 'product_id'
  - `customer` LightweightCustomer, required
    - `customer_name` string, nullable, required — The display name of the customer
    - `email` string, email, nullable, required — The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider
    - `customer_id` string, required — The id provided when creating the customer, we suggest matching with your internal customer id in your backend
  - `billing_plan` LightweightPlanVersion, required
    - `plan_name` string, required
    - `plan_id` string, required
    - `version` integer, required
    - `version_id` string, required
  - `fully_billed` boolean, required — Whether the subscription has been fully billed and finalized.
  - `addons` LightweightAddonSubscriptionRecord[], 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.
    - `addon` LightweightAddon, required
      - `addon_name` string, required — The name of the add-on plan.
      - `addon_id` string, required — The ID of the add-on plan.
      - `addon_type` 'flat' | 'usage_based', required
      - `billing_frequency` 'one_time' | 'recurring', required
    - `fully_billed` boolean, required — Whether the subscription has been fully billed and finalized.

## Changes

- **2023-02-17** `ecc2be015e66` — 1 breaking
  - the `items/addons/items/addon/addon_id` response's property type/format changed from `string`/`uuid` to `string`/`` for status `200`
- **2023-02-03** `fe43d7855824` — 1 breaking
  - the `items/addons/items/addon/billing_frequency` response's property type/format changed from `string`/`` to ``/`` for status `200`
- **2023-01-25** `77053ad08590` — 1 info
  - added the required property `items/addons` to the response with the `200` status
- **2023-01-22** `4c3ade147167` — 1 info
  - added the required property `items/billing_plan/version_id` to the response with the `200` status
- **2023-01-16** `36b48cae00a3` — 4 breaking, 4 info
  - removed the required property `items/addons` from the response with the `200` status
  - removed the required property `items/billing_plan/version_id` from the response with the `200` status
  - removed the required property `items/metadata` from the response with the `200` status
  - removed the required property `items/subscription_id` from the response with the `200` status
  - …4 more

[Change history](https://skmtc.dev/uselotus/apis/lotus-api/changes/api/subscriptions/update/post.md)

---

[API](https://skmtc.dev/uselotus/apis/lotus-api.md) · [All operations](https://skmtc.dev/uselotus/apis/lotus-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/uselotus/lotus-api/revisions/dc4da83471bb/schema)
