chargebee 2.28.0 → 2.29.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 (51) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +6 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
  5. package/.github/workflows/greeting.yml +47 -0
  6. package/CHANGELOG.md +47 -0
  7. package/SECURITY.md +8 -0
  8. package/lib/chargebee.js +1 -1
  9. package/lib/resources/api_endpoints.js +0 -7
  10. package/package.json +1 -1
  11. package/types/core.d.ts +4 -4
  12. package/types/resources/AttachedItem.d.ts +88 -88
  13. package/types/resources/Card.d.ts +68 -68
  14. package/types/resources/Comment.d.ts +50 -44
  15. package/types/resources/Coupon.d.ts +242 -207
  16. package/types/resources/CouponSet.d.ts +72 -68
  17. package/types/resources/CreditNote.d.ts +612 -236
  18. package/types/resources/Customer.d.ts +655 -513
  19. package/types/resources/DifferentialPrice.d.ts +99 -74
  20. package/types/resources/EntitlementOverride.d.ts +27 -12
  21. package/types/resources/Estimate.d.ts +450 -450
  22. package/types/resources/Event.d.ts +30 -12
  23. package/types/resources/Export.d.ts +200 -200
  24. package/types/resources/Feature.d.ts +66 -35
  25. package/types/resources/Gift.d.ts +54 -44
  26. package/types/resources/HostedPage.d.ts +381 -381
  27. package/types/resources/InAppSubscription.d.ts +94 -90
  28. package/types/resources/Invoice.d.ts +1242 -660
  29. package/types/resources/Item.d.ts +148 -142
  30. package/types/resources/ItemEntitlement.d.ts +36 -36
  31. package/types/resources/ItemFamily.d.ts +45 -45
  32. package/types/resources/ItemPrice.d.ts +317 -273
  33. package/types/resources/PaymentIntent.d.ts +60 -60
  34. package/types/resources/PaymentVoucher.d.ts +74 -59
  35. package/types/resources/PortalSession.d.ts +45 -20
  36. package/types/resources/PromotionalCredit.d.ts +68 -68
  37. package/types/resources/Purchase.d.ts +3 -3
  38. package/types/resources/Quote.d.ts +652 -363
  39. package/types/resources/QuoteLineGroup.d.ts +245 -0
  40. package/types/resources/QuotedCharge.d.ts +170 -0
  41. package/types/resources/QuotedSubscription.d.ts +219 -0
  42. package/types/resources/SiteMigrationDetail.d.ts +7 -7
  43. package/types/resources/Subscription.d.ts +1219 -932
  44. package/types/resources/SubscriptionEntitlement.d.ts +33 -12
  45. package/types/resources/ThirdPartyPaymentMethod.d.ts +1 -1
  46. package/types/resources/TimeMachine.d.ts +15 -15
  47. package/types/resources/Token.d.ts +23 -23
  48. package/types/resources/Transaction.d.ts +229 -112
  49. package/types/resources/UnbilledCharge.d.ts +112 -67
  50. package/types/resources/Usage.d.ts +46 -47
  51. package/types/resources/VirtualBankAccount.d.ts +66 -66
