chargebee 2.26.0 → 2.27.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 (65) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/chargebee.js +1 -1
  3. package/lib/resources/api_endpoints.js +8 -1
  4. package/package.json +1 -1
  5. package/types/core.d.ts +1 -0
  6. package/types/resources/Address.d.ts +235 -5
  7. package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
  8. package/types/resources/AttachedItem.d.ts +285 -13
  9. package/types/resources/Card.d.ts +375 -13
  10. package/types/resources/Comment.d.ts +160 -11
  11. package/types/resources/Contact.d.ts +54 -0
  12. package/types/resources/ContractTerm.d.ts +83 -0
  13. package/types/resources/Coupon.d.ts +628 -20
  14. package/types/resources/CouponCode.d.ts +46 -5
  15. package/types/resources/CouponSet.d.ts +194 -17
  16. package/types/resources/CreditNote.d.ts +1100 -44
  17. package/types/resources/CreditNoteEstimate.d.ts +75 -6
  18. package/types/resources/Customer.d.ts +1819 -73
  19. package/types/resources/DifferentialPrice.d.ts +246 -15
  20. package/types/resources/Discount.d.ts +107 -0
  21. package/types/resources/Download.d.ts +18 -0
  22. package/types/resources/EntitlementOverride.d.ts +101 -7
  23. package/types/resources/Estimate.d.ts +1021 -27
  24. package/types/resources/Event.d.ts +138 -8
  25. package/types/resources/Export.d.ts +622 -32
  26. package/types/resources/Feature.d.ts +287 -22
  27. package/types/resources/Gift.d.ts +296 -24
  28. package/types/resources/Hierarchy.d.ts +30 -0
  29. package/types/resources/HostedPage.d.ts +1046 -37
  30. package/types/resources/ImpactedItem.d.ts +41 -1
  31. package/types/resources/ImpactedSubscription.d.ts +36 -1
  32. package/types/resources/InAppSubscription.d.ts +369 -9
  33. package/types/resources/Invoice.d.ts +1942 -92
  34. package/types/resources/InvoiceEstimate.d.ts +75 -6
  35. package/types/resources/Item.d.ts +522 -16
  36. package/types/resources/ItemEntitlement.d.ts +162 -13
  37. package/types/resources/ItemFamily.d.ts +153 -15
  38. package/types/resources/ItemPrice.d.ts +951 -26
  39. package/types/resources/Media.d.ts +24 -0
  40. package/types/resources/NonSubscription.d.ts +46 -3
  41. package/types/resources/Order.d.ts +1172 -32
  42. package/types/resources/PaymentIntent.d.ts +293 -8
  43. package/types/resources/PaymentReferenceNumber.d.ts +24 -0
  44. package/types/resources/PaymentSource.d.ts +984 -55
  45. package/types/resources/PaymentVoucher.d.ts +252 -14
  46. package/types/resources/PortalSession.d.ts +154 -10
  47. package/types/resources/PromotionalCredit.d.ts +300 -16
  48. package/types/resources/Purchase.d.ts +206 -5
  49. package/types/resources/Quote.d.ts +1430 -62
  50. package/types/resources/QuoteLineGroup.d.ts +134 -5
  51. package/types/resources/QuotedCharge.d.ts +63 -5
  52. package/types/resources/QuotedSubscription.d.ts +192 -5
  53. package/types/resources/ResourceMigration.d.ts +68 -3
  54. package/types/resources/SiteMigrationDetail.d.ts +98 -5
  55. package/types/resources/Subscription.d.ts +2564 -137
  56. package/types/resources/SubscriptionEntitlement.d.ts +116 -8
  57. package/types/resources/SubscriptionEstimate.d.ts +36 -2
  58. package/types/resources/TaxWithheld.d.ts +32 -0
  59. package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
  60. package/types/resources/TimeMachine.d.ts +82 -7
  61. package/types/resources/Token.d.ts +164 -7
  62. package/types/resources/Transaction.d.ts +567 -25
  63. package/types/resources/UnbilledCharge.d.ts +309 -14
  64. package/types/resources/Usage.d.ts +237 -13
  65. package/types/resources/VirtualBankAccount.d.ts +220 -17
