# Update Subscription Plan

Update an existing Subscription Plan.

Options:
- Set update_existing_subscriptions to true to update existing subscriptions.
- Archive the Subscription Plan by setting its state to INACTIVE.

Endpoint: PUT /subscription_plans/{subscription_plan_id}
Version: 2022-02-01
Security: BasicAuth

## Path parameters:

  - `subscription_plan_id` (string, required)
    The ID of the Subscription Plan.

## Request fields (application/json):

  - `amount` (integer)
    The total amount that will be debited in cents (e.g. 100 cents to debit $1.00).
    Example: 5000

  - `nickname` (string)
    A human-readable name for the resource.

  - `description` (string)
    A description for the Subscription Plan.

  - `state` (string)
    The state of the Subscription Plan.
    Enum: "ACTIVE", "INACTIVE"

  - `tags` (object,null)
    Include up to 50 key: value pairs to annotate requests with custom metadata.
- Maximum character length for individual keys is 40.
- Maximum character length for individual values is 500.
(For example, order_number: 25, item_type: produce, department: sales)

  - `update_existing_subscriptions` (boolean)
    Set to true to update existing subscriptions created from this plan or false to make updates only effective for future subscriptions created from this plan. The default is false.

## Response 200 fields (application/json):

  - `id` (string)
    The ID of the resource.

  - `created_at` (string)
    Timestamp of when the object was created.

  - `updated_at` (string)
    Timestamp of when the object was last updated.

  - `application_id` (string)
    ID of the Application the resource was created under.

  - `linked_to` (string)
    The ID of the [Merchant](#Merchants) resource that you wish to link to the Subscription Plan (i.e., the merchant that the subscription plan belongs to).

At this time, only approved merchants with one of the following processors are valid:

- DUMMY_V1
- FINIX_V1

  - `linked_type` (string)
    The type of the resource that is specified in the linked_to field.
    Enum: "MERCHANT"

  - `billing_interval` (string)
    How often the subscriber is billed.
    Enum: "DAILY", "WEEKLY", "MONTHLY", "QUARTERLY", "YEARLY"

  - `nickname` (string)
    A human-readable name for the resource.

  - `plan_name` (string)
    A human-friendly name for the Subscription Plan.

  - `description` (string)
    A description of the Subscription Plan.

  - `amount` (integer)
    The total amount that will be debited in cents (e.g. 100 cents to debit $1.00).
    Example: 5000

  - `currency` (string)
    ISO 4217 3-letter currency code.
    Enum: "USD", "CAD"

  - `default_total_billing_intervals` (integer,null)
    The total number of billing intervals for subscriptions created from this plan. This is the count of recurring billing cycles, with the interval unit defined by the plan’s billing_interval, such as weekly, monthly, etc. If included, the plan’s duration_type will be set to FIXED_TERM.

Subscriptions created with this plan will use the default duration in the total_billing_intervals field. The subscription's expires_at field will be set to the datetime when the subscription expires based on the plan's default_total_billing_intervals.

  - `duration_type` (string,null)
    Whether subscriptions created from this plan will have a fixed term or will continue until canceled. If default_total_billing_intervals is set, this plan's duration_type is automatically set to FIXED_TERM. Otherwise, the duration_type is set to EVERGREEN.
    Enum: "FIXED_TERM", "EVERGREEN"

  - `billing_defaults` (object)
    Object containing default billing settings.

  - `billing_defaults.collection_method` (string)
    The method by which subscription payments are collected. At this time, only BILL_AUTOMATICALLY is supported.
    Enum: "BILL_AUTOMATICALLY"

  - `billing_defaults.send_invoice` (boolean)
    This feature has yet to be implemented.

  - `billing_defaults.send_receipt` (boolean)
    This feature has yet to be implemented.

  - `trial_defaults` (object)
    Object containing default trial settings.

  - `trial_defaults.interval_type` (string)
    The unit of time for the trial period.
    Enum: "DAY", "WEEK", "MONTH", "YEAR"

  - `trial_defaults.interval_count` (integer)
    The number of intervals of interval_type used to describe the duration of the trial.

  - `discount_phase_defaults` (object)

  - `discount_phase_defaults.amount` (integer)
    The total amount that will be debited in cents (e.g. 100 cents to debit $1.00).
    Example: 5000

  - `discount_phase_defaults.billing_interval_count` (integer)
    The number of billing intervals the discount applies. After this period, the subscriber is charged the full amount.

  - `state` (string)
    The state of the Subscription Plan.
    Enum: "ACTIVE", "INACTIVE"

  - `tags` (object,null)
    Include up to 50 key: value pairs to annotate requests with custom metadata.
- Maximum character length for individual keys is 40.
- Maximum character length for individual values is 500.
(For example, order_number: 25, item_type: produce, department: sales)

  - `_links` (object)
    An object containing link(s) relevant to the request. You can store these links for follow-up requests.

  - `_links.self` (object)
    Link to the resource that was used in the request.

  - `_links.self.href` (string)

## Response 400 fields (application/json):

  - `total` (integer, required)
    Total number of errors returned.

  - `_embedded` (object, required)
    Container for embedded error objects.

  - `_embedded.errors` (array)
    List of individual error objects.

  - `_embedded.errors.code` (string)
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

  - `_embedded.errors.logref` (string)
    A log reference identifier for the error, useful for debugging and support purposes.

  - `_embedded.errors.message` (string)
    A human-friendly error message.

  - `_embedded.errors._links` (object)
    Links related to this error.

  - `_embedded.errors._links.self` (object)
    Link to the resource related to the error.

  - `_embedded.errors._links.self.href` (string)
    URL of the related resource.

## Response 401 fields (application/json):

  - `total` (integer, required)
    Total number of errors returned.

  - `_embedded` (object, required)
    Container for embedded error objects.

  - `_embedded.errors` (array)
    List of individual error objects.

  - `_embedded.errors.code` (string)
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

  - `_embedded.errors.logref` (string)
    A log reference identifier for the error, useful for debugging and support purposes.

  - `_embedded.errors.message` (string)
    A human-friendly error message.

  - `_embedded.errors._links` (object)
    Links related to this error.

  - `_embedded.errors._links.self` (object)
    Link to the resource related to the error.

  - `_embedded.errors._links.self.href` (string)
    URL of the related resource.

## Response 403 fields (application/json):

  - `total` (integer, required)
    Total number of errors returned.

  - `_embedded` (object, required)
    Container for embedded error objects.

  - `_embedded.errors` (array)
    List of individual error objects.

  - `_embedded.errors.code` (string)
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

  - `_embedded.errors.logref` (string)
    A log reference identifier for the error, useful for debugging and support purposes.

  - `_embedded.errors.message` (string)
    A human-friendly error message.

  - `_embedded.errors._links` (object)
    Links related to this error.

  - `_embedded.errors._links.self` (object)
    Link to the resource related to the error.

  - `_embedded.errors._links.self.href` (string)
    URL of the related resource.

## Response 404 fields (application/json):

  - `total` (integer, required)
    Total number of errors returned.

  - `_embedded` (object, required)
    Container for embedded error objects.

  - `_embedded.errors` (array)
    List of individual error objects.

  - `_embedded.errors.code` (string)
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

  - `_embedded.errors.logref` (string)
    A log reference identifier for the error, useful for debugging and support purposes.

  - `_embedded.errors.message` (string)
    A human-friendly error message.

  - `_embedded.errors._links` (object)
    Links related to this error.

  - `_embedded.errors._links.self` (object)
    Link to the resource related to the error.

  - `_embedded.errors._links.self.href` (string)
    URL of the related resource.

## Response 406 fields (application/json):

  - `total` (integer, required)
    Total number of errors returned.

  - `_embedded` (object, required)
    Container for embedded error objects.

  - `_embedded.errors` (array)
    List of individual error objects.

  - `_embedded.errors.code` (string)
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

  - `_embedded.errors.logref` (string)
    A log reference identifier for the error, useful for debugging and support purposes.

  - `_embedded.errors.message` (string)
    A human-friendly error message.

  - `_embedded.errors._links` (object)
    Links related to this error.

  - `_embedded.errors._links.self` (object)
    Link to the resource related to the error.

  - `_embedded.errors._links.self.href` (string)
    URL of the related resource.


