chargebee 2.40.0 → 3.0.0-beta.1

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 (118) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/LICENSE +1 -1
  3. package/README.md +90 -172
  4. package/cjs/RequestWrapper.js +81 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +77 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +91 -54
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +36 -0
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +233 -724
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4335
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +278 -900
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2912
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,790 +1,314 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
2
4
  declare module 'chargebee' {
3
5
  export interface Coupon {
4
- [key : string] : any;
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
101
- apply_on:'invoice_amount' | 'each_specified_item';
102
-
103
- /**
104
- * @description Timestamp indicating when this coupon is created.
105
-
106
- */
107
-
108
- created_at:number;
109
-
110
- /**
111
- * @description Timestamp indicating when this coupon was archived.
112
-
113
- */
114
-
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
-
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
-
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
-
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
-
144
- period_unit?:PeriodUnit;
145
-
146
- /**
147
- * @description The number of times this coupon has been redeemed.
148
-
149
- */
150
-
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
-
158
- invoice_notes?:string;
159
-
160
- /**
161
- * @description The list of item constraints.
162
-
163
- */
164
-
165
- item_constraints?:Coupon.ItemConstraint[];
166
-
167
- /**
168
- * @description The list of item constraint criteria.
169
-
170
- */
171
-
172
- item_constraint_criteria?:Coupon.ItemConstraintCriteria[];
173
-
174
- /**
175
- * @description List of constraints applicable on the redemption of this coupon.
176
-
177
- */
178
-
179
- coupon_constraints?:Coupon.CouponConstraint[];
6
+ [key: string]: unknown;
7
+ id: string;
8
+ name: string;
9
+ invoice_name?: string;
10
+ discount_type: 'fixed_amount' | 'percentage';
11
+ discount_percentage?: number;
12
+ discount_amount?: number;
13
+ discount_quantity?: number;
14
+ currency_code?: string;
15
+ duration_type: 'one_time' | 'forever' | 'limited_period';
16
+ duration_month?: number;
17
+ valid_till?: number;
18
+ max_redemptions?: number;
19
+ status?: 'active' | 'expired' | 'archived' | 'deleted';
20
+ apply_discount_on:
21
+ | 'plans'
22
+ | 'plans_and_addons'
23
+ | 'plans_with_quantity'
24
+ | 'not_applicable';
25
+ apply_on: 'invoice_amount' | 'each_specified_item';
26
+ plan_constraint: 'none' | 'all' | 'specific' | 'not_applicable';
27
+ addon_constraint: 'none' | 'all' | 'specific' | 'not_applicable';
28
+ created_at: number;
29
+ archived_at?: number;
30
+ resource_version?: number;
31
+ updated_at?: number;
32
+ included_in_mrr?: boolean;
33
+ period?: number;
34
+ period_unit?: PeriodUnit;
35
+ plan_ids?: string[];
36
+ addon_ids?: string[];
37
+ item_constraints?: Coupon.ItemConstraint[];
38
+ item_constraint_criteria?: Coupon.ItemConstraintCriteria[];
39
+ redemptions?: number;
40
+ invoice_notes?: string;
41
+ meta_data?: any;
42
+ coupon_constraints?: Coupon.CouponConstraint[];
180
43
  }
181
- export namespace Coupon {
182
- export class CouponResource {
183
- /**
184
- * @description This API creates a new coupon for a specific promotion or offers.
185
44
 
186
- */
187
-
188
- create_for_items(input:CreateForItemsInputParam):ChargebeeRequest<CreateForItemsResponse>;
189
-
190
- /**
191
- * @description This API updates a coupon that is created for a specific promotion or offers.
45
+ export namespace Coupon {
46
+ export class CouponResource {
47
+ create(
48
+ input: CreateInputParam,
49
+ headers?: ChargebeeRequestHeader,
50
+ ): Promise<ChargebeeResponse<CreateResponse>>;
51
+
52
+ createForItems(
53
+ input: CreateForItemsInputParam,
54
+ headers?: ChargebeeRequestHeader,
55
+ ): Promise<ChargebeeResponse<CreateForItemsResponse>>;
56
+
57
+ updateForItems(
58
+ coupon_id: string,
59
+ input: UpdateForItemsInputParam,
60
+ headers?: ChargebeeRequestHeader,
61
+ ): Promise<ChargebeeResponse<UpdateForItemsResponse>>;
62
+
63
+ list(
64
+ input?: ListInputParam,
65
+ headers?: ChargebeeRequestHeader,
66
+ ): Promise<ChargebeeResponse<ListResponse>>;
67
+
68
+ retrieve(
69
+ coupon_id: string,
70
+ headers?: ChargebeeRequestHeader,
71
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
72
+
73
+ update(
74
+ coupon_id: string,
75
+ input?: UpdateInputParam,
76
+ headers?: ChargebeeRequestHeader,
77
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
78
+
79
+ delete(
80
+ coupon_id: string,
81
+ headers?: ChargebeeRequestHeader,
82
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
83
+
84
+ copy(
85
+ input: CopyInputParam,
86
+ headers?: ChargebeeRequestHeader,
87
+ ): Promise<ChargebeeResponse<CopyResponse>>;
88
+
89
+ unarchive(
90
+ coupon_id: string,
91
+ headers?: ChargebeeRequestHeader,
92
+ ): Promise<ChargebeeResponse<UnarchiveResponse>>;
93
+ }
192
94
 
193
- */
194
-
195
- update_for_items(coupon_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
196
-
197
- /**
198
- * @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.
95
+ export interface CreateResponse {
96
+ coupon: Coupon;
97
+ }
199
98
 
200
- */
201
-
202
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
203
-
204
- /**
205
- * @description This API retrieves a specific coupon using the coupon ID.
99
+ export interface CreateForItemsResponse {
100
+ coupon: Coupon;
101
+ }
206
102
 
207
- */
208
-
209
- retrieve(coupon_id:string):ChargebeeRequest<RetrieveResponse>;
210
-
211
- /**
212
- * @description If no Subscriptions/Invoices are linked to this Coupon, the Coupon will be deleted from your Chargebee site. This action cannot be undone.
103
+ export interface UpdateForItemsResponse {
104
+ coupon: Coupon;
105
+ }
213
106
 
214
- 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.
107
+ export interface ListResponse {
108
+ list: { coupon: Coupon }[];
109
+ next_offset?: string;
110
+ }
215
111
 
216
- */
217
-
218
- delete(coupon_id:string):ChargebeeRequest<DeleteResponse>;
219
-
220
- /**
221
- * @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.
112
+ export interface RetrieveResponse {
113
+ coupon: Coupon;
114
+ }
222
115
 
223
- 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.
116
+ export interface UpdateResponse {
117
+ coupon: Coupon;
118
+ }
224
119
 
225
- 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.
120
+ export interface DeleteResponse {
121
+ coupon: Coupon;
122
+ }
226
123
 
124
+ export interface CopyResponse {
125
+ coupon: Coupon;
126
+ }
227
127
 
228
- */
229
-
230
- copy(input:CopyInputParam):ChargebeeRequest<CopyResponse>;
231
-
232
- /**
233
- * @description This API unarchives a specific coupon using the coupon ID.
128
+ export interface UnarchiveResponse {
129
+ coupon: Coupon;
130
+ }
234
131
 
235
- */
236
-
237
- unarchive(coupon_id:string):ChargebeeRequest<UnarchiveResponse>;
132
+ export interface ItemConstraint {
133
+ item_type: 'plan' | 'addon' | 'charge';
134
+ constraint: 'none' | 'all' | 'specific' | 'criteria';
135
+ item_price_ids?: any[];
238
136
  }
239
- export interface CreateForItemsResponse {
240
- coupon:Coupon;
137
+ export interface ItemConstraintCriteria {
138
+ item_type: 'plan' | 'addon' | 'charge';
139
+ currencies?: any[];
140
+ item_family_ids?: any[];
141
+ item_price_periods?: any[];
241
142
  }
242
- export interface CreateForItemsInputParam {
243
- [key : string] : any;
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: &#x60;#&#x60;, 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
- */
254
-
255
- id:string;
256
-
257
- /**
258
- * @description The display name used in web interface for identifying the coupon.
259
- **Note:**
260
-
261
-
262
- When the name of the coupon set contains a special character; for example: &#x60;#&#x60;, the API returns an error.
263
- Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
264
- .
265
-
266
- */
267
-
268
- name:string;
269
-
270
- /**
271
- * @description Display name used in invoice. If it is not configured then name is used in invoice.
272
-
273
- */
274
-
275
- invoice_name?:string;
276
-
277
- /**
278
- * @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.
279
-
280
- */
281
-
282
- discount_type?:'fixed_amount' | 'percentage';
283
-
284
- /**
285
- * @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
286
-
287
- */
288
-
289
- discount_amount?:number;
290
-
291
- /**
292
- * @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.
293
-
294
- */
295
-
296
- currency_code?:string;
297
-
298
- /**
299
- * @description The percentage of the original amount that should be deducted from it.
300
-
301
- */
302
-
303
- discount_percentage?:number;
304
-
305
- /**
306
- * @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.
307
-
308
- */
309
-
310
- apply_on:'invoice_amount' | 'each_specified_item';
311
-
312
- /**
313
- * @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;.
314
-
315
- */
316
-
317
- duration_type?:'limited_period' | 'one_time' | 'forever';
318
-
319
- /**
320
- * @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;.
321
- **Note:** This parameter has been deprecated. Use &#x60;period&#x60; and &#x60;period_unit&#x60; instead.
322
-
323
- */
324
-
325
- duration_month?:number;
326
-
327
- /**
328
- * @description Date upto which the coupon can be applied to new subscriptions.
329
-
330
- */
331
-
332
- valid_till?:number;
333
-
334
- /**
335
- * @description Maximum number of times this coupon can be redeemed.
336
- **Note:**
337
-
338
-
339
- If not specified, the coupon can be redeemed an indefinite number of times.
340
- .
341
-
342
- */
343
-
344
- max_redemptions?:number;
345
-
346
- /**
347
- * @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.
348
-
349
- */
350
-
351
- invoice_notes?:string;
352
-
353
- /**
354
- * @description A collection of key-value pairs that provides extra information about the coupon.
355
- **Note:** There&#x27;s a character limit of 65,535.
356
- [Learn more](advanced-features?prod_cat_ver&#x3D;2#metadata).
357
-
358
- */
359
-
360
- meta_data?:object;
361
-
362
- /**
363
- * @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;.
364
-
365
- */
366
-
367
- included_in_mrr?:boolean;
368
-
369
- /**
370
- * @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).
371
-
372
- */
373
-
374
- period?:number;
375
-
376
- /**
377
- * @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.
378
-
379
- */
380
-
381
- period_unit?:PeriodUnit;
382
-
383
- /**
384
- * @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.
385
-
386
- */
387
-
388
- status?:'archived' | 'active';
389
-
390
- /**
391
- * @description Parameters for item_constraints
392
-
393
- */
394
-
395
- item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
396
-
397
- /**
398
- * @description Parameters for item_constraint_criteria
399
-
400
- */
401
-
402
- item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
403
-
404
- /**
405
- * @description Parameters for &#x60;coupon_constraints&#x60;. Multiple &#x60;coupon_constraints&#x60; can be passed by specifying unique indices.
406
-
407
- */
408
-
409
- coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
143
+ export interface CouponConstraint {
144
+ entity_type: 'customer';
145
+ type: 'max_redemptions' | 'unique_by';
146
+ value?: string;
410
147
  }
411
- export interface UpdateForItemsResponse {
412
- coupon:Coupon;
148
+ // REQUEST PARAMS
149
+ //---------------
150
+
151
+ export interface CreateInputParam {
152
+ id: string;
153
+ name: string;
154
+ invoice_name?: string;
155
+ discount_type?: 'fixed_amount' | 'percentage';
156
+ discount_amount?: number;
157
+ currency_code?: string;
158
+ discount_percentage?: number /**
159
+ * @deprecated Please refer API docs to use other attributes
160
+ */;
161
+
162
+ discount_quantity?: number;
163
+ apply_on: 'invoice_amount' | 'each_specified_item';
164
+ duration_type?: 'one_time' | 'forever' | 'limited_period';
165
+ duration_month?: number;
166
+ valid_till?: number;
167
+ max_redemptions?: number;
168
+ invoice_notes?: string;
169
+ meta_data?: any;
170
+ included_in_mrr?: boolean;
171
+ period?: number;
172
+ period_unit?: PeriodUnit;
173
+ plan_constraint?: 'none' | 'all' | 'specific';
174
+ addon_constraint?: 'none' | 'all' | 'specific';
175
+ plan_ids?: string[];
176
+ addon_ids?: string[];
177
+ status?: 'active' | 'archived';
413
178
  }
414
- export interface UpdateForItemsInputParam {
415
- [key : string] : any;
416
- /**
417
- * @description The display name used in web interface for identifying the coupon.
418
- **Note:**
419
-
420
-
421
- When the name of the coupon set contains a special character; for example: &#x60;#&#x60;, the API returns an error.
422
- Make sure that you [encode](https://www.urlencoder.org/) the name of the coupon set in the path parameter before making an API call.
423
- .
424
-
425
- */
426
-
427
- name?:string;
428
-
429
- /**
430
- * @description Display name used in invoice. If it is not configured then name is used in invoice.
431
-
432
- */
433
-
434
- invoice_name?:string;
435
-
436
- /**
437
- * @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.
438
-
439
- */
440
-
441
- discount_type?:'fixed_amount' | 'percentage';
442
-
443
- /**
444
- * @description The value of the deduction. The format of this value depends on the [kind of currency](/docs/api#currencies).
445
-
446
- */
447
-
448
- discount_amount?:number;
449
-
450
- /**
451
- * @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.
452
-
453
- */
454
-
455
- currency_code?:string;
456
-
457
- /**
458
- * @description The percentage of the original amount that should be deducted from it.
459
-
460
- */
461
-
462
- discount_percentage?:number;
463
-
464
- /**
465
- * @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.
466
-
467
- */
468
-
469
- apply_on?:'invoice_amount' | 'each_specified_item';
470
-
471
- /**
472
- * @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;.
473
-
474
- */
475
-
476
- duration_type?:'limited_period' | 'one_time' | 'forever';
477
-
478
- /**
479
- * @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;.
480
- **Note:** This parameter has been deprecated. Use &#x60;period&#x60; and &#x60;period_unit&#x60; instead.
481
-
482
- */
483
-
484
- duration_month?:number;
485
-
486
- /**
487
- * @description Date upto which the coupon can be applied to new subscriptions.
488
-
489
- */
490
-
491
- valid_till?:number;
492
-
493
- /**
494
- * @description Maximum number of times this coupon can be redeemed.
495
- **Note:**
496
-
497
-
498
- If not specified, the coupon can be redeemed an indefinite number of times.
499
- .
500
-
501
- */
502
-
503
- max_redemptions?:number;
504
-
505
- /**
506
- * @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.
507
-
508
- */
509
-
510
- invoice_notes?:string;
511
-
512
- /**
513
- * @description A collection of key-value pairs that provides extra information about the coupon.
514
- **Note:** There&#x27;s a character limit of 65,535.
515
- [Learn more](advanced-features?prod_cat_ver&#x3D;2#metadata).
516
-
517
- */
518
-
519
- meta_data?:object;
520
-
521
- /**
522
- * @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;.
523
-
524
- */
525
-
526
- included_in_mrr?:boolean;
527
-
528
- /**
529
- * @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).
530
-
531
- */
532
-
533
- period?:number;
534
-
535
- /**
536
- * @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.
537
-
538
- */
539
-
540
- period_unit?:PeriodUnit;
541
-
542
- /**
543
- * @description Parameters for item_constraints
544
-
545
- */
546
-
547
- item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
548
-
549
- /**
550
- * @description Parameters for item_constraint_criteria
551
-
552
- */
553
-
554
- item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
555
-
556
- /**
557
- * @description Parameters for &#x60;coupon_constraints&#x60;. Multiple &#x60;coupon_constraints&#x60; can be passed by specifying unique indices.
558
-
559
- */
560
-
561
- coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
179
+ export interface CreateForItemsInputParam {
180
+ id: string;
181
+ name: string;
182
+ invoice_name?: string;
183
+ discount_type?: 'fixed_amount' | 'percentage';
184
+ discount_amount?: number;
185
+ currency_code?: string;
186
+ discount_percentage?: number /**
187
+ * @deprecated Please refer API docs to use other attributes
188
+ */;
189
+
190
+ discount_quantity?: number;
191
+ apply_on: 'invoice_amount' | 'each_specified_item';
192
+ duration_type?: 'one_time' | 'forever' | 'limited_period';
193
+ duration_month?: number;
194
+ valid_till?: number;
195
+ max_redemptions?: number;
196
+ invoice_notes?: string;
197
+ meta_data?: any;
198
+ included_in_mrr?: boolean;
199
+ period?: number;
200
+ period_unit?: PeriodUnit;
201
+ status?: 'active' | 'archived';
202
+ item_constraints?: ItemConstraintsCreateForItemsInputParam[];
203
+ item_constraint_criteria?: ItemConstraintCriteriaCreateForItemsInputParam[];
204
+ coupon_constraints?: CouponConstraintsCreateForItemsInputParam[];
205
+ [key: string]: unknown;
562
206
  }
563
- export interface ListResponse {
564
- /**
565
- * @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.
566
-
567
- */
568
-
569
- list:{coupon:Coupon}[];
570
-
571
- /**
572
- * @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.
573
-
574
- */
575
-
576
- next_offset?:string;
207
+ export interface UpdateForItemsInputParam {
208
+ name?: string;
209
+ invoice_name?: string;
210
+ discount_type?: 'fixed_amount' | 'percentage';
211
+ discount_amount?: number;
212
+ currency_code?: string;
213
+ discount_percentage?: number /**
214
+ * @deprecated Please refer API docs to use other attributes
215
+ */;
216
+
217
+ discount_quantity?: number;
218
+ apply_on?: 'invoice_amount' | 'each_specified_item';
219
+ duration_type?: 'one_time' | 'forever' | 'limited_period';
220
+ duration_month?: number;
221
+ valid_till?: number;
222
+ max_redemptions?: number;
223
+ invoice_notes?: string;
224
+ meta_data?: any;
225
+ included_in_mrr?: boolean;
226
+ period?: number;
227
+ period_unit?: PeriodUnit;
228
+ item_constraints?: ItemConstraintsUpdateForItemsInputParam[];
229
+ item_constraint_criteria?: ItemConstraintCriteriaUpdateForItemsInputParam[];
230
+ coupon_constraints?: CouponConstraintsUpdateForItemsInputParam[];
231
+ [key: string]: unknown;
577
232
  }
578
233
  export interface ListInputParam {
579
- [key : string]: any;
580
- /**
581
- * @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.
582
-
583
- */
584
-
585
- limit?:number;
586
-
587
- /**
588
- * @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.
589
-
590
- */
591
-
592
- offset?:string;
593
-
594
- /**
595
- * @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.
596
-
597
- */
598
-
599
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
600
-
601
- /**
602
- * @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.
603
-
604
- */
605
-
606
- name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
607
-
608
- /**
609
- * @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.
610
-
611
- */
612
-
613
- discount_type?:{in?:string,is?:'fixed_amount' | 'percentage',is_not?:'fixed_amount' | 'percentage',not_in?:string};
614
-
615
- /**
616
- * @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.
617
-
618
- */
619
-
620
- duration_type?:{in?:string,is?:'limited_period' | 'one_time' | 'forever',is_not?:'limited_period' | 'one_time' | 'forever',not_in?:string};
621
-
622
- /**
623
- * @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.
624
-
625
- */
626
-
627
- status?:{in?:string,is?:'archived' | 'expired' | 'deleted' | 'active',is_not?:'archived' | 'expired' | 'deleted' | 'active',not_in?:string};
628
-
629
- /**
630
- * @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.
631
-
632
- */
633
-
634
- apply_on?:{in?:string,is?:'invoice_amount' | 'each_specified_item',is_not?:'invoice_amount' | 'each_specified_item',not_in?:string};
635
-
636
- /**
637
- * @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.
638
-
639
- */
640
-
641
- created_at?:{after?:string,before?:string,between?:string,on?:string};
642
-
643
- /**
644
- * @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.
645
-
646
- */
647
-
648
- updated_at?:{after?:string,before?:string,between?:string,on?:string};
649
-
650
- /**
651
- * @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.
652
-
653
- */
654
-
655
- sort_by?:{asc?:'created_at',desc?:'created_at'};
656
-
657
- /**
658
- * @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.
659
-
660
- */
661
-
662
- currency_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
234
+ limit?: number;
235
+ offset?: string;
236
+ id?: filter.String;
237
+ name?: filter.String;
238
+ discount_type?: filter.Enum;
239
+ duration_type?: filter.Enum;
240
+ status?: filter.Enum;
241
+ apply_on?: filter.Enum;
242
+ created_at?: filter.Timestamp;
243
+ updated_at?: filter.Timestamp;
244
+ currency_code?: filter.String;
245
+ 'sort_by[asc]'?: string;
246
+ 'sort_by[desc]'?: string;
247
+ [key: string]: unknown;
663
248
  }
664
- export interface RetrieveResponse {
665
- coupon:Coupon;
249
+ export interface UpdateInputParam {
250
+ name?: string;
251
+ invoice_name?: string;
252
+ discount_type?: 'fixed_amount' | 'percentage';
253
+ discount_amount?: number;
254
+ currency_code?: string;
255
+ discount_percentage?: number /**
256
+ * @deprecated Please refer API docs to use other attributes
257
+ */;
258
+
259
+ discount_quantity?: number;
260
+ apply_on?: 'invoice_amount' | 'each_specified_item';
261
+ duration_type?: 'one_time' | 'forever' | 'limited_period';
262
+ duration_month?: number;
263
+ valid_till?: number;
264
+ max_redemptions?: number;
265
+ invoice_notes?: string;
266
+ meta_data?: any;
267
+ included_in_mrr?: boolean;
268
+ period?: number;
269
+ period_unit?: PeriodUnit;
270
+ plan_constraint?: 'none' | 'all' | 'specific';
271
+ addon_constraint?: 'none' | 'all' | 'specific';
272
+ plan_ids?: string[];
273
+ addon_ids?: string[];
666
274
  }
667
-
668
- export interface DeleteResponse {
669
- coupon:Coupon;
275
+ export interface CopyInputParam {
276
+ from_site: string;
277
+ id_at_from_site: string;
278
+ id?: string;
279
+ for_site_merging?: boolean;
670
280
  }
671
-
672
- export interface CopyResponse {
673
- coupon:Coupon;
281
+ export interface ItemConstraintCriteriaCreateForItemsInputParam {
282
+ item_type?: 'plan' | 'addon' | 'charge';
283
+ item_family_ids?: any;
284
+ currencies?: any;
285
+ item_price_periods?: any;
674
286
  }
675
- export interface CopyInputParam {
676
-
677
- /**
678
- * @description Your Chargebee site name having the coupon to be copied.
679
- **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.
680
-
681
- */
682
-
683
- from_site:string;
684
-
685
- /**
686
- * @description Id of the coupon to be copied. The new coupon created in this site will have the same Id.
687
-
688
- */
689
-
690
- id_at_from_site:string;
691
-
692
- /**
693
- * @description Id of copied coupon in this site.
694
-
695
- */
696
-
697
- id?:string;
698
-
699
- /**
700
- * @description If copy action is performed as part of Chargebee site merge action, pass the value as true.
701
- **Note:** If this parameter is passed true coupon state, redemptions, coupon set and coupon codes associated with this coupon will be copied.
702
-
703
- */
704
-
705
- for_site_merging?:boolean;
287
+ export interface CouponConstraintsCreateForItemsInputParam {
288
+ entity_type: 'customer';
289
+ type: 'max_redemptions' | 'unique_by';
290
+ value?: string;
706
291
  }
707
- export interface UnarchiveResponse {
708
- coupon:Coupon;
292
+ export interface ItemConstraintsCreateForItemsInputParam {
293
+ constraint: 'none' | 'all' | 'specific' | 'criteria';
294
+ item_type: 'plan' | 'addon' | 'charge';
295
+ item_price_ids?: any;
709
296
  }
710
-
711
- export interface ItemConstraint {
712
- /**
713
- * @description Item type for which this criteria is applicable for. \* charge - Charge \* plan - Plan \* addon - Addon
714
-
715
- */
716
-
717
- item_type:'charge' | 'addon' | 'plan';
718
-
719
- /**
720
- * @description Constraint applicable for the item \* specific - Coupon applicable to specific items. \* all - Coupon applicable to all items. \* criteria - Coupon applicable based on criteria. \* none - Coupon not applicable to any items.
721
-
722
- */
723
-
724
- constraint:'all' | 'criteria' | 'none' | 'specific';
725
-
726
- /**
727
- * @description List of item price ids for which this coupon is applicable.
728
-
729
- */
730
-
731
- item_price_ids?:any[];
297
+ export interface ItemConstraintCriteriaUpdateForItemsInputParam {
298
+ item_type?: 'plan' | 'addon' | 'charge';
299
+ item_family_ids?: any;
300
+ currencies?: any;
301
+ item_price_periods?: any;
732
302
  }
733
- export interface ItemConstraintCriteria {
734
- /**
735
- * @description Item type for which this criteria is applicable for. \* charge - Charge is a type of item \* plan - Plan is a type of item \* addon - Addon is a type of item
736
-
737
- */
738
-
739
- item_type:'charge' | 'addon' | 'plan';
740
-
741
- /**
742
- * @description List of currencies ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) for which this coupon is applicable.
743
-
744
- */
745
-
746
- currencies?:any[];
747
-
748
- /**
749
- * @description List of families for which this coupon is applicable.
750
-
751
- */
752
-
753
- item_family_ids?:any[];
754
-
755
- /**
756
- * @description List of frequencies for which this coupon is applicable. Allowed frequencies are \[day, week, month, year\].
757
-
758
- */
759
-
760
- item_price_periods?:any[];
303
+ export interface CouponConstraintsUpdateForItemsInputParam {
304
+ entity_type: 'customer';
305
+ type: 'max_redemptions' | 'unique_by';
306
+ value?: string;
761
307
  }
762
- export interface CouponConstraint {
763
- /**
764
- * @description The resource type for the constraint. This, along with &#x60;type&#x60; and &#x60;value&#x60;, helps define the specific rule applied. \* customer - The constraint is based on &#x60;customer&#x60; records.
765
-
766
- */
767
-
768
- entity_type:'customer';
769
-
770
- /**
771
- * @description Type of coupon constraints \* unique_by - Indicates - when &#x60;entity_type&#x60; is &#x60;customer&#x60; - that the coupon can be redeemed only once for every unique value of a specified &#x60;customer&#x60; attribute. The &#x60;customer&#x60; attribute is specified using &#x60;value&#x60;. For example, if &#x60;value&#x60; is &#x60;email&#x60;, then the coupon can be redeemed only once for every unique value of &#x60;customer.email&#x60;. In other words, when there are multiple &#x60;customer&#x60; records with the same value for &#x60;email&#x60;, once the coupon has been redeemed for one of those customer records, no further redemptions of the coupon are allowed for any of those &#x60;customer&#x60; records. \* max_redemptions - The coupon can be redeemed up to a set number of times for a specific resource type. The maximum redemptions are specified using &#x60;value&#x60;, and the resource type is specified using &#x60;entity_type&#x60;. For example, if &#x60;entity_type&#x60; is &#x60;customer&#x60; and &#x60;value&#x60; is &#x60;10&#x60; then the coupon can only be redeemed up to 10 times for any particular &#x60;customer&#x60; record.
772
-
773
- */
774
-
775
- type:'max_redemptions' | 'unique_by';
776
-
777
- /**
778
- * @description The value of the coupon constraint. The possible values depend on the value of &#x60;constraints[type]&#x60;:
779
-
780
- * When &#x60;type&#x60; is &#x60;unique_by&#x60;, then &#x60;value&#x60; can be &#x60;email&#x60; or &#x60;id&#x60;.
781
-
782
- * When &#x60;type&#x60; is &#x60;max_redemptions&#x60;, then &#x60;value&#x60; can be any integer in the range &#x60;1&#x60; &#x60;coupon.max_redemptions&#x60;, inclusive.
783
-
784
-
785
- */
786
-
787
- value?:string;
308
+ export interface ItemConstraintsUpdateForItemsInputParam {
309
+ constraint: 'none' | 'all' | 'specific' | 'criteria';
310
+ item_type: 'plan' | 'addon' | 'charge';
311
+ item_price_ids?: any;
788
312
  }
789
313
  }
790
- }
314
+ }