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
@@ -104,108 +104,353 @@ declare module 'chargebee' {
104
104
 
105
105
 
106
106
  export interface LineItem {
107
+ /**
108
+ * @description Uniquely identifies a line_item
109
+
110
+ */
111
+
107
112
  id?:string;
108
113
 
114
+ /**
115
+ * @description A unique identifier for the subscription this line item belongs to.
116
+
117
+ */
118
+
109
119
  subscription_id?:string;
110
120
 
121
+ /**
122
+ * @description Start date of this line item.
123
+
124
+ */
125
+
111
126
  date_from?:number;
112
127
 
128
+ /**
129
+ * @description End date of this line item.
130
+
131
+ */
132
+
113
133
  date_to?:number;
114
134
 
135
+ /**
136
+ * @description Unit amount of the line item.
137
+
138
+ */
139
+
115
140
  unit_amount?:number;
116
141
 
142
+ /**
143
+ * @description [Quantity of the recurring item](/docs/api/invoices?prod_cat_ver=2#invoice_line_items_quantity) which is represented by this line item. For `metered` line items, this value is updated from [usages](/docs/api/usages) once when the invoice is generated as `pending` and finally when the invoice is [closed](/docs/api/invoices#close_a_pending_invoice).
144
+
145
+ */
146
+
117
147
  quantity?:number;
118
148
 
149
+ /**
150
+ * @description Total amount of this line item. Typically equals to unit amount x quantity
151
+
152
+ */
153
+
119
154
  amount?:number;
120
155
 
156
+ /**
157
+ * @description The [pricing scheme](https://www.chargebee.com/docs/2.0/plans.html#pricing-models) for this item price. \* per_unit - A fixed price per unit quantity. \* stairstep - A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in. \* flat_fee - A fixed price that is not quantity-based. \* tiered - The per unit price is based on the tier that the total quantity falls in. \* volume - There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.
158
+
159
+ */
160
+
121
161
  pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
122
162
 
163
+ /**
164
+ * @description Specifies whether this line item is taxed or not
165
+
166
+ */
167
+
123
168
  is_taxed?:boolean;
124
169
 
170
+ /**
171
+ * @description The tax amount charged for this item
172
+
173
+ */
174
+
125
175
  tax_amount?:number;
126
176
 
177
+ /**
178
+ * @description Rate of tax used to calculate tax for this lineitem
179
+
180
+ */
181
+
127
182
  tax_rate?:number;
128
183
 
184
+ /**
185
+ * @description The decimal representation of the unit amount of the `line_item`. The value is in major units of the currency. Returned when the `line_item` is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
186
+
187
+ */
188
+
129
189
  unit_amount_in_decimal?:string;
130
190
 
191
+ /**
192
+ * @description The decimal representation of the quantity of this line_item. Returned when the `line_item` is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
193
+
194
+ */
195
+
131
196
  quantity_in_decimal?:string;
132
197
 
198
+ /**
199
+ * @description The decimal representation of the amount for the `line_item`, in major units of the currency. Typically equals to `unit_amount_in_decimal` x `quantity_in_decimal`. Returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
200
+
201
+ */
202
+
133
203
  amount_in_decimal?:string;
134
204
 
205
+ /**
206
+ * @description Total discounts for this line
207
+
208
+ */
209
+
135
210
  discount_amount?:number;
136
211
 
212
+ /**
213
+ * @description Line Item-level discounts for this line.
214
+
215
+ */
216
+
137
217
  item_level_discount_amount?:number;
138
218
 
219
+ /**
220
+ * @description Invoice Reference Line Item ID
221
+
222
+ */
223
+
139
224
  reference_line_item_id?:string;
140
225
 
226
+ /**
227
+ * @description Detailed description about this line item.
228
+
229
+ */
230
+
141
231
  description?:string;
142
232
 
233
+ /**
234
+ * @description Detailed description about this item.
235
+
236
+ */
237
+
143
238
  entity_description?:string;
144
239
 
240
+ /**
241
+ * @description Specifies the modelled entity this line item is based on. \* addon - Indicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the [addon](/docs/api/addons#addon_attributes) id \* plan_item_price - Indicates that this line item is based on plan Item Price \* addon_item_price - Indicates that this line item is based on addon Item Price \* charge_item_price - Indicates that this line item is based on charge Item Price \* adhoc - Indicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case \* plan_setup - Indicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the [plan](/docs/api/plans#plan_attributes) id \* plan - Indicates that this lineitem is based on 'Plan' entity. The 'entity_id' attribute specifies the [plan](/docs/api/plans#plan_attributes) id
242
+
243
+ */
244
+
145
245
  entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
146
246
 
247
+ /**
248
+ * @description The reason due to which the line item price/amount is exempted from tax. \* reverse_charge - If the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU only \* tax_not_configured - If tax is not enabled for the site \* high_value_physical_goods - If physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be applied \* product_exempt - If the Plan or Addon is marked as Tax exempt \* zero_rated - If the rate of tax is 0% and no Sales/ GST tax is collectable for that line item \* customer_exempt - If the Customer is marked as Tax exempt \* region_non_taxable - If the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdiction \* export - You are not registered for tax in the customer's region. This is also the reason code when both `billing_address` and `shipping_address` have not been provided for the customer and subscription respectively
249
+
250
+ */
251
+
147
252
  tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
148
253
 
254
+ /**
255
+ * @description The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
256
+
257
+ */
258
+
149
259
  entity_id?:string;
150
260
 
261
+ /**
262
+ * @description A unique identifier for the customer this line item belongs to
263
+
264
+ */
265
+
151
266
  customer_id?:string;
152
267
  }
153
268
  export interface Discount {
269
+ /**
270
+ * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api?prod_cat_ver=2#currencies).
271
+
272
+ */
273
+
154
274
  amount?:number;
155
275
 
276
+ /**
277
+ * @description Description for this deduction.
278
+
279
+ */
280
+
156
281
  description?:string;
157
282
 
283
+ /**
284
+ * @description The unique id of the line item that this deduction is for. Is required when `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon`.
285
+
286
+ */
287
+
158
288
  line_item_id?:string;
159
289
 
290
+ /**
291
+ * @description The type of deduction and the amount to which it is applied. \* document_level_coupon - The deduction is due to a coupon applied to the invoice `sub_total`. The coupon id is passed as `entity_id`. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver=2#invoice_adjustment_credit_notes). \* item_level_coupon - The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id`. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to a line item of the invoice. The discount `id` is available as the `entity_id`. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits?prod_cat_ver=2) applied to the invoice. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
292
+
293
+ */
294
+
160
295
  entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
161
296
 
297
+ /**
298
+ * @description The type of discount that is applied to the line item. Relevant only when `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon`, `document_level_discount`, or `document_level_coupon` \* percentage - when percentage is applied as discount \* fixed_amount - when amount is applied as discount
299
+
300
+ */
301
+
162
302
  discount_type?:'fixed_amount' | 'percentage';
163
303
 
304
+ /**
305
+ * @description When the deduction is due to a `coupon` or a [discount](discounts), then this is the `id` of the coupon or discount.
306
+
307
+ */
308
+
164
309
  entity_id?:string;
165
310
 
311
+ /**
312
+ * @description The [coupon code](/docs/api/coupon_codes#coupon_code_code), if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons#coupon_id) is available in `entity_id`.
313
+
314
+ */
315
+
166
316
  coupon_set_code?:string;
167
317
  }
168
318
  export interface LineItemDiscount {
319
+ /**
320
+ * @description The unique id of the line item that this deduction is for.
321
+
322
+ */
323
+
169
324
  line_item_id?:string;
170
325
 
326
+ /**
327
+ * @description The type of deduction and the amount to which it is applied. \* item_level_coupon - The deduction is due to a coupon applied to a line item of the invoice. The coupon `id` is available as `entity_id`. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver=2#invoice_adjustment_credit_notes). \* document_level_coupon - The deduction is due to a coupon applied to the invoice `sub_total`. The coupon `id` is available as `entity_id`. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to a line item of the invoice. The discount `id` is available as the `entity_id`. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice. The `entity_id` is `null` in this case.
328
+
329
+ */
330
+
171
331
  discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
172
332
 
173
333
  coupon_id?:string;
174
334
 
335
+ /**
336
+ * @description When the deduction is due to a `coupon` or a [discount](discounts), then this is the `id` of the coupon or discount.
337
+
338
+ */
339
+
175
340
  entity_id?:string;
176
341
 
342
+ /**
343
+ * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api#currencies).
344
+
345
+ */
346
+
177
347
  discount_amount?:number;
178
348
  }
179
349
  export interface Tax {
350
+ /**
351
+ * @description The name of the tax applied. E.g. GST.
352
+
353
+ */
354
+
180
355
  name?:string;
181
356
 
357
+ /**
358
+ * @description The tax amount.
359
+
360
+ */
361
+
182
362
  amount?:number;
183
363
 
364
+ /**
365
+ * @description Description of the tax item.
366
+
367
+ */
368
+
184
369
  description?:string;
185
370
  }
186
371
  export interface LineItemTax {
372
+ /**
373
+ * @description The unique reference id of the line item for which the tax is applicable
374
+
375
+ */
376
+
187
377
  line_item_id?:string;
188
378
 
379
+ /**
380
+ * @description The name of the tax applied
381
+
382
+ */
383
+
189
384
  tax_name?:string;
190
385
 
386
+ /**
387
+ * @description The rate of tax used to calculate tax amount
388
+
389
+ */
390
+
191
391
  tax_rate?:number;
192
392
 
393
+ /**
394
+ * @description Indicates if tax is applied only on a portion of the line item amount.
395
+
396
+ */
397
+
193
398
  is_partial_tax_applied?:boolean;
194
399
 
400
+ /**
401
+ * @description Indicates the non-compliance tax that should not be reported to the jurisdiction.
402
+
403
+ */
404
+
195
405
  is_non_compliance_tax?:boolean;
196
406
 
407
+ /**
408
+ * @description Indicates the actual portion of the line item amount that is taxable.
409
+
410
+ */
411
+
197
412
  taxable_amount?:number;
198
413
 
414
+ /**
415
+ * @description The tax amount
416
+
417
+ */
418
+
199
419
  tax_amount?:number;
200
420
 
421
+ /**
422
+ * @description The type of tax jurisdiction \* unincorporated - Combined tax of state and county. \* federal - The tax jurisdiction is a federal \* state - The tax jurisdiction is a state \* county - The tax jurisdiction is a county \* country - The tax jurisdiction is a country \* city - The tax jurisdiction is a city \* other - Jurisdictions other than the ones listed above. \* special - Special tax jurisdiction.
423
+
424
+ */
425
+
201
426
  tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
202
427
 
428
+ /**
429
+ * @description The name of the tax jurisdiction
430
+
431
+ */
432
+
203
433
  tax_juris_name?:string;
204
434
 
435
+ /**
436
+ * @description The tax jurisdiction code
437
+
438
+ */
439
+
205
440
  tax_juris_code?:string;
206
441
 
442
+ /**
443
+ * @description Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
444
+
445
+ */
446
+
207
447
  tax_amount_in_local_currency?:number;
208
448
 
449
+ /**
450
+ * @description The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API.
451
+
452
+ */
453
+
209
454
  local_currency_code?:string;
210
455
  }
211
456
  }