@@ -128,91 +128,310 @@ declare module 'chargebee' {
128
128
 
129
129
 
130
130
  export interface Coupon {
131
+ /**
132
+ * @description Used to uniquely identify the coupon
133
+
134
+ */
135
+
131
136
  coupon_id?:string;
132
137
  }
133
138
  export interface Discount {
139
+ /**
140
+ * @description An immutable unique id for the discount. It is always auto-generated.
141
+
142
+ */
143
+
134
144
  id?:string;
135
145
 
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
+
136
151
  invoice_name?:string;
137
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
+
138
158
  type?:'fixed_amount' | 'percentage';
139
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
+
140
165
  percentage?:number;
141
166
 
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
+ */
171
+
142
172
  amount?:number;
143
173
 
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
+
144
179
  currency_code?:string;
145
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
+
146
186
  duration_type?:'limited_period' | 'one_time' | 'forever';
147
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
+
148
193
  period?:number;
149
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
+
150
200
  period_unit?:'week' | 'month' | 'year' | 'day';
151
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
+
152
207
  included_in_mrr?:boolean;
153
208
 
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
+ */
213
+
154
214
  apply_on?:'specific_item_price' | 'invoice_amount';
155
215
 
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
+ */
220
+
156
221
  item_price_id?:string;
157
222
 
223
+ /**
224
+ * @description Timestamp indicating when this discount is created.
225
+
226
+ */
227
+
158
228
  created_at?:number;
159
229
 
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
+ */
234
+
160
235
  apply_till?:number;
161
236
 
237
+ /**
238
+ * @description Specifies the number of times the discount has been applied.
239
+
240
+ */
241
+
162
242
  applied_count?:number;
163
243
 
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
+ */
253
+
164
254
  coupon_id?:string;
165
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
+
166
261
  index?:number;
167
262
  }
168
263
  export interface SubscriptionItem {
264
+ /**
265
+ * @description The unique identifier of the item price.
266
+
267
+ */
268
+
169
269
  item_price_id?:string;
170
270
 
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
+
171
276
  item_type?:'charge' | 'addon' | 'plan';
172
277
 
278
+ /**
279
+ * @description The quantity of the item purchased
280
+
281
+ */
282
+
173
283
  quantity?:number;
174
284
 
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
+
175
290
  quantity_in_decimal?:string;
176
291
 
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
+ */
296
+
177
297
  unit_price?:number;
178
298
 
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
+ */
303
+
179
304
  unit_price_in_decimal?:string;
180
305
 
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
+
181
311
  amount?:number;
182
312
 
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
+
183
318
  amount_in_decimal?:string;
184
319
 
320
+ /**
321
+ * @description The `free_quantity` of the plan-item as [specified](./item_prices?prod_cat_ver=2) for the item price.
322
+
323
+ */
324
+
185
325
  free_quantity?:number;
186
326
 
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
+ */
331
+
187
332
  free_quantity_in_decimal?:string;
188
333
 
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
+
189
339
  trial_end?:number;
190
340
 
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
+
191
350
  billing_cycles?:number;
192
351
 
352
+ /**
353
+ * @description The service period of the item in days from the day of charge.
354
+
355
+ */
356
+
193
357
  service_period_days?:number;
194
358
 
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
+
195
364
  charge_on_event?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation';
196
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
+ */
370
+
197
371
  charge_once?:boolean;
198
372
 
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
+
199
378
  charge_on_option?:'on_event' | 'immediately';
200
379
  }
201
380
  export interface ItemTier {
381
+ /**
382
+ * @description The id of the item price to which this tier belongs.
383
+
384
+ */
385
+
202
386
  item_price_id?:string;
203
387
 
388
+ /**
389
+ * @description The lowest value in the quantity tier.
390
+
391
+ */
392
+
204
393
  starting_unit?:number;
205
394
 
395
+ /**
396
+ * @description The highest value in the quantity tier.
397
+
398
+ */
399
+
206
400
  ending_unit?:number;
207
401
 
402
+ /**
403
+ * @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.
404
+
405
+ */
406
+
208
407
  price?:number;
209
408
 
409
+ /**
410
+ * @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.
411
+
412
+ */
413
+
210
414
  starting_unit_in_decimal?:string;
211
415
 
416
+ /**
417
+ * @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.
418
+
419
+ */
420
+
212
421
  ending_unit_in_decimal?:string;
213
422
 
423
+ /**
424
+ * @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.
425
+
426
+ */
427
+
214
428
  price_in_decimal?:string;
215
429
 
430
+ /**
431
+ * @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.
432
+
433
+ */
434
+
216
435
  index?:number;
217
436
  }
218
437
  export interface QuotedContractTerm {
@@ -71,49 +71,49 @@ declare module 'chargebee' {
71
71
  export interface ListInputParam {
72
72
  [key : string]: any;
73
73
  /**
74
- * @description The number of resources to be returned.
74
+ * @description This endpoint lists the site migration details.
75
75
 
76
76
  */
77
77
 
78
78
  limit?:number;
79
79
 
80
80
  /**
81
- * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \`offset\` to the value of \`next_offset\` obtained in the previous iteration of the API call.
81
+ * @description This endpoint lists the site migration details.
82
82
 
83
83
  */
84
84
 
85
85
  offset?:string;
86
86
 
87
87
  /**
88
- * @description Entity Id of the record in the other site.
88
+ * @description This endpoint lists the site migration details.
89
89
 
90
90
  */
91
91
 
92
92
  entity_id_at_other_site?:{is?:string,is_not?:string,starts_with?:string};
93
93
 
94
94
  /**
95
- * @description Site name to which the record is moved in/out.
95
+ * @description This endpoint lists the site migration details.
96
96
 
97
97
  */
98
98
 
99
99
  other_site_name?:{is?:string,is_not?:string,starts_with?:string};
100
100
 
101
101
  /**
102
- * @description Id of the entity in this site.
102
+ * @description This endpoint lists the site migration details.
103
103
 
104
104
  */
105
105
 
106
106
  entity_id?:{is?:string,is_not?:string,starts_with?:string};
107
107
 
108
108
  /**
109
- * @description Entity Type of the record
109
+ * @description This endpoint lists the site migration details.
110
110
 
111
111
  */
112
112
 
113
113
  entity_type?:{in?:string,is?:'credit_note' | 'subscription' | 'invoice' | 'transaction' | 'customer' | 'order',is_not?:'credit_note' | 'subscription' | 'invoice' | 'transaction' | 'customer' | 'order',not_in?:string};
114
114
 
115
115
  /**
116
- * @description Status of the migration
116
+ * @description This endpoint lists the site migration details.
117
117
 
118
118
  */
119
119