chargebee 2.47.0 → 2.49.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +149 -0
  2. package/lib/chargebee.js +1 -1
  3. package/lib/resources/api_endpoints.js +16 -2
  4. package/package.json +1 -1
  5. package/types/core.d.ts +5 -4
  6. package/types/index.d.ts +6 -0
  7. package/types/resources/Addon.d.ts +440 -0
  8. package/types/resources/CreditNote.d.ts +40 -1
  9. package/types/resources/CreditNoteEstimate.d.ts +8 -2
  10. package/types/resources/DifferentialPrice.d.ts +6 -2
  11. package/types/resources/Estimate.d.ts +6 -4
  12. package/types/resources/HostedPage.d.ts +227 -893
  13. package/types/resources/Invoice.d.ts +44 -5
  14. package/types/resources/InvoiceEstimate.d.ts +40 -1
  15. package/types/resources/Item.d.ts +4 -0
  16. package/types/resources/ItemPrice.d.ts +6 -2
  17. package/types/resources/OmnichannelSubscription.d.ts +5 -5
  18. package/types/resources/OmnichannelSubscriptionItem.d.ts +42 -1
  19. package/types/resources/OmnichannelSubscriptionItemScheduledChange.d.ts +36 -0
  20. package/types/resources/OmnichannelTransaction.d.ts +4 -4
  21. package/types/resources/PaymentSource.d.ts +7 -0
  22. package/types/resources/Plan.d.ts +554 -0
  23. package/types/resources/Purchase.d.ts +13 -258
  24. package/types/resources/Quote.d.ts +18 -12
  25. package/types/resources/QuoteLineGroup.d.ts +12 -322
  26. package/types/resources/QuotedCharge.d.ts +23 -219
  27. package/types/resources/QuotedSubscription.d.ts +4 -0
  28. package/types/resources/Ramp.d.ts +48 -542
  29. package/types/resources/RecordedPurchase.d.ts +5 -3
  30. package/types/resources/Subscription.d.ts +7 -3
  31. package/types/resources/Transaction.d.ts +1 -1
  32. package/types/resources/UnbilledCharge.d.ts +31 -25
