chargebee 2.42.0 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +7 -0
- package/package.json +1 -1
- package/types/core.d.ts +2 -1
- package/types/index.d.ts +1 -0
- package/types/resources/Card.d.ts +1 -1
- package/types/resources/Estimate.d.ts +26 -7
- package/types/resources/ItemPrice.d.ts +78 -844
- package/types/resources/PaymentScheduleEstimate.d.ts +35 -0
- package/types/resources/PaymentScheduleScheme.d.ts +2 -0
- package/types/resources/PaymentSource.d.ts +25 -896
- package/types/resources/PricingPageSession.d.ts +4 -0
- package/types/resources/Quote.d.ts +41 -38
- package/types/resources/QuotedSubscription.d.ts +53 -378
- package/types/resources/Subscription.d.ts +4 -2
|
@@ -1,498 +1,173 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface QuotedSubscription {
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
id:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description Applicable 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:
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
plan_id:string;
|
|
10
|
+
|
|
11
|
+
plan_quantity:number;
|
|
12
|
+
|
|
13
|
+
plan_unit_price?:number;
|
|
14
|
+
|
|
15
|
+
setup_fee?:number;
|
|
16
|
+
|
|
17
|
+
billing_period?:number;
|
|
18
|
+
|
|
19
|
+
billing_period_unit?:'day' | 'week' | 'month' | 'year';
|
|
18
20
|
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
21
|
start_date?:number;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @description 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.
|
|
25
22
|
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
23
|
trial_end?:number;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @description * 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.
|
|
32
|
-
* When the subscription is on a [contract term](contract_terms): this value is the number of billing cycles remaining in the contract term after the current billing cycle.
|
|
33
24
|
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
25
|
remaining_billing_cycles?:number;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @description Purchase order number for this subscription.
|
|
40
26
|
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
27
|
po_number?:string;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @description The decimal representation of the quantity of the plan purchased. Returned for quantity-based plans when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
47
28
|
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
auto_collection?:AutoCollection;
|
|
30
|
+
|
|
50
31
|
plan_quantity_in_decimal?:string;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @description The 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](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
|
|
54
32
|
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
33
|
plan_unit_price_in_decimal?:string;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @description Applicable 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:
|
|
61
|
-
|
|
62
|
-
* Backdating must be enabled for subscription change operations.
|
|
63
|
-
* Only the following changes can be backdated:
|
|
64
|
-
* Changes in the recurring items or their prices.
|
|
65
|
-
* Addition of non-recurring items.
|
|
66
|
-
* Subscription `status` is `active`, `cancelled`, or `non_renewing`.
|
|
67
|
-
* 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.
|
|
68
|
-
* The date is on or after `current_term_start`.
|
|
69
|
-
* The date is on or after the last date/time any of the following changes were made:
|
|
70
|
-
* Changes in the recurring items or their prices.
|
|
71
|
-
* Addition of non-recurring items.
|
|
72
|
-
* 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.
|
|
73
34
|
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
35
|
changes_scheduled_at?:number;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @description Applicable 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. \* end_of_term - The change is scheduled to be carried out at the end of the billing cycle of the subscription. \* specific_date - The change is carried out as of `changes_scheduled_at`. \* immediately - The change is carried out immediately upon quote conversion.
|
|
80
36
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
change_option?:'end_of_term' | 'immediately' | 'specific_date';
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @description Number 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](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms).
|
|
37
|
+
change_option?:'end_of_term' | 'specific_date' | 'immediately';
|
|
87
38
|
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
39
|
contract_term_billing_cycle_on_renewal?:number;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @description List of coupons for this subscription
|
|
94
40
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
coupons?:QuotedSubscription.Coupon[];
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* @description List of discounts for this quoted subscription.
|
|
41
|
+
addons?:QuotedSubscription.Addon[];
|
|
101
42
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @description Details of individual [item prices](/docs/api/item_prices?prod_cat_ver=2) that are part of this subscription
|
|
43
|
+
event_based_addons?:QuotedSubscription.EventBasedAddon[];
|
|
44
|
+
|
|
45
|
+
coupons?:QuotedSubscription.Coupon[];
|
|
108
46
|
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
47
|
subscription_items?:QuotedSubscription.SubscriptionItem[];
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @description List of item tier.
|
|
115
48
|
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
49
|
item_tiers?:QuotedSubscription.ItemTier[];
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* @description The details of the contract term to be created when this quote is invoiced.
|
|
122
50
|
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
51
|
quoted_contract_term?:QuotedSubscription.QuotedContractTerm;
|
|
52
|
+
|
|
126
53
|
}
|
|
127
54
|
export namespace QuotedSubscription {
|
|
128
55
|
|
|
129
56
|
|
|
130
|
-
export interface
|
|
131
|
-
/**
|
|
132
|
-
* @description Used to uniquely identify the coupon
|
|
133
|
-
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
coupon_id:string;
|
|
137
|
-
}
|
|
138
|
-
export interface Discount {
|
|
139
|
-
/**
|
|
140
|
-
* @description An immutable unique id for the discount. It is always auto-generated.
|
|
141
|
-
|
|
142
|
-
*/
|
|
143
|
-
|
|
57
|
+
export interface Addon {
|
|
144
58
|
id:string;
|
|
145
59
|
|
|
146
|
-
|
|
147
|
-
* @description The name of the discount as it should appear on customer-facing pages and documents such as [invoices](/docs/api/invoices?prod_cat_ver=2) and [hosted pages](/docs/api/hosted_pages?prod_cat_ver=2). 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`.
|
|
148
|
-
|
|
149
|
-
*/
|
|
150
|
-
|
|
151
|
-
invoice_name?:string;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @description The type of discount. Possible value are: \* fixed_amount - The specified amount will be given as discount. \* percentage - The specified percentage will be given as discount.
|
|
155
|
-
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
|
-
type:'fixed_amount' | 'percentage';
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* @description The percentage of the original amount that should be deducted from it. Only applicable when `discount.type` is percentage.
|
|
162
|
-
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
percentage?:number;
|
|
60
|
+
quantity?:number;
|
|
166
61
|
|
|
167
|
-
|
|
168
|
-
* @description The value of the discount. [The format of this value](https://apidocs.chargebee.com/docs/api?prod_cat_ver=2#currencies) depends on the kind of currency. This is only applicable when `discount.type` is `fixed_amount`.
|
|
169
|
-
|
|
170
|
-
*/
|
|
62
|
+
unit_price?:number;
|
|
171
63
|
|
|
172
64
|
amount?:number;
|
|
173
65
|
|
|
174
|
-
|
|
175
|
-
* @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the discount. This is only applicable when `discount.type` is `fixed_amount`.
|
|
176
|
-
|
|
177
|
-
*/
|
|
178
|
-
|
|
179
|
-
currency_code?:string;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* @description Specifies the time duration for which this discount is attached to the subscription. \* forever - The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions?prod_cat_ver=2#update_subscription_for_items_discounts_operation_type). \* one_time - The discount stays attached to the subscription till it is applied on an invoice **once** . It is removed after that from the subscription. \* limited_period - The 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`.
|
|
183
|
-
|
|
184
|
-
*/
|
|
185
|
-
|
|
186
|
-
duration_type:'limited_period' | 'one_time' | 'forever';
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* @description The duration of time for which the discount is attached to the subscription, in `period_units`. Applicable only when `duration_type` is `limited_period`.
|
|
190
|
-
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
period?:number;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* @description The unit of time for `period`. Applicable only when `duration_type` is `limited_period`. \* day - A period of 24 hours. \* year - A period of 1 calendar year. \* week - A period of 7 days. \* month - A period of 1 calendar month.
|
|
197
|
-
|
|
198
|
-
*/
|
|
199
|
-
|
|
200
|
-
period_unit?:'week' | 'month' | 'year' | 'day';
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* @description The 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](https://www.chargebee.com/docs/reporting.html#dashboards_flexible-mrr-calculation) in Chargebee. Also, If the [site-level setting](https://www.chargebee.com/docs/reporting.html#chart_flexible-mrr-calculation) is to exclude one-time discounts from MRR calculations, this value is always returned `false`.
|
|
204
|
-
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
included_in_mrr:boolean;
|
|
66
|
+
trial_end?:number;
|
|
208
67
|
|
|
209
|
-
|
|
210
|
-
* @description The amount on the invoice to which the discount is applied. \* invoice_amount - The discount is applied to the invoice `sub_total`. \* specific_item_price - The discount is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id`.
|
|
211
|
-
|
|
212
|
-
*/
|
|
68
|
+
remaining_billing_cycles?:number;
|
|
213
69
|
|
|
214
|
-
|
|
70
|
+
quantity_in_decimal?:string;
|
|
215
71
|
|
|
216
|
-
|
|
217
|
-
* @description The [id of the item price](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when `apply_on` = `specific_item_price`.
|
|
218
|
-
|
|
219
|
-
*/
|
|
72
|
+
unit_price_in_decimal?:string;
|
|
220
73
|
|
|
221
|
-
|
|
74
|
+
amount_in_decimal?:string;
|
|
222
75
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
76
|
+
proration_type?:'full_term' | 'partial_term' | 'none';
|
|
77
|
+
}
|
|
78
|
+
export interface EventBasedAddon {
|
|
79
|
+
id:string;
|
|
227
80
|
|
|
228
|
-
|
|
81
|
+
quantity:number;
|
|
229
82
|
|
|
230
|
-
|
|
231
|
-
* @description Specifies till when the limited period discount is applicable. This attribute will be sent in the response only for `limited_period` duration type discount.
|
|
232
|
-
|
|
233
|
-
*/
|
|
83
|
+
unit_price:number;
|
|
234
84
|
|
|
235
|
-
|
|
85
|
+
service_period_in_days?:number;
|
|
236
86
|
|
|
237
|
-
|
|
238
|
-
* @description Specifies the number of times the discount has been applied.
|
|
239
|
-
|
|
240
|
-
*/
|
|
87
|
+
on_event:'subscription_creation' | 'subscription_trial_start' | 'plan_activation' | 'subscription_activation' | 'contract_termination';
|
|
241
88
|
|
|
242
|
-
|
|
89
|
+
charge_once:boolean;
|
|
243
90
|
|
|
244
|
-
|
|
245
|
-
* @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
|
|
246
|
-
**Note:**
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
When the coupon ID contains a special character; for example: `#`, the API returns an error.
|
|
250
|
-
Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
|
|
251
|
-
|
|
252
|
-
*/
|
|
91
|
+
quantity_in_decimal?:string;
|
|
253
92
|
|
|
93
|
+
unit_price_in_decimal?:string;
|
|
94
|
+
}
|
|
95
|
+
export interface Coupon {
|
|
254
96
|
coupon_id:string;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* @description 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.
|
|
258
|
-
|
|
259
|
-
*/
|
|
260
|
-
|
|
261
|
-
index:number;
|
|
262
97
|
}
|
|
263
98
|
export interface SubscriptionItem {
|
|
264
|
-
/**
|
|
265
|
-
* @description The unique identifier of the item price.
|
|
266
|
-
|
|
267
|
-
*/
|
|
268
|
-
|
|
269
99
|
item_price_id:string;
|
|
270
100
|
|
|
271
|
-
|
|
272
|
-
* @description The type of item. There must be one and only one item of type `plan` in this list. \* plan - Plan \* addon - Addon \* charge - Charge
|
|
273
|
-
|
|
274
|
-
*/
|
|
275
|
-
|
|
276
|
-
item_type:'charge' | 'addon' | 'plan';
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* @description The quantity of the item purchased
|
|
280
|
-
|
|
281
|
-
*/
|
|
101
|
+
item_type:'plan' | 'addon' | 'charge';
|
|
282
102
|
|
|
283
103
|
quantity?:number;
|
|
284
104
|
|
|
285
|
-
/**
|
|
286
|
-
* @description The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
287
|
-
|
|
288
|
-
*/
|
|
289
|
-
|
|
290
105
|
quantity_in_decimal?:string;
|
|
291
106
|
|
|
292
|
-
|
|
293
|
-
* @description The price/per unit price of the item. When not provided, [the value set](/docs/api/item_prices?prod_cat_ver=2#item_price_attributes) 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](https://www.chargebee.com/docs/price-override.html) 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.
|
|
294
|
-
|
|
295
|
-
*/
|
|
107
|
+
metered_quantity?:string;
|
|
296
108
|
|
|
297
|
-
|
|
109
|
+
last_calculated_at?:number;
|
|
298
110
|
|
|
299
|
-
|
|
300
|
-
* @description The 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](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
301
|
-
|
|
302
|
-
*/
|
|
111
|
+
unit_price?:number;
|
|
303
112
|
|
|
304
113
|
unit_price_in_decimal?:string;
|
|
305
114
|
|
|
306
|
-
/**
|
|
307
|
-
* @description The 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](./#handling_currency_units).
|
|
308
|
-
|
|
309
|
-
*/
|
|
310
|
-
|
|
311
115
|
amount?:number;
|
|
312
116
|
|
|
313
|
-
/**
|
|
314
|
-
* @description The decimal representation of the total amount for the item, in major units of the currency. Always returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
315
|
-
|
|
316
|
-
*/
|
|
317
|
-
|
|
318
117
|
amount_in_decimal?:string;
|
|
319
118
|
|
|
320
|
-
|
|
321
|
-
* @description The `free_quantity` of the plan-item as [specified](./item_prices?prod_cat_ver=2) for the item price.
|
|
322
|
-
|
|
323
|
-
*/
|
|
119
|
+
billing_period?:number;
|
|
324
120
|
|
|
325
|
-
|
|
121
|
+
billing_period_unit?:'day' | 'week' | 'month' | 'year';
|
|
326
122
|
|
|
327
|
-
|
|
328
|
-
* @description The `free_quantity_in_decimal` as set for the item price. Returned for quantity-based item prices when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
329
|
-
|
|
330
|
-
*/
|
|
123
|
+
free_quantity?:number;
|
|
331
124
|
|
|
332
125
|
free_quantity_in_decimal?:string;
|
|
333
126
|
|
|
334
|
-
/**
|
|
335
|
-
* @description The date/time when the trial period of the item ends. Applies to plan-items and----when [enabled](https://www.chargebee.com/docs/2.0/addons-trial.html)----addon-items as well.
|
|
336
|
-
|
|
337
|
-
*/
|
|
338
|
-
|
|
339
127
|
trial_end?:number;
|
|
340
128
|
|
|
341
|
-
/**
|
|
342
|
-
* @description For the plan-item price:
|
|
343
|
-
the value determines the number of billing cycles the subscription runs before canceling automatically. If not provided, then [the value set](./item_prices?prod_cat_ver=2#item_price_attributes) for the plan-item price is used.
|
|
344
|
-
|
|
345
|
-
For addon-item prices:
|
|
346
|
-
If [addon billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle.html) are enabled then this is the number of subscription billing cycles for which the addon is included. If not provided, then [the value set under attached addons](./attached_items?prod_cat_ver=2#attached_item_attributes) is used. Further, if that value is not provided, then [the value set for the addon-item price](./item_prices?prod_cat_ver=2#item_price_attributes) is used.
|
|
347
|
-
|
|
348
|
-
*/
|
|
349
|
-
|
|
350
129
|
billing_cycles?:number;
|
|
351
130
|
|
|
352
|
-
/**
|
|
353
|
-
* @description The service period of the item in days from the day of charge.
|
|
354
|
-
|
|
355
|
-
*/
|
|
356
|
-
|
|
357
131
|
service_period_days?:number;
|
|
358
132
|
|
|
359
|
-
|
|
360
|
-
* @description When `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. \* plan_activation - same as subscription activation, but also includes the case when the plan-item of the subscription is changed. \* subscription_activation - the moment a subscription enters an `active` or `non-renewing` state. Also includes reactivations of canceled subscriptions. \* contract_termination - when a contract term is [terminated](./subscriptions?prod_cat_ver=2#cancel_subscription_for_items_contract_term_cancel_option). \* subscription_trial_start - the time when the trial period of the subscription begins. \* subscription_creation - the time of creation of the subscription.
|
|
361
|
-
|
|
362
|
-
*/
|
|
363
|
-
|
|
364
|
-
charge_on_event?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation';
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* @description 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.
|
|
368
|
-
|
|
369
|
-
*/
|
|
133
|
+
charge_on_event?:'subscription_creation' | 'subscription_trial_start' | 'plan_activation' | 'subscription_activation' | 'contract_termination';
|
|
370
134
|
|
|
371
135
|
charge_once?:boolean;
|
|
372
136
|
|
|
373
|
-
|
|
374
|
-
* @description Indicates when the charge-item is to be charged. This parameter only applies to charge-items. \* on_event - The item is charged at the occurrence of the event specified as `charge_on_event`. \* immediately - The item is charged immediately on being added to the subscription.
|
|
375
|
-
|
|
376
|
-
*/
|
|
377
|
-
|
|
378
|
-
charge_on_option?:'on_event' | 'immediately';
|
|
137
|
+
charge_on_option?:'immediately' | 'on_event';
|
|
379
138
|
|
|
380
|
-
|
|
381
|
-
* @description null
|
|
382
|
-
|
|
383
|
-
*/
|
|
384
|
-
|
|
385
|
-
proration_type?:'partial_term' | 'full_term' | 'none';
|
|
386
|
-
|
|
387
|
-
billing_period?:number;
|
|
139
|
+
proration_type?:'full_term' | 'partial_term' | 'none';
|
|
388
140
|
|
|
389
|
-
|
|
141
|
+
usage_accumulation_reset_frequency?:'never' | 'subscription_billing_frequency';
|
|
390
142
|
}
|
|
391
143
|
export interface ItemTier {
|
|
392
|
-
/**
|
|
393
|
-
* @description The id of the item price to which this tier belongs.
|
|
394
|
-
|
|
395
|
-
*/
|
|
396
|
-
|
|
397
144
|
item_price_id:string;
|
|
398
145
|
|
|
399
|
-
/**
|
|
400
|
-
* @description The lowest value in the quantity tier.
|
|
401
|
-
|
|
402
|
-
*/
|
|
403
|
-
|
|
404
146
|
starting_unit:number;
|
|
405
147
|
|
|
406
|
-
/**
|
|
407
|
-
* @description The highest value in the quantity tier.
|
|
408
|
-
|
|
409
|
-
*/
|
|
410
|
-
|
|
411
148
|
ending_unit?:number;
|
|
412
149
|
|
|
413
|
-
/**
|
|
414
|
-
* @description 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.
|
|
415
|
-
|
|
416
|
-
*/
|
|
417
|
-
|
|
418
150
|
price:number;
|
|
419
151
|
|
|
420
|
-
/**
|
|
421
|
-
* @description The 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](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
422
|
-
|
|
423
|
-
*/
|
|
424
|
-
|
|
425
152
|
starting_unit_in_decimal?:string;
|
|
426
153
|
|
|
427
|
-
/**
|
|
428
|
-
* @description The 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](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
429
|
-
|
|
430
|
-
*/
|
|
431
|
-
|
|
432
154
|
ending_unit_in_decimal?:string;
|
|
433
155
|
|
|
434
|
-
/**
|
|
435
|
-
* @description The 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](https://apidocs.chargebee.com/docs/api#handling_currency_units) is enabled.
|
|
436
|
-
|
|
437
|
-
*/
|
|
438
|
-
|
|
439
156
|
price_in_decimal?:string;
|
|
440
157
|
|
|
441
|
-
/**
|
|
442
|
-
* @description 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.
|
|
443
|
-
|
|
444
|
-
*/
|
|
445
|
-
|
|
446
158
|
index:number;
|
|
447
159
|
}
|
|
448
160
|
export interface QuotedContractTerm {
|
|
449
|
-
/**
|
|
450
|
-
* @description The start date of the contract term
|
|
451
|
-
|
|
452
|
-
*/
|
|
453
|
-
|
|
454
161
|
contract_start:number;
|
|
455
162
|
|
|
456
|
-
/**
|
|
457
|
-
* @description The end date of the contract term
|
|
458
|
-
|
|
459
|
-
*/
|
|
460
|
-
|
|
461
163
|
contract_end:number;
|
|
462
164
|
|
|
463
|
-
/**
|
|
464
|
-
* @description The number of billing cycles of the subscription that the contract term is for.
|
|
465
|
-
|
|
466
|
-
*/
|
|
467
|
-
|
|
468
165
|
billing_cycle:number;
|
|
469
166
|
|
|
470
|
-
|
|
471
|
-
* @description Action to be taken when the contract term completes. \* renew -
|
|
472
|
-
* Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](subscriptions#create_subscription_for_customer_contract_term_billing_cycle_on_renewal).
|
|
473
|
-
* The `action_at_term_end` for the new contract term is set to `renew`.
|
|
474
|
-
\* renew_once - Used when you want to renew the contract term just once. Does the following:
|
|
475
|
-
* Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](subscriptions#create_subscription_for_customer_contract_term_billing_cycle_on_renewal).
|
|
476
|
-
* The `action_at_term_end` for the new contract term is set to `cancel`.
|
|
477
|
-
\* cancel - Contract term completes and subscription is canceled. \* evergreen - Contract term completes and the subscription renews.
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
*/
|
|
481
|
-
|
|
482
|
-
action_at_term_end:'cancel' | 'renew_once' | 'renew' | 'evergreen';
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* @description The sum of the [totals](invoices#invoice_total) 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](./#handling_currency_units). If the subscription was [imported](#import_a_subscription) with the contract term, then this value includes the value passed for `total_amount_raised`.
|
|
486
|
-
|
|
487
|
-
*/
|
|
167
|
+
action_at_term_end:'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
488
168
|
|
|
489
169
|
total_contract_value:number;
|
|
490
170
|
|
|
491
|
-
/**
|
|
492
|
-
* @description The number of days before [`contract_end`](contract_terms#contract_term_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
|
|
493
|
-
|
|
494
|
-
*/
|
|
495
|
-
|
|
496
171
|
cancellation_cutoff_period?:number;
|
|
497
172
|
}
|
|
498
173
|
}
|
|
@@ -1664,7 +1664,7 @@ Creates a new subscription for an existing customer in Chargebee. Any available
|
|
|
1664
1664
|
|
|
1665
1665
|
*/
|
|
1666
1666
|
|
|
1667
|
-
subscription_items:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
1667
|
+
subscription_items:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string,usage_accumulation_reset_frequency?:UsageAccumulationResetFrequency}[];
|
|
1668
1668
|
|
|
1669
1669
|
/**
|
|
1670
1670
|
* @description Parameters for discounts
|
|
@@ -2738,7 +2738,7 @@ Updates the specified subscription by setting the parameters passed. Any paramet
|
|
|
2738
2738
|
|
|
2739
2739
|
*/
|
|
2740
2740
|
|
|
2741
|
-
subscription_items:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,proration_type?:ProrationType,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
|
|
2741
|
+
subscription_items:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,proration_type?:ProrationType,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string,usage_accumulation_reset_frequency?:UsageAccumulationResetFrequency}[];
|
|
2742
2742
|
|
|
2743
2743
|
/**
|
|
2744
2744
|
* @description Parameters for discounts
|
|
@@ -3847,6 +3847,8 @@ If [addon billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle
|
|
|
3847
3847
|
billing_period?:number;
|
|
3848
3848
|
|
|
3849
3849
|
billing_period_unit?:'day' | 'week' | 'month' | 'year';
|
|
3850
|
+
|
|
3851
|
+
usage_accumulation_reset_frequency?:'never' | 'subscription_billing_frequency';
|
|
3850
3852
|
}
|
|
3851
3853
|
export interface ItemTier {
|
|
3852
3854
|
/**
|