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
- In case of downgrades only credits will be added to customer.
- 'end_of_term' option is true.
- 'prorate' option is false.
- Only coupon is applied.
Note:
- If you use the EU VAT tax option, you need to specify 'billing_address[country]' and 'customer[vat_number]' attributes for the tax calculation to happen. If these attributes are not passed, the tax will be ignored for this estimate.
- If you use the Customized Tax option, you need to specify the shipping address and billing address parameters for the tax calculation to happen. This is because Chargebee will use the customer's shipping address to determine the tax applicable. If the shipping address is not available, then the billing address will be used to determine tax. If both addresses are not available, tax will be ignored for this estimate.
Servers
- {protocol}://{site}.{environment}:{port}/api/v1
- {protocol}://{site}-test.{environment}:{port}/api/v1
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:
|
chargebee-event-actions |
String | No |
skip all actions to be done on the events Possible values:
|
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-event-email |
String | No |
skip only emails Possible values:
|
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 |
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 |
prorate |
Boolean | No |
Caveat For further changes within the same billing term, when An immediate previous change was made
|
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 |
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. When the coupon ID contains a special character; for example: |
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 |
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 |
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 |
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 |
How to start integrating
- Add HTTP Task to your workflow definition.
- 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.
- Click Test request to test run your request to the API and see the API's response.