@@ -1,327 +1,93 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
2
3
  declare module 'chargebee' {
3
4
  export interface Ramp {
4
5
 
5
- /**
6
- * @description A unique and immutable identifier for the ramp.
7
6
 
8
- */
9
-
10
7
  id:string;
11
-
12
- /**
13
- * @description A brief summary of the pricing changes applied with this ramp.
14
8
 
15
- */
16
-
17
9
  description?:string;
18
-
19
- /**
20
- * @description The ID of the subscription for which this ramp was created.
21
10
 
22
- */
23
-
24
11
  subscription_id:string;
25
-
26
- /**
27
- * @description Specifies the time when the changes to the subscription will be applied by executing the ramp.
28
12
 
29
- */
30
-
31
13
  effective_from:number;
32
-
33
- /**
34
- * @description The execution status of the ramp \* succeeded - The ramp completed successfully. \* scheduled - The ramp has been created and scheduled for execution.
35
- **Note**
36
-
37
- Excluding deleted ramps, a subscription can have a maximum of 12 ramps in the &#x60;scheduled&#x60; &#x60;status&#x60;.
38
- \* failed - The ramp did not complete because of an error.
39
14
 
40
- */
41
-
42
- status:'scheduled' | 'succeeded' | 'failed';
43
-
44
- /**
45
- * @description Timestamp indicating when this resource was created.
15
+ status:'scheduled' | 'succeeded' | 'failed' | 'draft';
46
16
 
47
- */
48
-
49
17
  created_at:number;
50
-
51
- /**
52
- * @description Version number of this resource. The &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds for every change made to the resource.
53
18
 
54
- */
55
-
56
19
  resource_version?:number;
57
-
58
- /**
59
- * @description Timestamp indicating when this resource was last updated.
60
20
 
61
- */
62
-
63
21
  updated_at?:number;
64
-
65
- /**
66
- * @description List of [item prices](item_prices) removed from the subscription through this ramp.
67
22
 
68
- */
69
-
70
- items_to_remove?:string[];
71
-
72
- /**
73
- * @description List of &lt;coupons&gt; removed from the subscription through this ramp.
74
-
75
- */
76
-
77
- coupons_to_remove?:string[];
78
-
79
- /**
80
- * @description List of &lt;discounts&gt; removed from the subscription through this ramp.
81
-
82
- */
83
-
84
- discounts_to_remove?:string[];
85
-
86
- /**
87
- * @description Indicates that this resource has been deleted.
88
-
89
- */
90
-
91
- deleted:boolean;
92
-
93
- /**
94
- * @description Details about the [item prices](/docs/api/item_prices?prod_cat_ver&#x3D;2) added to the subscription through this ramp.
95
-
96
- */
97
-
98
23
  items_to_add?:Ramp.ItemsToAdd[];
99
-
100
- /**
101
- * @description Details about the [item prices](item_prices) updated in the subscription through this ramp.
102
24
 
103
- */
104
-
105
25
  items_to_update?:Ramp.ItemsToUpdate[];
106
-
107
- /**
108
- * @description Details about the &lt;coupons&gt; added to the subscription through this ramp.
109
26
 
110
- */
111
-
112
27
  coupons_to_add?:Ramp.CouponsToAdd[];
113
-
114
- /**
115
- * @description Details about the [discounts](/docs/api/discounts?prod_cat_ver&#x3D;2) added to the subscription through this ramp.
116
28
 
117
- */
118
-
119
29
  discounts_to_add?:Ramp.DiscountsToAdd[];
120
-
121
- /**
122
- * @description **Note**
123
30
 
124
- Allowed only when both of these conditions are met:
31
+ item_tiers?:Ramp.ItemTier[];
32
+
33
+ items_to_remove?:string[];
125
34
 
126
- * [Price overriding](https://www.chargebee.com/docs/2.0/price-override.html) is enabled for the site.
127
- * &#x60;pricing_model&#x60; of the item price is either &#x60;tiered&#x60;, &#x60;volume&#x60;, or &#x60;stairstep&#x60;.
35
+ coupons_to_remove?:string[];
128
36
 
129
- Overrides the [item_tiers](subscriptions#subscription_item_tiers) for specific &#x60;item_prices&#x60; of the subscription.
37
+ discounts_to_remove?:string[];
130
38
 
131
- */
132
-
133
- item_tiers?:Ramp.ItemTier[];
39
+ deleted:boolean;
134
40
 
135
41
  status_transition_reason?:Ramp.StatusTransitionReason;
42
+
136
43
  }
137
44
  export namespace Ramp {
138
45
  export class RampResource {
139
- /**
140
- * @description Creates a ramp for a subscription.
141
- **Note**
142
-
143
- * **Subscription status** : You cannot create ramps for subscriptions in the &#x60;paused&#x60; or &#x60;cancelled&#x60; [status](subscriptions?prod_cat_ver&#x3D;2#subscription_status).
144
- * **Advance invoice** : You cannot create a ramps for subscriptions that have an [advance invoice](https://www.chargebee.com/docs/2.0/advance-invoices.html) or an [advance invoice schedule](advance_invoice_schedules?prod_cat_ver&#x3D;2).
145
- * **Upcoming ramps limit** : A subscription can have a maximum of 12 upcoming ramps at any given time, excluding deleted ramps. Upcoming ramps are ramps with &#x60;status&#x60; as [scheduled](ramps#ramp_status).
146
- * **Total ramps limit**: A subscription can have a maximum of 100 ramps at any given time, excluding deleted ramps.
147
-
148
- */
149
-
150
46
  create_for_subscription(subscription_id:string, input:CreateForSubscriptionInputParam):ChargebeeRequest<CreateForSubscriptionResponse>;
151
47
 
152
- /**
153
- * @description Retrieves a specific subscription ramp.
154
-
155
- */
156
-
157
- retrieve(subscription_schedule_id:string):ChargebeeRequest<RetrieveResponse>;
48
+ update(ramp_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
158
49
 
159
- /**
160
- * @description Deletes the specified subscription ramp. However, Chargebee only allows deleting a ramp if it does not conflict with future ramps on the subscription. The following checks are performed to ensure compatibility:
161
-
162
- | Condition | Restriction |
163
- |----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
164
- | The ramp contains &#x60;items_to_add[]&#x60; | The ramp cannot be deleted if any of the items in &#x60;items_to_add[]&#x60; are scheduled to be updated or removed in a subsequent ramp. |
165
- | The ramp contains &#x60;coupons_to_add[]&#x60; | The ramp cannot be deleted if any of the coupons in &#x60;coupons_to_add[]&#x60; are scheduled to be removed in a subsequent ramp. |
166
- | The ramp contains &#x60;discounts_to_add[]&#x60; | The ramp cannot be deleted if any of the discounts in &#x60;discounts_to_add[]&#x60; are scheduled to be removed in a subsequent ramp. |
167
-
168
-
169
- */
170
-
171
- delete(subscription_schedule_id:string):ChargebeeRequest<DeleteResponse>;
50
+ retrieve(ramp_id:string):ChargebeeRequest<RetrieveResponse>;
51
+
52
+ delete(ramp_id:string):ChargebeeRequest<DeleteResponse>;
172
53
 
173
- /**
174
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
175
- **Note**
176
-
177
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
178
-
179
- */
180
-
181
54
  list(input:ListInputParam):ChargebeeRequest<ListResponse>;
182
-
183
- update(ramp_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
184
55
  }
185
56
  export interface CreateForSubscriptionResponse {
186
57
  ramp:Ramp;
187
58
  }
188
59
  export interface CreateForSubscriptionInputParam {
189
60
 
190
- /**
191
- * @description The time when this ramp takes effect.
192
- **Caution**
193
-
194
- * Ensure the time is within **five** years from the current time.
195
- * Ensure there is a minimum 24-hour interval between &#x60;effective_from&#x60; of two consecutive ramps.
196
- * If the subscription is scheduled to be paused or canceled in the future, ensure the time is not on or after [pause_date](subscriptions?prod_cat_ver&#x3D;2#subscription_pause_date) or [cancelled_at](subscriptions?prod_cat_ver&#x3D;2#subscription_cancelled_at).
197
-
198
- */
61
+ items_to_add:{billing_cycles?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
199
62
 
200
- effective_from:number;
63
+ items_to_update:{billing_cycles?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
201
64
 
202
- /**
203
- * @description A brief summary of the pricing changes applied with this ramp.
204
-
205
- */
65
+ item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,package_size?:number,price?:number,price_in_decimal?:string,pricing_type?:PricingType,starting_unit?:number,starting_unit_in_decimal?:string}[];
206
66
 
207
- description?:string;
67
+ coupons_to_add?:{apply_till?:number,coupon_id?:string}[];
208
68
 
209
- /**
210
- * @description List of &lt;coupons&gt; removed from the subscription through this ramp.
211
- **Caution**
212
-
213
- Ensure this list does **not** include:
214
-
215
- * Coupons being added through this ramp.
216
- * Coupons already removed by a previous ramp.
217
-
218
- */
69
+ discounts_to_add:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
219
70
 
220
- coupons_to_remove?:string[];
71
+ effective_from:number;
221
72
 
222
- /**
223
- * @description List of &lt;discounts&gt; removed from the subscription through this ramp.
224
- **Caution**
225
-
226
- Ensure this list does not include discounts already removed by a previous ramp.
227
-
228
- */
73
+ description?:string;
229
74
 
230
- discounts_to_remove?:string[];
75
+ coupons_to_remove?:string[];
231
76
 
232
- /**
233
- * @description List of [item prices](item_prices) removed from the subscription through this ramp.
234
- **Caution**
235
-
236
- Ensure this list does **not** include:
237
-
238
- * Item prices being added or updated through this ramp.
239
- * Item prices already removed by a previous ramp.
240
-
241
- */
77
+ discounts_to_remove?:string[];
242
78
 
243
79
  items_to_remove?:string[];
244
-
245
- /**
246
- * @description Details about the [item prices](/docs/api/item_prices?prod_cat_ver&#x3D;2) added to the subscription through this ramp.
247
-
248
- */
249
-
250
- items_to_add:{billing_cycles?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
251
-
252
- /**
253
- * @description Details about the [item prices](item_prices) updated in the subscription through this ramp.
254
-
255
- */
256
-
257
- items_to_update:{billing_cycles?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
258
-
259
- /**
260
- * @description **Note**
261
-
262
- Allowed only when both of these conditions are met:
263
-
264
- * Price overriding is enabled for the site.
265
- * pricing_model of the item price is either tiered, volume, or stairstep.
266
-
267
- Replaces the existing item_tiers for specific &#x60;item_price&#x60;s within the subscription. You must provide the complete tier set for any &#x60;item_price&#x60;, even if you&#x27;re changing the price for only one tier.
268
-
269
- */
270
-
271
- item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
272
-
273
- /**
274
- * @description Details about the &lt;coupons&gt; added to the subscription through this ramp.
275
-
276
- */
277
-
278
- coupons_to_add?:{apply_till?:number,coupon_id?:string}[];
279
-
280
- /**
281
- * @description Details about the [discounts](/docs/api/discounts?prod_cat_ver&#x3D;2) added to the subscription through this ramp.
282
-
283
- */
284
-
285
- discounts_to_add:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
286
- }
287
- export interface RetrieveResponse {
288
- ramp:Ramp;
289
80
  }
290
81
  export interface UpdateResponse {
291
- ramp:Ramp;
292
- }
293
- export interface DeleteResponse {
294
82
  ramp:Ramp;
295
83
  }
296
-
297
- export interface ListResponse {
298
- /**
299
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
300
- **Note**
301
-
302
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
303
-
304
- */
305
-
306
- list:{ramp:Ramp}[];
307
-
308
- /**
309
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
310
- **Note**
311
-
312
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
313
-
314
- */
315
-
316
- next_offset?:string;
317
- }
318
84
  export interface UpdateInputParam {
319
-
85
+
320
86
  items_to_add:{billing_cycles?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
321
87
 
322
88
  items_to_update:{billing_cycles?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
323
89
 
324
- item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
90
+ item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,package_size?:number,price?:number,price_in_decimal?:string,pricing_type?:PricingType,starting_unit?:number,starting_unit_in_decimal?:string}[];
325
91
 
326
92
  coupons_to_add?:{apply_till?:number,coupon_id?:string}[];
327
93
 
@@ -337,434 +103,174 @@ By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descend
337
103
 
338
104
  items_to_remove?:string[];
339
105
  }
106
+ export interface RetrieveResponse {
107
+ ramp:Ramp;
108
+ }
109
+
110
+ export interface DeleteResponse {
111
+ ramp:Ramp;
112
+ }
113
+
114
+ export interface ListResponse {
115
+ list:{ramp:Ramp}[];
116
+
117
+ next_offset?:string;
118
+ }
340
119
  export interface ListInputParam {
341
120
  [key : string]: any;
342
121
  /**
343
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
344
- **Note**
345
-
346
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
122
+ * @description The number of resources to be returned.
347
123
 
348
124
  */
349
125
 
350
126
  limit?:number;
351
127
 
352
128
  /**
353
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
354
- **Note**
355
-
356
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
129
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
357
130
 
358
131
  */
359
132
 
360
133
  offset?:string;
361
134
 
362
135
  /**
363
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
364
- **Note**
365
-
366
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
136
+ * @description Indicates whether to include deleted objects in the list. The deleted objects have the attribute \&#x60;deleted\&#x60; as \&#x60;true\&#x60;.
367
137
 
368
138
  */
369
139
 
370
140
  include_deleted?:boolean;
371
141
 
372
142
  /**
373
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
374
- **Note**
375
-
376
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
143
+ * @description Filter ramps by Status.
377
144
 
378
145
  */
379
146
 
380
- status?:{in?:string,is?:'scheduled' | 'succeeded' | 'failed'};
147
+ status?:{in?:string,is?:'scheduled' | 'succeeded' | 'failed' | 'draft'};
381
148
 
382
149
  /**
383
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
384
- **Note**
385
-
386
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
150
+ * @description Filter ramps by Subscription Id.
387
151
 
388
152
  */
389
153
 
390
154
  subscription_id:{in?:string,is?:string};
391
155
 
392
156
  /**
393
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
394
- **Note**
395
-
396
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
157
+ * @description Filter ramps by &#x60;effective_from&#x60;
397
158
 
398
159
  */
399
160
 
400
161
  effective_from?:{after?:string,before?:string,between?:string,on?:string};
401
162
 
402
163
  /**
403
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
404
- **Note**
405
-
406
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
164
+ * @description Filter ramps by resource_updated_at
407
165
 
408
166
  */
409
167
 
410
168
  updated_at?:{after?:string,before?:string,between?:string,on?:string};
411
169
 
412
- /**
413
- * @description Lists the subscription ramps that match the criteria provided in the filter parameters.
414
- **Note**
415
-
416
- By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descending order (latest first) by [updated_at](ramps#ramp_updated_at).
417
-
418
- */
419
-
420
170
  sort_by?:{asc?:'effective_from' | 'updated_at',desc?:'effective_from' | 'updated_at'};
421
171
  }
422
172
  export interface ItemsToAdd {
423
- /**
424
- * @description The unique identifier of the item price.
425
-
426
- */
427
-
428
173
  item_price_id:string;
429
174
 
430
- /**
431
- * @description The type of item. There must be one and only one item of type &#x60;plan&#x60; in this list. \* charge - Charge \* plan - Plan \* addon - Addon
432
-
433
- */
434
-
435
175
  item_type:'plan' | 'addon' | 'charge';
436
176
 
437
- /**
438
- * @description The quantity of the item purchased
439
-
440
- */
441
-
442
177
  quantity?:number;
443
178
 
444
- /**
445
- * @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/currencies#handling_currency_units) is enabled.
446
-
447
- */
448
-
449
179
  quantity_in_decimal?:string;
450
180
 
451
- /**
452
- * @description The price/per unit price of the item. When not provided, [the value set](/docs/api/item_prices?prod_cat_ver&#x3D;2#item_price_attributes) for the item price is used. This is only applicable when the &#x60;pricing_model&#x60; of the item price is &#x60;flat_fee&#x60; or &#x60;per_unit&#x60;. 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](currencies#handling_currency_units).
453
-
454
- */
455
-
456
181
  unit_price?:number;
457
182
 
458
- /**
459
- * @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/currencies#handling_currency_units) is enabled.
460
-
461
- */
462
-
463
183
  unit_price_in_decimal?:string;
464
184
 
465
- /**
466
- * @description The total amount for the item as determined from &#x60;unit_price&#x60;, &#x60;free_quantity&#x60;, &#x60;quantity&#x60; and &#x60;item_tiers&#x60; as applicable. The value depends on the [type of currency](currencies#handling_currency_units).
467
-
468
- */
469
-
470
185
  amount?:number;
471
186
 
472
- /**
473
- * @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/currencies#handling_currency_units) is enabled.
474
-
475
- */
476
-
477
187
  amount_in_decimal?:string;
478
188
 
479
- /**
480
- * @description The quantity of the item price that is available for free. Only the quantity more than this will be charged for the subscription. This is the same as [item_price.free_quantity](item_prices#item_price_free_quantity).
481
-
482
- */
483
-
484
189
  free_quantity?:number;
485
190
 
486
- /**
487
- * @description The &#x60;free_quantity_in_decimal&#x60; as set for the item price. Returned for quantity-based item prices when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api/currencies#handling_currency_units) is enabled.
488
-
489
- */
490
-
491
191
  free_quantity_in_decimal?:string;
492
192
 
493
- /**
494
- * @description For the plan-item price:
495
- 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&#x3D;2#item_price_attributes) for the plan-item price is used.
496
-
497
- For addon-item prices:
498
- 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&#x3D;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&#x3D;2#item_price_attributes) is used.
499
-
500
- */
501
-
502
193
  billing_cycles?:number;
503
194
 
504
- /**
505
- * @description The service period of the item in days from the day of charge.
506
-
507
- */
508
-
509
195
  service_period_days?:number;
510
196
 
511
- /**
512
- * @description This field represents the number of quantities recorded against this subscription item in the current term
513
-
514
- */
515
-
516
197
  metered_quantity?:string;
517
198
  }
518
199
  export interface ItemsToUpdate {
519
- /**
520
- * @description The unique identifier of the item price.
521
-
522
- */
523
-
524
200
  item_price_id:string;
525
201
 
526
- /**
527
- * @description The type of item. There must be one and only one item of type &#x60;plan&#x60; in this list. \* addon - Addon \* charge - Charge \* plan - Plan
528
-
529
- */
530
-
531
202
  item_type:'plan' | 'addon' | 'charge';
532
203
 
533
- /**
534
- * @description The quantity of the item purchased
535
-
536
- */
537
-
538
204
  quantity?:number;
539
205
 
540
- /**
541
- * @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.
542
-
543
- */
544
-
545
206
  quantity_in_decimal?:string;
546
207
 
547
- /**
548
- * @description The price/per unit price of the item. When not provided, [the value set](/docs/api/item_prices?prod_cat_ver&#x3D;2#item_price_attributes) for the item price is used. This is only applicable when the &#x60;pricing_model&#x60; of the item price is &#x60;flat_fee&#x60; or &#x60;per_unit&#x60;. 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](currencies#handling_currency_units).
549
-
550
- */
551
-
552
208
  unit_price?:number;
553
209
 
554
- /**
555
- * @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.
556
-
557
- */
558
-
559
210
  unit_price_in_decimal?:string;
560
211
 
561
- /**
562
- * @description The total amount for the item as determined from &#x60;unit_price&#x60;, &#x60;free_quantity&#x60;, &#x60;quantity&#x60; and &#x60;item_tiers&#x60; as applicable. The value depends on the [type of currency](currencies#handling_currency_units).
563
-
564
- */
565
-
566
212
  amount?:number;
567
213
 
568
- /**
569
- * @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.
570
-
571
- */
572
-
573
214
  amount_in_decimal?:string;
574
215
 
575
- /**
576
- * @description The quantity of the item price that is available for free. Only the quantity more than this will be charged for the subscription. This is the same as [item_price.free_quantity](item_prices#item_price_free_quantity)..
577
-
578
- */
579
-
580
216
  free_quantity?:number;
581
217
 
582
- /**
583
- * @description The &#x60;free_quantity_in_decimal&#x60; 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.
584
-
585
- */
586
-
587
218
  free_quantity_in_decimal?:string;
588
219
 
589
- /**
590
- * @description For the plan-item price:
591
- 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&#x3D;2#item_price_attributes) for the plan-item price is used.
592
-
593
- For addon-item prices:
594
- 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&#x3D;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&#x3D;2#item_price_attributes) is used.
595
-
596
- */
597
-
598
220
  billing_cycles?:number;
599
221
 
600
- /**
601
- * @description The service period of the item in days from the day of charge.
602
-
603
- */
604
-
605
222
  service_period_days?:number;
606
223
 
607
- /**
608
- * @description This field represents the number of quantities recorded against this subscription item in the current term
609
-
610
- */
611
-
612
224
  metered_quantity?:string;
613
225
  }
614
226
  export interface CouponsToAdd {
615
- /**
616
- * @description Unique ID of the coupon to be added.
617
-
618
- */
619
-
620
227
  coupon_id:string;
621
228
 
622
- /**
623
- * @description The date till when the coupon can be applied. Applicable for &#x60;limited_period&#x60; [coupons](./coupons?prod_cat_ver&#x3D;2) only.
624
-
625
- */
626
-
627
229
  apply_till?:number;
628
230
  }
629
231
  export interface DiscountsToAdd {
630
- /**
631
- * @description An immutable unique id for the discount. It is always auto-generated.
632
-
633
- */
634
-
635
232
  id:string;
636
233
 
637
- /**
638
- * @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&#x3D;2) and [hosted pages](/docs/api/hosted_pages?prod_cat_ver&#x3D;2). This is auto-generated based on the &#x60;type&#x60;, &#x60;amount&#x60;, and &#x60;currency_code&#x60; of the discount. For example, it can be &#x60;10% off&#x60; or &#x60;10$ off&#x60;.
639
-
640
- */
641
-
642
234
  invoice_name?:string;
643
235
 
644
- /**
645
- * @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.
646
-
647
- */
648
-
649
236
  type:'fixed_amount' | 'percentage';
650
237
 
651
- /**
652
- * @description The percentage of the original amount that should be deducted from it. Only applicable when &#x60;discount.type&#x60; is percentage.
653
-
654
- */
655
-
656
238
  percentage?:number;
657
239
 
658
- /**
659
- * @description The value of the discount. [The format of this value](https://apidocs.chargebee.com/docs/api?prod_cat_ver&#x3D;2#currencies) depends on the kind of currency. This is only applicable when &#x60;discount.type&#x60; is &#x60;fixed_amount&#x60;.
660
-
661
- */
662
-
663
240
  amount?:number;
664
241
 
665
- /**
666
- * @description Specifies the time duration for which this discount is attached to the subscription. \* 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. \* forever - The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions?prod_cat_ver&#x3D;2#update_subscription_for_items_discounts_operation_type). \* 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 &#x60;period&#x60; and &#x60;period_unit&#x60;.
667
-
668
- */
669
-
670
242
  duration_type:'one_time' | 'forever' | 'limited_period';
671
243
 
672
- /**
673
- * @description The duration of time for which the discount is attached to the subscription, in &#x60;period_units&#x60;. Applicable only when &#x60;duration_type&#x60; is &#x60;limited_period&#x60;.
674
-
675
- */
676
-
677
244
  period?:number;
678
245
 
679
- /**
680
- * @description The unit of time for &#x60;period&#x60;. Applicable only when &#x60;duration_type&#x60; is &#x60;limited_period&#x60;. \* week - A period of 7 days. \* year - A period of 1 calendar year. \* day - A period of 24 hours. \* month - A period of 1 calendar month.
681
-
682
- */
683
-
684
246
  period_unit?:'day' | 'week' | 'month' | 'year';
685
247
 
686
- /**
687
- * @description The discount is included in MRR calculations for your site. This attribute is only applicable when &#x60;duration_type&#x60; is &#x60;one_time&#x60; 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 &#x60;false&#x60;.
688
-
689
- */
690
-
691
248
  included_in_mrr:boolean;
692
249
 
693
- /**
694
- * @description The amount on the invoice to which the discount is applied. \* invoice_amount - The discount is applied to the invoice &#x60;sub_total&#x60;. \* specific_item_price - The discount is applied to the &#x60;invoice.line_item.amount&#x60; that corresponds to the item price specified by &#x60;item_price_id&#x60;.
695
-
696
- */
697
-
698
250
  apply_on:'invoice_amount' | 'specific_item_price';
699
251
 
700
- /**
701
- * @description The [id of the item price](/docs/api/subscriptions?prod_cat_ver&#x3D;2#subscription_subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when &#x60;apply_on&#x60; &#x3D; &#x60;specific_item_price&#x60;.
702
-
703
- */
704
-
705
252
  item_price_id?:string;
706
253
 
707
- /**
708
- * @description Timestamp indicating when this discount is created.
709
-
710
- */
711
-
712
254
  created_at:number;
713
255
  }
714
256
  export interface ItemTier {
715
- /**
716
- * @description The id of the item price to which this tier belongs.
717
-
718
- */
719
-
720
257
  item_price_id:string;
721
258
 
722
- /**
723
- * @description The lowest value in the quantity tier.
724
-
725
- */
726
-
727
259
  starting_unit:number;
728
260
 
729
- /**
730
- * @description The highest value in the quantity tier.
731
-
732
- */
733
-
734
261
  ending_unit?:number;
735
262
 
736
- /**
737
- * @description The per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. The total cost for the item price when the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;. The value is in the minor unit of the currency.
738
-
739
- */
740
-
741
263
  price:number;
742
264
 
743
- /**
744
- * @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 &#x60;ending_unit_in_decimal&#x60; of the next lower tier. Returned only when the pricing_model is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api/currencies#handling_currency_units) is enabled.
745
-
746
- */
747
-
748
265
  starting_unit_in_decimal?:string;
749
266
 
750
- /**
751
- * @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 &#x60;starting_unit_in_decimal&#x60; of the next higher tier. Returned only when the pricing_model is &#x60;tiered&#x60;, &#x60;volume&#x60; or &#x60;stairstep&#x60; and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api/currencies#handling_currency_units) is enabled.
752
-
753
- */
754
-
755
267
  ending_unit_in_decimal?:string;
756
268
 
757
- /**
758
- * @description The decimal representation of the per-unit price for the tier when the &#x60;pricing_model&#x60; is &#x60;tiered&#x60; or &#x60;volume&#x60;. When the &#x60;pricing_model&#x60; is &#x60;stairstep&#x60;, 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/currencies#handling_currency_units) is enabled.
759
-
760
- */
761
-
762
269
  price_in_decimal?:string;
763
270
 
764
- /**
765
- * @description Not used.
766
-
767
- */
271
+ pricing_type?:'per_unit' | 'flat_fee' | 'package';
272
+
273
+ package_size?:number;
768
274
 
769
275
  index:number;
770
276
  }