@@ -1,146 +1,754 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface Coupon {
4
+
5
+ /**
6
+ * @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
7
+ **Note:**
8
+
9
+
10
+ When the coupon ID contains a special character; for example: &#x60;#&#x60;, the API returns an error.
11
+ Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
12
+
13
+ */
14
+
4
15
  id:string;
16
+
17
+ /**
18
+ * @description The display name used in web interface for identifying the coupon.
19
+ **Note:**
20
+
21
+
22
+ When the name of the coupon set contains a special character; for example: &#x60;#&#x60;, the API returns an error.
23
+ Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
24
+
25
+ */
26
+
5
27
  name:string;
28
+
29
+ /**
30
+ * @description Display name used in invoice. If it is not configured then name is used in invoice.
31
+
32
+ */
33
+
6
34
  invoice_name?:string;
35
+
36
+ /**
37
+ * @description The type of deduction \* percentage - The specified percentage will be deducted. \* fixed_amount - The specified amount will be deducted.
38
+
39
+ */
40
+
7
41
  discount_type:'fixed_amount' | 'percentage';
42
+
43
+ /**
44
+ * @description The percentage of the original amount that should be deducted from it.
45
+
46
+ */
47
+
8
48
  discount_percentage?:number;
49
+
50
+ /**
51
+ * @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
52
+
53
+ */
54
+
9
55
  discount_amount?:number;
56
+
57
+ /**
58
+ * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
59
+
60
+ */
61
+
10
62
  currency_code?:string;
63
+
64
+ /**
65
+ * @description Specifies the time duration for which this coupon is attached to the subscription. \* forever - The coupon is attached to the subscription and applied on the invoices until explicitly removed. \* one_time - The coupon 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 &#x60;period&#x60; and &#x60;period_unit&#x60;.
66
+
67
+ */
68
+
11
69
  duration_type:'limited_period' | 'one_time' | 'forever';
70
+
71
+ /**
72
+ * @description Date upto which the coupon can be applied to new subscriptions.
73
+
74
+ */
75
+
12
76
  valid_till?:number;
77
+
78
+ /**
79
+ * @description Maximum number of times this coupon can be redeemed.
80
+ **Note:**
81
+
82
+
83
+ If not specified, the coupon can be redeemed an indefinite number of times.
84
+
85
+ */
86
+
13
87
  max_redemptions?:number;
88
+
89
+ /**
90
+ * @description Status of the coupon. \* expired - Cannot be applied to a subscription. A coupon may expire due to exceeding [max_redemptions](/docs/api/coupons?#coupon_max_redemptions) or [valid_till](/docs/api/coupons?#coupon_valid_till) date is past. Existing associations remain unaffected. \* archived - Cannot be applied to a subscription. Existing associations remain unaffected. \* active - Can be applied to a subscription. \* deleted - Indicates the coupon has been deleted.
91
+
92
+ */
93
+
14
94
  status?:'archived' | 'expired' | 'deleted' | 'active';
95
+
96
+ /**
97
+ * @description The amount on the invoice to which the coupon is applied. \* invoice_amount - The coupon is applied to the invoice &#x60;sub_total&#x60;. \* each_specified_item - The coupon is applied to the &#x60;invoice.line_item.amount&#x60; that corresponds to the item price specified by &#x60;item_price_id&#x60;.
98
+
99
+ */
100
+
15
101
  apply_on:'invoice_amount' | 'each_specified_item';
102
+
103
+ /**
104
+ * @description Timestamp indicating when this coupon is created.
105
+
106
+ */
107
+
16
108
  created_at:number;
109
+
110
+ /**
111
+ * @description Timestamp indicating when this coupon was archived.
112
+
113
+ */
114
+
17
115
  archived_at?:number;
116
+
117
+ /**
118
+ * @description The version number of this resource. For every change made to the resource, &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds.
119
+
120
+ */
121
+
18
122
  resource_version?:number;
123
+
124
+ /**
125
+ * @description Timestamp indicating when this coupon was last updated.
126
+ Note that this does not change when the [redemptions](/docs/api/coupons?#coupon_redemptions) attribute is changed. This attribute will be present only if the resource has been updated after 2016-11-09.
127
+
128
+ */
129
+
19
130
  updated_at?:number;
131
+
132
+ /**
133
+ * @description The duration of time for which the coupon is attached to the subscription, in &#x60;period_units&#x60;. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type).
134
+
135
+ */
136
+
20
137
  period?:number;
138
+
139
+ /**
140
+ * @description The unit of time for period. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type). \* month - A period of 1 calendar month. \* week - A period of 7 days. \* year - A period of 1 calendar year. \* day - A period of 24 hours.
141
+
142
+ */
143
+
21
144
  period_unit?:PeriodUnit;
145
+
146
+ /**
147
+ * @description The number of times this coupon has been redeemed.
148
+
149
+ */
150
+
22
151
  redemptions?:number;
152
+
153
+ /**
154
+ * @description A customer-facing note added to all invoices associated with this API resource. This note becomes one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
155
+
156
+ */
157
+
23
158
  invoice_notes?:string;
159
+
160
+ /**
161
+ * @description The list of item constraints.
162
+
163
+ */
164
+
24
165
  item_constraints?:Coupon.ItemConstraint[];
166
+
167
+ /**
168
+ * @description The list of item constraint criteria.
169
+
170
+ */
171
+
25
172
  item_constraint_criteria?:Coupon.ItemConstraintCriteria[];
173
+
174
+ /**
175
+ * @description List of constraints applicable on the redemption of this coupon.
176
+
177
+ */
178
+
26
179
  coupon_constraints?:Coupon.CouponConstraint[];
27
180
  }
