POST /estimates/update_subscription

Generates an estimate for the 'update subscription' operation. The input will be similar to the Update Subscription API but subscription will not be updated, but just an estimate will be generated.

In case 'update subscription' operation will not create an invoice immediately, the estimate generated will be for the 'end of term' invoice. Some of the cases where the invoice will not be generated immediately are

Note:

Servers

Request headers

Name Type Required Description
chargebee-request-origin-device String No

The device from which the customer has made the request

Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

chargebee-event-webhook String No

skip only webhooks

Possible values:

  • "all-disabled"
chargebee-event-actions String No

skip all actions to be done on the events

Possible values:

  • "all-disabled"
chargebee-request-origin-user String No

The email address of your customer/user. Use this when the email address has only ASCII characters.

chargebee-request-origin-ip String No

The IP address of the customer where the request originated

chargebee-request-origin-user-encoded String No

The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.

chargebee-event-email String No

skip only emails

Possible values:

  • "all-disabled"

Request body fields

Name Type Required Description
shipping_address Object No

Parameters for shipping_address

shipping_address.state_code String No

The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).

shipping_address.zip String No

Zip or postal code. The number of characters is validated according to the rules specified here.

shipping_address.country String No

The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.

Note : If you enter an invalid country code, the system will return an error.

Brexit

If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom -- Northern Ireland) is available as an option.

prorate Boolean No
  • When true: Prorated credits or charges are created as applicable for this change.
  • When false: The subscription is changed without creating any credits or charges.
  • When not provided, the value configured in the site settings is considered.

Caveat

For further changes within the same billing term, when prorate is set to true, credits are not created when all the conditions below hold true:

An immediate previous change was made

  • with prorate set to false and
  • no changes were made to the subscription's billing term and
  • a change was made to either the subscription's plan, its addons, or the prices of the plan or addons.
end_of_term Boolean No

Set this to true if you want the update to be applied at the end of the current subscription billing cycle.

Default value: false

customer Object No

Parameters for customer

customer.vat_number String No

VAT number of this customer. If not provided then taxes are not calculated for the estimate. Applicable only when taxes are configured for the EU or UK region. VAT validation is not done for this.

include_delayed_charges Boolean No

If true, all the unbilled charges will be included for the invoice estimate.

Default value: false

subscription Object No

Parameters for subscription

subscription.id String Yes

A unique and immutable identifier for the subscription. If not provided, it is autogenerated.

subscription.start_date Integer No

The new start date of a future subscription. Applicable only for future subscriptions.

subscription.plan_id String No

Identifier of the plan for this subscription

subscription.coupon String No

Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
Note:

When the coupon ID contains a special character; for example: #, the API returns an error. Make sure that you encode the coupon ID in the path parameter before making an API call.

subscription.trial_end Integer No

The time at which the trial has ended or will end for the subscription. This is only allowed when the subscription status is future, in_trial, or cancelled. Also, the value must not be earlier than changes_scheduled_at or start_date. Note : This parameter can be backdated (set to a value in the past) only when the subscription is in cancelled or in_trial status. Do this to keep a record of when the trial ended in case it ended at some point in the past. When trial_end is backdated, the subscription immediately goes into active or non_renewing status.

subscription.plan_quantity Integer No

Represents the plan quantity for this subscription.

Default value: 1

use_customer_balances Boolean No

If true, all the existing balances - promotional credits, refundable credits and excess payments - will be included for the invoice estimate.

Default value: false

replace_addon_list Boolean No

Should be true if the existing addons should be replaced with the ones that are being passed.

Default value: false

addons Object No

Parameters for addons

addons.id[] Array No

Identifier of the addon. Multiple addons can be passed.

addons.proration_type[] Array No
addons.quantity[] Array No

Quantity of the addon. Applicable for addons with pricing_model other than flat_fee.

billing_cycles Integer No

The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan is used.

billing_address Object No

Parameters for billing_address

billing_address.state_code String No

The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).

billing_address.zip String No

Zip or postal code. The number of characters is validated according to the rules specified here.

billing_address.country String No

The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.

Note : If you enter an invalid country code, the system will return an error.

Brexit

If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom -- Northern Ireland) is available as an option.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.