@@ -41,74 +41,244 @@ declare module 'chargebee' {
41
41
 
42
42
 
43
43
  export interface Charge {
44
+ /**
45
+ * @description The amount to be charged. The unit depends on the [type of currency](/docs/api?prod_cat_ver=1#md_disabled).
46
+
47
+ */
48
+
44
49
  amount?:number;
45
50
 
51
+ /**
52
+ * @description The decimal representation of the amount for the one-time charge. The value is in [major units of the currency](/docs/api#md_enabled). Applicable only when multi-decimal pricing is enabled.
53
+
54
+ */
55
+
46
56
  amount_in_decimal?:string;
47
57
 
58
+ /**
59
+ * @description Description for this charge
60
+
61
+ */
62
+
48
63
  description?:string;
49
64
 
65
+ /**
66
+ * @description Specifies the service period of the charge in days. When the quote is converted, the [invoice.line_item.date_from](/docs/api/invoices#invoice_line_items) is set to current date/time and `invoice.line_item.date_to` is set to `service_period_in_days` ahead of `date_from`.
67
+
68
+ */
69
+
50
70
  service_period_in_days?:number;
51
71
 
72
+ /**
73
+ * @description Indicates the type of sale carried out. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. \* wholesale - Transaction is a sale to another company that will resell your product or service to another consumer \* retail - Transaction is a sale to an end user \* consumed - Transaction is for an item that is consumed directly \* vendor_use - Transaction is for an item that is subject to vendor use tax
74
+
75
+ */
76
+
52
77
  avalara_sale_type?:'consumed' | 'wholesale' | 'vendor_use' | 'retail';
53
78
 
79
+ /**
80
+ * @description Indicates the type of product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
81
+
82
+ */
83
+
54
84
  avalara_transaction_type?:number;
55
85
 
86
+ /**
87
+ * @description Indicates the type of service for the product to be taxed. Values for this field can be taken from Avalara. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
88
+
89
+ */
90
+
56
91
  avalara_service_type?:number;
57
92
  }
58
93
  export interface ItemPrice {
94
+ /**
95
+ * @description A unique ID for your system to identify the item price.
96
+
97
+ */
98
+
59
99
  item_price_id?:string;
60
100
 
101
+ /**
102
+ * @description Item price quantity
103
+
104
+ */
105
+
61
106
  quantity?:number;
62
107
 
108
+ /**
109
+ * @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.
110
+
111
+ */
112
+
63
113
  quantity_in_decimal?:string;
64
114
 
115
+ /**
116
+ * @description The price or per-unit-price of the item price. By default, it is the [value set](/docs/api/item_prices#item_price_price) for the `item_price`. This is only applicable when the `pricing_model` of the `item_price` is `flat_fee` or `per_unit`. The value depends on the [type of currency](/docs/api/#handling_currency_units).
117
+
118
+ */
119
+
65
120
  unit_price?:number;
66
121
 
122
+ /**
123
+ * @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.
124
+
125
+ */
126
+
67
127
  unit_price_in_decimal?:string;
68
128
 
129
+ /**
130
+ * @description Defines service period of the item in days from the day of charge.
131
+
132
+ */
133
+
69
134
  service_period_days?:number;
70
135
  }
71
136
  export interface ItemTier {
137
+ /**
138
+ * @description The id of the item price to which this tier belongs.
139
+
140
+ */
141
+
72
142
  item_price_id?:string;
73
143
 
144
+ /**
145
+ * @description The lowest value in the quantity tier.
146
+
147
+ */
148
+
74
149
  starting_unit?:number;
75
150
 
151
+ /**
152
+ * @description The highest value in the quantity tier.
153
+
154
+ */
155
+
76
156
  ending_unit?:number;
77
157
 
158
+ /**
159
+ * @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.
160
+
161
+ */
162
+
78
163
  price?:number;
79
164
 
165
+ /**
166
+ * @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.
167
+
168
+ */
169
+
80
170
  starting_unit_in_decimal?:string;
81
171
 
172
+ /**
173
+ * @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.
174
+
175
+ */
176
+
82
177
  ending_unit_in_decimal?:string;
83
178
 
179
+ /**
180
+ * @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.
181
+
182
+ */
183
+
84
184
  price_in_decimal?:string;
85
185
 
186
+ /**
187
+ * @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.
188
+
189
+ */
190
+
86
191
  index?:number;
87
192
  }
88
193
  export interface Coupon {
194
+ /**
195
+ * @description Used to uniquely identify the coupon
196
+
197
+ */
198
+
89
199
  coupon_id?:string;
90
200
  }
91
201
  export interface Discount {
202
+ /**
203
+ * @description An immutable unique id for the discount. It is always auto-generated.
204
+
205
+ */
206
+
92
207
  id?:string;
93
208
 
209
+ /**
210
+ * @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`.
211
+
212
+ */
213
+
94
214
  invoice_name?:string;
95
215
 
216
+ /**
217
+ * @description The type of discount. Possible value are: \* percentage - The specified percentage will be given as discount. \* fixed_amount - The specified amount will be given as discount.
218
+
219
+ */
220
+
96
221
  type?:'fixed_amount' | 'percentage';
97
222
 
223
+ /**
224
+ * @description The percentage of the original amount that should be deducted from it. Only applicable when `discount.type` is percentage.
225
+
226
+ */
227
+
98
228
  percentage?:number;
99
229
 
230
+ /**
231
+ * @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`.
232
+
233
+ */
234
+
100
235
  amount?:number;
101
236
 
237
+ /**
238
+ * @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`.
239
+
240
+ */
241
+
102
242
  currency_code?:string;
103
243
 
244
+ /**
245
+ * @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`.
246
+
247
+ */
248
+
104
249
  apply_on?:'specific_item_price' | 'invoice_amount';
105
250
 
251
+ /**
252
+ * @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`.
253
+
254
+ */
255
+
106
256
  item_price_id?:string;
107
257
 
258
+ /**
259
+ * @description Timestamp indicating when this discount is created.
260
+
261
+ */
262
+
108
263
  created_at?:number;
109
264
 
265
+ /**
266
+ * @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
267
+ **Note:**
268
+
269
+
270
+ When the coupon ID contains a special character; for example: `#`, the API returns an error.
271
+ Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
272
+
273
+ */
274
+
110
275
  coupon_id?:string;
111
276
 
277
+ /**
278
+ * @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.
279
+
280
+ */
281
+
112
282
  index?:number;
113
283
  }
114
284
  }