28
181
  export namespace Coupon {
29
- export class CouponResource {
182
+ export class CouponResource {
183
+ /**
184
+ * @description List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
185
+
186
+ */
187
+
30
188
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
189
+
190
+ /**
191
+ * @description This API updates a coupon that is created for a specific promotion or offers.
192
+
193
+ */
194
+
31
195
  update_for_items(coupon_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
196
+
197
+ /**
198
+ * @description This API unarchives a specific coupon using the coupon ID.
199
+
200
+ */
201
+
32
202
  unarchive(coupon_id:string):ChargebeeRequest<UnarchiveResponse>;
203
+
204
+ /**
205
+ * @description If no Subscriptions/Invoices are linked to this Coupon, the Coupon will be deleted from your Chargebee site. This action cannot be undone.
206
+
207
+ To ensure that existing Subscriptions/Invoices are not affected, Coupons associated with them will not be deleted, but moved to &quot;Archived&quot; state. Once a Coupon has been archived, it cannot be edited or used again unless [unarchived](coupons#unarchive_a_coupon). Unused Coupons codes are deleted.
208
+
209
+ */
210
+
33
211
  delete(coupon_id:string):ChargebeeRequest<DeleteResponse>;
212
+
213
+ /**
214
+ * @description Copies a coupon over from one site to another. Copying of [archived](./coupons?prod_cat_ver&#x3D;2#coupon_status) coupons is not supported.
215
+
216
+ The item prices that are linked to the coupon in the source site are also linked to the coupon in the destination site. However, this will only work if those item prices exist and with the same [ids](./item_prices?prod_cat_ver&#x3D;2#item_price_id), in the destination site. Hence, it is recommended that the item prices be copied over before copying the coupons.
217
+
218
+ The value for [redemptions](./coupons?prod_cat_ver&#x3D;2#coupon_redemptions) is not copied. It is set to &#x60;0&#x60; for the newly created coupon. Hence, if such a coupon had &#x60;expired&#x60; in the source site due to &#x60;redemptions&#x60; having reached [max_redemptions](./coupons?prod_cat_ver&#x3D;2#coupon_max_redemptions), it&#x27;s [status](./coupons?prod_cat_ver&#x3D;2#coupon_status) would be &#x60;active&#x60; in the destination site.
219
+
220
+
221
+ */
222
+
34
223
  copy(input:CopyInputParam):ChargebeeRequest<CopyResponse>;
224
+
225
+ /**
226
+ * @description This API retrieves a specific coupon using the coupon ID.
227
+
228
+ */
229
+
35
230
  retrieve(coupon_id:string):ChargebeeRequest<RetrieveResponse>;
231
+
232
+ /**
233
+ * @description This API creates a new coupon for a specific promotion or offers.
234
+
235
+ */
236
+
36
237
  create_for_items(input:CreateForItemsInputParam):ChargebeeRequest<CreateForItemsResponse>;
37
238
  }
38
- export interface ListResponse {
39
- list:{coupon:Coupon}[];
40
- next_offset?:string;
239
+ export interface ListResponse {
240
+ /**
241
+ * @description List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
242
+
243
+ */
244
+
245
+ list:{coupon:Coupon}[];
246
+
247
+ /**
248
+ * @description List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
249
+
250
+ */
251
+
252
+ next_offset?:string;
41
253
  }
42
254
  export interface ListInputParam {
43
- [key : string]: any;
255
+ [key : string]: any;
256
+ /**
257
+ * @description The number of resources to be returned.
258
+
259
+ */
260
+
44
261
  limit?:number;
262
+
263
+ /**
264
+ * @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.
265
+
266
+ */
267
+
45
268
  offset?:string;
269
+
270
+ /**
271
+ * @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
272
+ **Note:**
273
+
274
+
275
+ When the coupon ID contains a special character; for example: &#x60;#&#x60;, the API returns an error.
276
+ Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
277
+
278
+ */
279
+
46
280
  id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
281
+
282
+ /**
283
+ * @description The display name used in web interface for identifying the coupon.
284
+ **Note:**
285
+
286
+
287
+ When the name of the coupon set contains a special character; for example: &#x60;#&#x60;, the API returns an error.
288
+ Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
289
+
290
+ */
291
+
47
292
  name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
293
+
294
+ /**
295
+ * @description The type of deduction
296
+
297
+ */
298
+
48
299
  discount_type?:{in?:string,is?:'fixed_amount' | 'percentage',is_not?:'fixed_amount' | 'percentage',not_in?:string};
300
+
301
+ /**
302
+ * @description Specifies the time duration for which this coupon is attached to the subscription.
303
+
304
+ */
305
+
49
306
  duration_type?:{in?:string,is?:'limited_period' | 'one_time' | 'forever',is_not?:'limited_period' | 'one_time' | 'forever',not_in?:string};
307
+
308
+ /**
309
+ * @description Status of the coupon.
310
+
311
+ */
312
+
50
313
  status?:{in?:string,is?:'archived' | 'expired' | 'deleted' | 'active',is_not?:'archived' | 'expired' | 'deleted' | 'active',not_in?:string};
314
+
315
+ /**
316
+ * @description The amount on the invoice to which the coupon is applied.
317
+
318
+ */
319
+
51
320
  apply_on?:{in?:string,is?:'invoice_amount' | 'each_specified_item',is_not?:'invoice_amount' | 'each_specified_item',not_in?:string};
321
+
322
+ /**
323
+ * @description Timestamp indicating when this coupon is created.
324
+
325
+ */
326
+
52
327
  created_at?:{after?:string,before?:string,between?:string,on?:string};
328
+
329
+ /**
330
+ * @description To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-11-09.
331
+
332
+ */
333
+
53
334
  updated_at?:{after?:string,before?:string,between?:string,on?:string};
335
+
336
+ /**
337
+ * @description List all the available coupons that are created for a specific promotion or offers. You can find list of coupon codes that are currently active, expired, archived or deleted.
338
+
339
+ */
340
+
54
341
  sort_by?:{asc?:'created_at',desc?:'created_at'};
342
+
343
+ /**
344
+ * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
345
+
346
+ */
347
+
55
348
  currency_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
349
+
350
+ /**
351
+ * @description Parameters for addon
352
+
353
+ */
354
+
56
355
  addon?:{};
356
+
357
+ /**
358
+ * @description Parameters for plan
359
+
360
+ */
361
+
57
362
  plan?:{};
58
363
  }
59
- export interface UpdateForItemsResponse {
60
- coupon:Coupon;
364
+ export interface UpdateForItemsResponse {
365
+ coupon:Coupon;
61
366
  }
62
367
  export interface UpdateForItemsInputParam {
368
+
369
+ /**
370
+ * @description The display name used in web interface for identifying the coupon.
371
+ **Note:**
372
+
373
+
374
+ When the name of the coupon set contains a special character; for example: &#x60;#&#x60;, the API returns an error.
375
+ Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
376
+ .
377
+
378
+ */
379
+
63
380
  name?:string;
381
+
382
+ /**
383
+ * @description Display name used in invoice. If it is not configured then name is used in invoice.
384
+
385
+ */
386
+
64
387
  invoice_name?:string;
388
+
389
+ /**
390
+ * @description The type of deduction. \* percentage - The specified percentage will be deducted. \* fixed_amount - The specified amount will be deducted. \* offer_quantity - The specified units will be offered for free.
391
+
392
+ */
393
+
65
394
  discount_type?:'fixed_amount' | 'percentage';
395
+
396
+ /**
397
+ * @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
398
+
399
+ */
400
+
66
401
  discount_amount?:number;
402
+
403
+ /**
404
+ * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/2.0/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
405
+
406
+ */
407
+
67
408
  currency_code?:string;
409
+
410
+ /**
411
+ * @description The percentage of the original amount that should be deducted from it.
412
+
413
+ */
414
+
68
415
  discount_percentage?:number;
416
+
417
+ /**
418
+ * @description The amount on the invoice to which the coupon is applied. \* invoice_amount - The coupon is applied to the invoice &#x60;sub_total&#x60;. \* each_unit_of_specified_items - Discount will be applied to each unit of plan and addon items specified. \* each_specified_item - The coupon is applied to the &#x60;invoice.line_item.amount&#x60; that corresponds to the item price specified by &#x60;item_price_id&#x60;. \* specified_items_total - Discount will be applied to the total of plan and addon items specified.
419
+
420
+ */
421
+
69
422
  apply_on?:'invoice_amount' | 'each_specified_item';
423
+
424
+ /**
425
+ * @description Specifies the time duration for which this coupon is attached to the subscription. \* forever - The coupon is attached to the subscription and applied on the invoices until explicitly removed. \* one_time - The coupon 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 &#x60;period&#x60; and &#x60;period_unit&#x60;.
426
+
427
+ */
428
+
70
429
  duration_type?:'limited_period' | 'one_time' | 'forever';
430
+
431
+ /**
432
+ * @description **(Deprecated)** The duration of time in months for which the coupon is attached to the subscription. Applicable only when &#x60;duration_type&#x60; is &#x60;limited_period&#x60;.
433
+ **Note:** This parameter has been deprecated. Use &#x60;period&#x60; and &#x60;period_unit&#x60; instead.
434
+
435
+ */
436
+
71
437
  duration_month?:number;
438
+
439
+ /**
440
+ * @description Date upto which the coupon can be applied to new subscriptions.
441
+
442
+ */
443
+
72
444
  valid_till?:number;
445
+
446
+ /**
447
+ * @description Maximum number of times this coupon can be redeemed.
448
+ **Note:**
449
+
450
+
451
+ If not specified, the coupon can be redeemed an indefinite number of times.
452
+ .
453
+
454
+ */
455
+
73
456
  max_redemptions?:number;
457
+
458
+ /**
459
+ * @description A customer-facing note added to all invoices associated with this API resource. This note becomes one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
460
+
461
+ */
462
+
74
463
  invoice_notes?:string;
464
+
465
+ /**
466
+ * @description A set of key-value pairs stored as additional information for the coupon. [Learn more](./#meta_data).
467
+
468
+ */
469
+
75
470
  meta_data?:object;
471
+
472
+ /**
473
+ * @description The coupon is included in MRR calculations for your site. This attribute is only applicable for coupons of &#x60;duration_type &#x3D; one_time&#x60; and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude one-time coupons from MRR calculations, this value is always returned &#x60;false&#x60;.
474
+
475
+ */
476
+
76
477
  included_in_mrr?:boolean;
478
+
479
+ /**
480
+ * @description The duration of time for which the coupon is attached to the subscription, in &#x60;period_units&#x60;. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type).
481
+
482
+ */
483
+
77
484
  period?:number;
485
+
486
+ /**
487
+ * @description The unit of time for period. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type). \* month - A period of 1 calendar month. \* week - A period of 7 days. \* year - A period of 1 calendar year. \* day - A period of 24 hours.
488
+
489
+ */
490
+
78
491
  period_unit?:PeriodUnit;
492
+
493
+ /**
494
+ * @description Parameters for item_constraints
495
+
496
+ */
497
+
79
498
  item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
499
+
500
+ /**
501
+ * @description Parameters for item_constraint_criteria
502
+
503
+ */
504
+
80
505
  item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
506
+
507
+ /**
508
+ * @description Parameters for &#x60;coupon_constraints&#x60;. Multiple &#x60;coupon_constraints&#x60; can be passed by specifying unique indices.
509
+
510
+ */
511
+
81
512
  coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
82
513
  }
83
- export interface UnarchiveResponse {
84
- coupon:Coupon;
514
+ export interface UnarchiveResponse {
515
+ coupon:Coupon;
85
516
  }
86
517
 
87
- export interface DeleteResponse {
88
- coupon:Coupon;
518
+ export interface DeleteResponse {
519
+ coupon:Coupon;
89
520
  }
90
521
 
91
- export interface CopyResponse {
92
- coupon:Coupon;
522
+ export interface CopyResponse {
523
+ coupon:Coupon;
93
524
  }
94
525
  export interface CopyInputParam {
526
+
527
+ /**
528
+ * @description Your Chargebee site name having the coupon to be copied.
529
+ **Note:** Unless you are copying from a twin site (acme \&amp; acme-test are twin sites), [contact support](https://chargebee.freshdesk.com/support/home) to have this allow-listed.
530
+
531
+ */
532
+
95
533
  from_site:string;
534
+
535
+ /**
536
+ * @description Id of the coupon to be copied. The new coupon created in this site will have the same Id.
537
+
538
+ */
539
+
96
540
  id_at_from_site:string;
541
+
542
+ /**
543
+ * @description Id of copied coupon in this site.
544
+
545
+ */
546
+
97
547
  id?:string;
548
+
549
+ /**
550
+ * @description If copy action is performed as part of Chargebee site merge action, pass the value as true.
551
+ **Note:** If this parameter is passed true coupon state, redemptions, coupon set and coupon codes associated with this coupon will be copied.
552
+
553
+ */
554
+
98
555
  for_site_merging?:boolean;
99
556
  }
100
- export interface RetrieveResponse {
101
- coupon:Coupon;
557
+ export interface RetrieveResponse {
558
+ coupon:Coupon;
102
559
  }
103
560
 
104
- export interface CreateForItemsResponse {
105
- coupon:Coupon;
561
+ export interface CreateForItemsResponse {
562
+ coupon:Coupon;
106
563
  }
107
564
  export interface CreateForItemsInputParam {
565
+
566
+ /**
567
+ * @description Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
568
+ **Note:**
569
+
570
+
571
+ When the coupon ID contains a special character; for example: &#x60;#&#x60;, the API returns an error.
572
+ Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
573
+ .
574
+
575
+ */
576
+
108
577
  id:string;
578
+
579
+ /**
580
+ * @description The display name used in web interface for identifying the coupon.
581
+ **Note:**
582
+
583
+
584
+ When the name of the coupon set contains a special character; for example: &#x60;#&#x60;, the API returns an error.
585
+ Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
586
+ .
587
+
588
+ */
589
+
109
590
  name:string;
591
+
592
+ /**
593
+ * @description Display name used in invoice. If it is not configured then name is used in invoice.
594
+
595
+ */
596
+
110
597
  invoice_name?:string;
598
+
599
+ /**
600
+ * @description The type of deduction. \* percentage - The specified percentage will be deducted. \* fixed_amount - The specified amount will be deducted. \* offer_quantity - The specified units will be offered for free.
601
+
602
+ */
603
+
111
604
  discount_type:'fixed_amount' | 'percentage';
605
+
606
+ /**
607
+ * @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
608
+
609
+ */
610
+
112
611
  discount_amount?:number;
612
+
613
+ /**
614
+ * @description The currency code ([ISO 4217 format](https://www.chargebee.com/docs/2.0/supported-currencies.html)) of the coupon. Applicable for *fixed_amount* coupons alone.
615
+
616
+ */
617
+
113
618
  currency_code?:string;
619
+
620
+ /**
621
+ * @description The percentage of the original amount that should be deducted from it.
622
+
623
+ */
624
+
114
625
  discount_percentage?:number;
626
+
627
+ /**
628
+ * @description The amount on the invoice to which the coupon is applied. \* invoice_amount - The coupon is applied to the invoice &#x60;sub_total&#x60;. \* each_unit_of_specified_items - Discount will be applied to each unit of plan and addon items specified. \* each_specified_item - The coupon is applied to the &#x60;invoice.line_item.amount&#x60; that corresponds to the item price specified by &#x60;item_price_id&#x60;. \* specified_items_total - Discount will be applied to the total of plan and addon items specified.
629
+
630
+ */
631
+
115
632
  apply_on:'invoice_amount' | 'each_specified_item';
633
+
634
+ /**
635
+ * @description Specifies the time duration for which this coupon is attached to the subscription. \* forever - The coupon is attached to the subscription and applied on the invoices until explicitly removed. \* one_time - The coupon 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 &#x60;period&#x60; and &#x60;period_unit&#x60;.
636
+
637
+ */
638
+
116
639
  duration_type:'limited_period' | 'one_time' | 'forever';
640
+
641
+ /**
642
+ * @description **(Deprecated)** The duration of time in months for which the coupon is attached to the subscription. Applicable only when &#x60;duration_type&#x60; is &#x60;limited_period&#x60;.
643
+ **Note:** This parameter has been deprecated. Use &#x60;period&#x60; and &#x60;period_unit&#x60; instead.
644
+
645
+ */
646
+
117
647
  duration_month?:number;
648
+
649
+ /**
650
+ * @description Date upto which the coupon can be applied to new subscriptions.
651
+
652
+ */
653
+
118
654
  valid_till?:number;
655
+
656
+ /**
657
+ * @description Maximum number of times this coupon can be redeemed.
658
+ **Note:**
659
+
660
+
661
+ If not specified, the coupon can be redeemed an indefinite number of times.
662
+ .
663
+
664
+ */
665
+
119
666
  max_redemptions?:number;
667
+
668
+ /**
669
+ * @description A customer-facing note added to all invoices associated with this API resource. This note becomes one among [all the notes](/docs/api/invoices#invoice_notes) displayed on the invoice PDF.
670
+
671
+ */
672
+
120
673
  invoice_notes?:string;
674
+
675
+ /**
676
+ * @description A set of key-value pairs stored as additional information for the coupon. [Learn more](./#meta_data).
677
+
678
+ */
679
+
121
680
  meta_data?:object;
681
+
682
+ /**
683
+ * @description The coupon is included in MRR calculations for your site. This attribute is only applicable for coupons of &#x60;duration_type &#x3D; one_time&#x60; and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude one-time coupons from MRR calculations, this value is always returned &#x60;false&#x60;.
684
+
685
+ */
686
+
122
687
  included_in_mrr?:boolean;
688
+
689
+ /**
690
+ * @description The duration of time for which the coupon is attached to the subscription, in &#x60;period_units&#x60;. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type).
691
+
692
+ */
693
+
123
694
  period?:number;
695
+
696
+ /**
697
+ * @description The unit of time for period. Applicable only when [duration_type](/docs/api/coupons?#coupon_duration_type) is [limited_period](/docs/api/coupons?#coupon_duration_type). \* month - A period of 1 calendar month. \* week - A period of 7 days. \* year - A period of 1 calendar year. \* day - A period of 24 hours.
698
+
699
+ */
700
+
124
701
  period_unit?:PeriodUnit;
702
+
703
+ /**
704
+ * @description Status of the coupon. \* expired - Cannot be applied to a subscription. A coupon may expire due to exceeding [max_redemptions](/docs/api/coupons?#coupon_max_redemptions) or [valid_till](/docs/api/coupons?#coupon_valid_till) date is past. Existing associations remain unaffected. \* archived - Cannot be applied to a subscription. Existing associations remain unaffected. \* active - Can be applied to a subscription. \* deleted - Indicates the coupon has been deleted.
705
+
706
+ */
707
+
125
708
  status?:'archived' | 'active';
709
+
710
+ /**
711
+ * @description Parameters for item_constraints
712
+
713
+ */
714
+
126
715
  item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
716
+
717
+ /**
718
+ * @description Parameters for item_constraint_criteria
719
+
720
+ */
721
+
127
722
  item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
723
+
724
+ /**
725
+ * @description Parameters for &#x60;coupon_constraints&#x60;. Multiple &#x60;coupon_constraints&#x60; can be passed by specifying unique indices.
726
+
727
+ */
728
+
128
729
  coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
129
730
  }
130
- export interface ItemConstraint {
731
+ export interface ItemConstraint {
131
732
  item_type?:'charge' | 'addon' | 'plan';
733
+
132
734
  constraint?:'all' | 'criteria' | 'none' | 'specific';
735
+
133
736
  item_price_ids?:any[];
134
737
  }
135
- export interface ItemConstraintCriteria {
738
+ export interface ItemConstraintCriteria {
136
739
  item_type?:'charge' | 'addon' | 'plan';
740
+
137
741
  currencies?:any[];
742
+
138
743
  item_family_ids?:any[];
744
+
139
745
  item_price_periods?:any[];
140
746
  }
141
- export interface CouponConstraint {
747
+ export interface CouponConstraint {
142
748
  entity_type?:'customer';
749
+
143
750
  type?:'max_redemptions' | 'unique_by';
751
+
144
752
  value?:string;
145
753
  }
146
754
  }