When a quote
is created, it generates the quoted_subscription
resource. This captures most of the details of the subscription that would eventually be created once the quote is invoiced. This resource is returned along with the quote for most of the associated operations.
Sample quoted subscription [ JSON ]
{
"plan_id": "basic",
"plan_quantity": 1,
"billing_period": 1,
"billing_period_unit": "month",
"object": "quoted_subscription",
"addons": [
{
"id": "ssl",
"quantity": 1,
"unit_price": 495,
"object": "addon"
},
{..}
],
"event_based_addons": [
{
"id": "day-pass",
"quantity": 2,
"unit_price": 200,
"on_event": "subscription_creation",
"charge_once": true,
"object": "event_based_addon"
},
{..}
],
"coupons": [
{
"coupon_id": "plan_addons_coupon",
"object": "coupon"
},
{..}
]
}
string, max chars=50
A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
optional, timestamp(UTC) in secondsApplicable only when
operation_type
of the quote is
create_subscription_for_customer
. For subscriptions in the
future
status
, this is the date/time when the subscription is set to start. The quote can be converted on a date/time after this date. This is called backdating the subscription creation. Backdating is performed when the subscription has already been provisioned but the conversion action has been delayed. Backdating is allowed only when the following prerequisites are met:
- Backdating is enabled for subscription creation operations.
- The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is typically the day of the month by which the accounting for the previous month must be closed.
- The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription’s plan is 2 months and today is 14th April, the
start_date
cannot be earlier than 14th February.
optional, timestamp(UTC) in seconds
End of the trial period for the subscription. Presence of this value for 'future' subscription implies the subscription will go into 'in_trial' state when it starts.
optional, integer, min=0- When the subscription is not on a contract term: this value is the number of billing cycles remaining after the current cycle, at the end of which, the subscription cancels.
- When the subscription is on a contract term: this value is the number of billing cycles remaining in the contract term after the current billing cycle.
optional, string, max chars=100
Purchase order number for this subscription.
optional, string, max chars=33The decimal representation of the quantity of the plan purchased. Returned for quantity-based plans when
multi-decimal pricing is enabled.
plan_unit_price_in_decimal
optional, string, max chars=39The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when
multi-decimal pricing is enabled.
optional, timestamp(UTC) in secondsApplicable only when
operation_type
of the quote is
change_subscription
. When
change_option
is set to
specific_date
, then this is the date/time at which the subscription change is scheduled to occur. The quote can be converted on a date/time after this date. This is called backdating the subscription change and performed when the subscription change has already been provisioned but the conversion action has been delayed. Backdating is allowed only when the following prerequisites are met:
- Backdating must be enabled for subscription change operations.
- Only the following changes can be backdated:
- Changes in the recurring items or their prices.
- Addition of non-recurring items.
- Subscription
status
is active
, cancelled
, or non_renewing
.
- The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
- The date is on or after
current_term_start
.
- The date is on or after the last date/time any of the following changes were made:
- Changes in the recurring items or their prices.
- Addition of non-recurring items.
- The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription’s plan is 2 months and today is 14th April,
changes_scheduled_at
cannot be earlier than 14th February.
optional, enumerated stringApplicable only when
operation_type
of the quote is
change_subscription
. When the quote is converted, this attribute determines the date/time as of when the subscription change is to be carried out.
Possible values are
end_of_termThe change is scheduled to be carried out at the end of the billing cycle of the subscription.specific_dateThe change is carried out as of changes_scheduled_at
.immediatelyThe change is carried out immediately upon quote conversion.
contract_term_billing_cycle_on_renewal
optional, integer, min=1, max=100Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as
billing_cycles
or a custom value depending on the
site configuration.
optional, list of coupon
List of coupons for this subscription
string, max chars=100
Used to uniquely identify the coupon
optional, list of discount
List of discounts for this quoted subscription.
string, max chars=50
An immutable unique id for the discount. It is always auto-generated.
optional, string, max chars=100The name of the discount as it should appear on customer-facing pages and documents such as
invoices and
hosted pages. This is auto-generated based on the
type
,
amount
, and
currency_code
of the discount. For example, it can be
10% off
or
10$ off
.
enumerated string, default=percentageThe type of discount.
Possible value are:
Possible values are
fixed_amountThe specified amount will be given as discount.percentageThe specified percentage will be given as discount.
optional, double, min=0.01, max=100.0
The percentage of the original amount that should be deducted from it. Only applicable when discount.type
is percentage.
optional, in cents, min=0The value of the discount.
The format of this value depends on the kind of currency. This is only applicable when
discount.type
is
fixed_amount
.
optional, string, max chars=3The currency code (
ISO 4217 format) of the discount. This is only applicable when
discount.type
is
fixed_amount
.
enumerated string, default=foreverSpecifies the time duration for which this discount is attached to the subscription.
Possible values are
one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period
and period_unit
.
optional, integer, min=1
The duration of time for which the discount is attached to the subscription, in period_units
. Applicable only when duration_type
is limited_period
.
optional, enumerated stringThe unit of time for
period
. Applicable only when
duration_type
is
limited_period
.
Possible values are
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
booleanThe discount is included in MRR calculations for your site. This attribute is only applicable when
duration_type
is
one_time
and when the
feature is enabled in Chargebee. Also, If the
site-level setting is to exclude one-time discounts from MRR calculations, this value is always returned
false
.
enumerated stringThe amount on the invoice to which the discount is applied.
Possible values are
invoice_amountThe discount is applied to the invoice sub_total
.specific_item_priceThe discount is applied to the invoice.line_item.amount
that corresponds to the item price specified by item_price_id
.
optional, string, max chars=100The
id of the item price in the subscription to which the discount is to be applied. Relevant only when
apply_on
=
specific_item_price
.
timestamp(UTC) in seconds
Timestamp indicating when this discount is created.
optional, timestamp(UTC) in seconds
Specifies till when the limited period discount is applicable. This attribute will be sent in the response only for limited_period
duration type discount.
optional, integer
Specifies the number of times the discount has been applied.
string, max chars=100Used 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.
integer, min=0
The index number of the subscription to which the item price is added. Provide a unique number between 0
and 4
(inclusive) for each subscription that is to be created.
optional, list of subscription_itemDetails of individual
item prices that are part of this subscription
Subscription item attributes
string, max chars=100
The unique identifier of the item price.
enumerated stringThe type of item. There must be one and only one item of type
plan
in this list.
Possible values are
planPlanaddonAddonchargeCharge
optional, integer, min=1
The quantity of the item purchased
optional, string, max chars=33The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when
multi-decimal pricing is enabled.
optional, in cents, min=0The price/per unit price of the item. When not provided,
the value set for the item price is used. This is only applicable when the
pricing_model
of the item price is
flat_fee
or
per_unit
. Also, it is only allowed when
price overriding is enabled for the site. The value depends on the type of currency. If
changes_scheduled_at
is in the past and a
unit_price
is not passed, then the item price’s current unit price is considered even if the item price did not exist on the date as of when the change is scheduled.
optional, string, max chars=39The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when
multi-decimal pricing is enabled.
optional, in cents, min=0The total amount for the item as determined from
unit_price
,
free_quantity
,
quantity
and
item_tiers
as applicable. The value depends on the
type of currency.
optional, string, max chars=39The decimal representation of the total amount for the item, in major units of the currency. Always returned when
multi-decimal pricing is enabled.
optional, integer, min=0The
free_quantity
of the plan-item as
specified for the item price.
optional, string, max chars=33The
free_quantity_in_decimal
as set for the item price. Returned for quantity-based item prices when
multi-decimal pricing is enabled.
optional, timestamp(UTC) in secondsThe date/time when the trial period of the item ends. Applies to plan-items and—-when
enabled-—addon-items as well.
optional, integer, min=1, max=730
The service period of the item in days from the day of charge.
optional, enumerated stringWhen
charge_on_option
option is set to
on_event
, this parameter specifies the event at which the charge-item is applied to the subscription. This parameter only applies to charge-items.
Possible values are
subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active
or non-renewing
state. Also includes reactivations of canceled subscriptions.contract_terminationwhen a contract term is terminated.
optional, boolean
Indicates if the charge-item is to be charged only once or each time the charge_on_event
occurs. This parameter only applies to charge-items.
optional, enumerated stringIndicates when the charge-item is to be charged. This parameter only applies to charge-items.
Possible values are
immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event
.
optional, list of item_tier
List of item tier.
string, max chars=100
The id of the item price to which this tier belongs.
integer, min=1
The lowest value in the quantity tier.
optional, integer
The highest value in the quantity tier.
in cents, default=0, min=0
The per-unit price for the tier when the pricing_model
is tiered
or volume
. The total cost for the item price when the pricing_model
is stairstep
. The value is in the minor unit of the currency.
optional, string, max chars=33The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as
ending_unit_in_decimal
of the next lower tier. Returned only when the pricing_model is
tiered
,
volume
or
stairstep
and
multi-decimal pricing is enabled.
optional, string, max chars=33The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the
starting_unit_in_decimal
of the next higher tier. Returned only when the pricing_model is
tiered
,
volume
or
stairstep
and
multi-decimal pricing is enabled.
optional, string, max chars=39The decimal representation of the per-unit price for the tier when the
pricing_model
is
tiered
or
volume
. When the
pricing_model
is
stairstep
, it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and
multi-decimal pricing is enabled.
integer, min=0
The index number of the subscription to which the item price is added. Provide a unique number between 0
and 4
(inclusive) for each subscription that is to be created.
optional, quoted_contract_term
The details of the contract term to be created when this quote is invoiced.
Quoted contract term attributes
timestamp(UTC) in seconds
The start date of the contract term
timestamp(UTC) in seconds
The end date of the contract term
integer, min=0
The number of billing cycles of the subscription that the contract term is for.
enumerated string, default=renewAction to be taken when the contract term completes.
Possible values are
renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
.
in cents, default=0, min=0The sum of the
totals of all the invoices raised as part of the contract term. For
active
contract terms, this is a predicted value. The value depends on the
type of currency. If the subscription was
imported with the contract term, then this value includes the value passed for
total_amount_raised
.
cancellation_cutoff_period
optional, integerThe number of days before
contract_end
, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure