chargebee 2.26.0 → 2.26.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 (64) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/lib/chargebee.js +1 -1
  3. package/package.json +1 -1
  4. package/types/core.d.ts +1 -0
  5. package/types/resources/Address.d.ts +245 -5
  6. package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
  7. package/types/resources/AttachedItem.d.ts +305 -13
  8. package/types/resources/Card.d.ts +485 -13
  9. package/types/resources/Comment.d.ts +177 -11
  10. package/types/resources/Contact.d.ts +54 -0
  11. package/types/resources/ContractTerm.d.ts +83 -0
  12. package/types/resources/Coupon.d.ts +665 -20
  13. package/types/resources/CouponCode.d.ts +56 -5
  14. package/types/resources/CouponSet.d.ts +224 -17
  15. package/types/resources/CreditNote.d.ts +1202 -44
  16. package/types/resources/CreditNoteEstimate.d.ts +75 -6
  17. package/types/resources/Customer.d.ts +2132 -73
  18. package/types/resources/DifferentialPrice.d.ts +266 -15
  19. package/types/resources/Discount.d.ts +107 -0
  20. package/types/resources/Download.d.ts +18 -0
  21. package/types/resources/EntitlementOverride.d.ts +101 -7
  22. package/types/resources/Estimate.d.ts +1181 -27
  23. package/types/resources/Event.d.ts +145 -8
  24. package/types/resources/Export.d.ts +703 -32
  25. package/types/resources/Feature.d.ts +356 -22
  26. package/types/resources/Gift.d.ts +351 -24
  27. package/types/resources/Hierarchy.d.ts +30 -0
  28. package/types/resources/HostedPage.d.ts +1212 -37
  29. package/types/resources/ImpactedItem.d.ts +41 -1
  30. package/types/resources/ImpactedSubscription.d.ts +36 -1
  31. package/types/resources/InAppSubscription.d.ts +636 -9
  32. package/types/resources/Invoice.d.ts +2293 -93
  33. package/types/resources/InvoiceEstimate.d.ts +75 -6
  34. package/types/resources/Item.d.ts +542 -16
  35. package/types/resources/ItemEntitlement.d.ts +172 -13
  36. package/types/resources/ItemFamily.d.ts +173 -15
  37. package/types/resources/ItemPrice.d.ts +971 -26
  38. package/types/resources/Media.d.ts +24 -0
  39. package/types/resources/NonSubscription.d.ts +51 -3
  40. package/types/resources/Order.d.ts +1224 -32
  41. package/types/resources/PaymentIntent.d.ts +318 -8
  42. package/types/resources/PaymentReferenceNumber.d.ts +24 -0
  43. package/types/resources/PaymentSource.d.ts +1259 -55
  44. package/types/resources/PaymentVoucher.d.ts +262 -14
  45. package/types/resources/PortalSession.d.ts +187 -10
  46. package/types/resources/PromotionalCredit.d.ts +351 -16
  47. package/types/resources/Purchase.d.ts +274 -5
  48. package/types/resources/Quote.d.ts +1595 -62
  49. package/types/resources/QuoteLineGroup.d.ts +134 -5
  50. package/types/resources/QuotedCharge.d.ts +63 -5
  51. package/types/resources/QuotedSubscription.d.ts +192 -5
  52. package/types/resources/ResourceMigration.d.ts +73 -3
  53. package/types/resources/SiteMigrationDetail.d.ts +98 -5
  54. package/types/resources/Subscription.d.ts +3462 -137
  55. package/types/resources/SubscriptionEntitlement.d.ts +116 -8
  56. package/types/resources/SubscriptionEstimate.d.ts +36 -2
  57. package/types/resources/TaxWithheld.d.ts +32 -0
  58. package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
  59. package/types/resources/TimeMachine.d.ts +99 -7
  60. package/types/resources/Token.d.ts +179 -7
  61. package/types/resources/Transaction.d.ts +597 -25
  62. package/types/resources/UnbilledCharge.d.ts +355 -14
  63. package/types/resources/Usage.d.ts +259 -13
  64. package/types/resources/VirtualBankAccount.d.ts +255 -17
@@ -1,89 +1,423 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface Feature {
4
+
5
+ /**
6
+ * @description A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, &#x60;number-of-users-ccjht01&#x60;. When not provided, a random value is automatically set.
7
+
8
+ */
9
+
4
10
  id:string;
11
+
12
+ /**
13
+ * @description A case-sensitive unique name for the feature. For example: &#x60;user license&#x60;, &#x60;data storage&#x60;, &#x60;Salesforce Integration&#x60;, &#x60;devices&#x60;, &#x60;UHD Streaming&#x60;, and so on.
14
+ **Note:** This name is not displayed on any customer-facing documents or pages such as [invoice PDFs](invoices#retrieve_invoice_as_pdf) or [hosted pages](hosted_pages). However, in the future, it is likely to be introduced on the [Self-Serve Portal](portal_sessions).
15
+
16
+ */
17
+
5
18
  name:string;
19
+
20
+ /**
21
+ * @description A brief description of the feature. For example: &#x60;Access to 10TB cloud storage&#x60;.
22
+
23
+ */
24
+
6
25
  description?:string;
26
+
27
+ /**
28
+ * @description The current status of the feature. \* active - A &#x60;draft&#x60; or an &#x60;archived&#x60; feature can be changed to &#x60;active&#x60;. Any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined for the feature take effect immediately. \* draft - The feature is in an unpublished state. [Item](item_entitlements) and [subscription entitlements](subscription_entitlements) can be created for a draft feature but they are not effective until the feature is active. A feature &#x60;status&#x60; cannot be changed back to &#x60;draft&#x60; once it is in &#x60;active&#x60; or &#x60;archived&#x60; &#x60;status&#x60;. \* archived - An &#x60;active&#x60; feature can be changed to &#x60;archived&#x60;. Once &#x60;archived&#x60;, no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60;, remain effective.
29
+
30
+ */
31
+
7
32
  status?:'archived' | 'draft' | 'active';
33
+
34
+ /**
35
+ * @description The type of feature. \* quantity - The feature is quantity-based and entitlement levels available for it are a set of predefined number of quantity units. For example, a feature with &#x60;name&#x60; such as &#x60;number of users&#x60; can have entitlement levels of say, &#x60;5&#x60;, &#x60;20&#x60;, &#x60;50&#x60;, and &#x60;100&#x60;. &#x60;levels[is_unlimited]&#x60; is used for specifying the &quot;unlimited&quot; entitlement level. \* range - The feature is quantity-based and the entitlement levels available for it are the set of whole numbers within a range. The range is defined by a minimum and a maximum value. For example, a feature such as &#x60;number of users&#x60; can have entitlement levels starting at &#x60;5&#x60; users and go up to &#x60;50000&#x60;. &#x60;levels[is_unlimited]&#x60; is used for specifying the &quot;unlimited&quot; entitlement level. \* switch - A switch or toggle is a feature that an item or subscription can be either fully entitled to or not entitled to at all. \* custom - The entitlement levels available for this feature are defined as a set of custom values. For example, a feature &#x60;Email Support&#x60; can have entitlement levels as &#x60;24×7&#x60; and &#x60;24×5&#x60;.
36
+
37
+ */
38
+
8
39
  type?:'quantity' | 'custom' | 'range' | 'switch';
40
+
41
+ /**
42
+ * @description For features of &#x60;type&#x60; &#x60;quantity&#x60; or &#x60;range&#x60;, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as &#x60;user licenses&#x60;, the &#x60;unit&#x60; can be &#x60;license&#x60;.
43
+
44
+ */
45
+
9
46
  unit?:string;
47
+
48
+ /**
49
+ * @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.
50
+
51
+ */
52
+
10
53
  resource_version?:number;
54
+
55
+ /**
56
+ * @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.
57
+
58
+ */
59
+
11
60
  updated_at?:number;
61
+
62
+ /**
63
+ * @description When the feature was created.
64
+
65
+ */
66
+
12
67
  created_at:number;
68
+
69
+ /**
70
+ * @description An ordered list of entitlement levels available for the feature. This is only applicable when &#x60;type&#x60; is other than &#x60;switch&#x60;.
71
+ **Note:** When the &#x60;type&#x60; of the feature is &#x60;switch&#x60;, this is not applicable. This is because any given item (or subscription) can be either fully entitled to a &#x60;switch&#x60; feature or not entitled at all; there are no intermediate entitlement levels.
72
+
73
+ */
74
+
13
75
  levels?:Feature.Level[];
14
76
  }
15
77
  export namespace Feature {
16
- export class FeatureResource {
78
+ export class FeatureResource {
79
+ /**
80
+ * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
81
+
82
+ */
83
+
17
84
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
85
+
86
+ /**
87
+ * @description Creates a new feature and optionally defines the &lt;item_entitlements&gt; for it.
88
+
89
+ */
90
+
18
91
  create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
92
+
93
+ /**
94
+ * @description Deletes a feature. Any item entitlements and subscription entitlements defined for the feature are also removed. This action is not permissible when the &#x60;status&#x60; of the feature is &#x60;active&#x60;.
95
+
96
+ */
97
+
19
98
  delete(feature_id:string):ChargebeeRequest<DeleteResponse>;
99
+
100
+ /**
101
+ * @description Retrieve a specific feature using its id.
102
+
103
+ */
104
+
20
105
  retrieve(feature_id:string):ChargebeeRequest<RetrieveResponse>;
106
+
107
+ /**
108
+ * @description Updates a specific feature.
109
+ **Note**
110
+
111
+ The list of objects &#x60;levels[]&#x60; provided as part of this operation fully replaces the existing list of objects [levels[]](features#feature_levels) of the feature.
112
+
113
+ ### Considerations when modifying &#x60;levels&#x60; {#considerations}
114
+
115
+ This section describes validations that are performed by Chargebee when modifying the &#x60;levels&#x60; list of objects for the feature, using this operation.
116
+
117
+ #### Adding &#x60;levels&#x60; {#adding}
118
+
119
+ Adding a new object to the &#x60;levels[]&#x60; list is allowed if and only if the feature [type](features#feature_type) is &#x60;quantity&#x60; or &#x60;custom&#x60;
120
+
121
+ #### Removing &#x60;levels&#x60; {#removing}
122
+
123
+ Removing an existing object in the &#x60;levels[]&#x60; list is not allowed if the &#x60;value&#x60; for that object is currently mapped to one or more [item_entitlement](item_entitlements)s or [subscription_entitlement](subscription_entitlements)s.
124
+
125
+ #### Reordering &#x60;levels&#x60; {#reorder}
126
+
127
+ **Note**
128
+
129
+ The validation described in this section is only applicable for features of &#x60;type&#x60; &#x60;custom&#x60;
130
+
131
+ If any of &#x60;levels[].value&#x60; are currently mapped to &#x60;item_entitlement&#x60;s or &#x60;subscription_entitlement&#x60;s, then the relative order of the corresponding &#x60;levels[].level&#x60; must be preserved when invoking this operation.
132
+
133
+ For example, consider that the &#x60;levels[]&#x60; list is currently in the state shown below. (For brevity, only the &#x60;value&#x60; and &#x60;level&#x60; key are shown here and the JSONs have been compacted.)
134
+ &#x60; {&quot;levels&quot;:[{&quot;value&quot;:&quot;email-basic&quot;,&quot;level&quot;:0},{&quot;value&quot;:&quot;email-rise&quot;,&quot;level&quot;:1},{&quot;value&quot;:&quot;email-advanced&quot;,&quot;level&quot;:2},{&quot;value&quot;:&quot;email-pro&quot;,&quot;level&quot;:3},{&quot;value&quot;:&quot;email-scale&quot;,&quot;level&quot;:4}]} &#x60;
135
+
136
+ Now consider that &#x60;email-rise&#x60;, &#x60;email-advanced&#x60;, and &#x60;email-pro&#x60; have already been mapped to &#x60;item_entitlement&#x60;s or &#x60;subscription_entitlement&#x60;s. As seen in the above object, the relative order of &#x60;levels[].level&#x60; is such that &#x60;email-rise&#x60; \&lt; &#x60;email-advanced&#x60; \&lt; &#x60;email-pro&#x60;.
137
+
138
+ Invoking this API to change &#x60;levels[]&#x60; to the state below is allowed since the relative order of &#x60;level&#x60; corresponding to &#x60;email-rise&#x60;, &#x60;email-advanced&#x60;, and &#x60;email-pro&#x60; has been preserved.
139
+ &#x60; {&quot;levels&quot;:[{&quot;value&quot;:&quot;email-basic&quot;,&quot;level&quot;:0},{&quot;value&quot;:&quot;email-rise&quot;,&quot;level&quot;:1},{&quot;value&quot;:&quot;email-scale&quot;,&quot;level&quot;:2},{&quot;value&quot;:&quot;email-advanced&quot;,&quot;level&quot;:3},{&quot;value&quot;:&quot;email-pro&quot;,&quot;level&quot;:4}]} &#x60;
140
+
141
+ However, changing &#x60;levels[]&#x60; to the state shown below is not permissible because the &#x60;level&#x60; of &#x60;email-advanced&#x60; is provided as greater than the &#x60;level&#x60; of &#x60;email-pro&#x60;, thereby disrupting the original order.
142
+ &#x60; {&quot;levels&quot;:[{&quot;value&quot;:&quot;email-basic&quot;,&quot;level&quot;:0},{&quot;value&quot;:&quot;email-rise&quot;,&quot;level&quot;:1},{&quot;value&quot;:&quot;email-pro&quot;,&quot;level&quot;:2},{&quot;value&quot;:&quot;email-advanced&quot;,&quot;level&quot;:3},{&quot;value&quot;:&quot;email-scale&quot;,&quot;level&quot;:4}]} &#x60;
143
+
144
+ */
145
+
21
146
  update(feature_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
147
+
148
+ /**
149
+ * @description Archives an &#x60;active&#x60; feature so that no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created towards the feature. Any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60; remain effective. This operation changes the [status](features#feature_status) of the feature to &#x60;archived&#x60;. The feature &#x60;status&#x60; must be &#x60;active&#x60; when calling this endpoint.
150
+
151
+ */
152
+
22
153
  archive(feature_id:string):ChargebeeRequest<ArchiveResponse>;
154
+
155
+ /**
156
+ * @description Activates a &#x60;draft&#x60; feature so that any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined towards it take effect immediately. This operation changes the [status](features#feature_status) of the feature to &#x60;active&#x60;. The feature &#x60;status&#x60; must be &#x60;draft&#x60; when calling this endpoint.
157
+
158
+ */
159
+
23
160
  activate(feature_id:string):ChargebeeRequest<ActivateResponse>;
161
+
162
+ /**
163
+ * @description Reactivates an archived feature so that **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created towards the feature. This operation changes the [status](features#feature_status) of the feature to &#x60;active&#x60;. The feature &#x60;status&#x60; must be &#x60;archived&#x60; when calling this endpoint.
164
+
165
+ */
166
+
24
167
  reactivate(feature_id:string):ChargebeeRequest<ReactivateResponse>;
25
168
  }
26
- export interface ListResponse {
27
- list:{feature:Feature}[];
28
- next_offset?:string;
169
+ export interface ListResponse {
170
+ /**
171
+ * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
172
+
173
+ */
174
+
175
+ list:{feature:Feature}[];
176
+
177
+ /**
178
+ * @description &quot;This API fetches all the available features. &quot; If the limit parameter is not set, it will return upto 10 features. &quot;
179
+
180
+ */
181
+
182
+ next_offset?:string;
29
183
  }
30
184
  export interface ListInputParam {
31
- [key : string]: any;
185
+ [key : string]: any;
186
+ /**
187
+ * @description The number of resources to be returned.
188
+
189
+ */
190
+
32
191
  limit?:number;
192
+
193
+ /**
194
+ * @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.
195
+
196
+ */
197
+
33
198
  offset?:string;
199
+
200
+ /**
201
+ * @description A case-sensitive unique name for the feature. For example: &#x60;user license&#x60;, &#x60;data storage&#x60;, &#x60;Salesforce Integration&#x60;, &#x60;devices&#x60;, &#x60;UHD Streaming&#x60;, and so on.
202
+ **Note:** This name is not displayed on any customer-facing documents or pages such as [invoice PDFs](invoices#retrieve_invoice_as_pdf) or [hosted pages](hosted_pages). However, in the future, it is likely to be introduced on the [Self-Serve Portal](portal_sessions).
203
+
204
+ */
205
+
34
206
  name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
207
+
208
+ /**
209
+ * @description A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, &#x60;number-of-users-ccjht01&#x60;. When not provided, a random value is automatically set.
210
+
211
+ */
212
+
35
213
  id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
214
+
215
+ /**
216
+ * @description The current status of the feature.
217
+
218
+ */
219
+
36
220
  status?:{in?:string,is?:'archived' | 'draft' | 'active',is_not?:'archived' | 'draft' | 'active',not_in?:string};
221
+
222
+ /**
223
+ * @description The type of feature.
224
+
225
+ */
226
+
37
227
  type?:{in?:string,is?:'quantity' | 'custom' | 'range' | 'switch',is_not?:'quantity' | 'custom' | 'range' | 'switch',not_in?:string};
38
228
  }
39
- export interface CreateResponse {
40
- feature:Feature;
229
+ export interface CreateResponse {
230
+ /**
231
+ * @description Creates a new feature and optionally defines the &lt;item_entitlements&gt; for it.
232
+
233
+ */
234
+
235
+ feature:Feature;
41
236
  }
42
237
  export interface CreateInputParam {
43
- [key : string] : any;
238
+ [key : string] : any;
239
+ /**
240
+ * @description A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, &#x60;number-of-users-ccjht01&#x60;. When not provided, a random value is automatically set.
241
+
242
+ */
243
+
44
244
  id?:string;
245
+
246
+ /**
247
+ * @description A case-sensitive unique name for the feature. For example: &#x60;user license&#x60;, &#x60;data storage&#x60;, &#x60;Salesforce Integration&#x60;, &#x60;devices&#x60;, &#x60;UHD Streaming&#x60;, and so on.
248
+ **Note:** This name is not displayed on any customer-facing documents or pages such as [invoice PDFs](invoices#retrieve_invoice_as_pdf) or [hosted pages](hosted_pages). However, in the future, it is likely to be introduced on the [Self-Serve Portal](portal_sessions).
249
+
250
+ */
251
+
45
252
  name:string;
253
+
254
+ /**
255
+ * @description A brief description of the feature. For example: &#x60;Access to 10TB cloud storage&#x60;.
256
+
257
+ */
258
+
46
259
  description?:string;
260
+
261
+ /**
262
+ * @description The type of feature. \* quantity - The feature is quantity-based and entitlement levels available for it are a set of predefined number of quantity units. For example, a feature with &#x60;name&#x60; such as &#x60;number of users&#x60; can have entitlement levels of say, &#x60;5&#x60;, &#x60;20&#x60;, &#x60;50&#x60;, and &#x60;100&#x60;. &#x60;levels[is_unlimited]&#x60; is used for specifying the &quot;unlimited&quot; entitlement level. \* range - The feature is quantity-based and the entitlement levels available for it are the set of whole numbers within a range. The range is defined by a minimum and a maximum value. For example, a feature such as &#x60;number of users&#x60; can have entitlement levels starting at &#x60;5&#x60; users and go up to &#x60;50000&#x60;. &#x60;levels[is_unlimited]&#x60; is used for specifying the &quot;unlimited&quot; entitlement level. \* switch - A switch or toggle is a feature that an item or subscription can be either fully entitled to or not entitled to at all. \* custom - The entitlement levels available for this feature are defined as a set of custom values. For example, a feature &#x60;Email Support&#x60; can have entitlement levels as &#x60;24×7&#x60; and &#x60;24×5&#x60;.
263
+
264
+ */
265
+
47
266
  type?:'quantity' | 'custom' | 'range' | 'switch';
267
+
268
+ /**
269
+ * @description The current status of the feature. \* active - A &#x60;draft&#x60; or an &#x60;archived&#x60; feature can be changed to &#x60;active&#x60;. Any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined for the feature take effect immediately. \* draft - The feature is in an unpublished state. [Item](item_entitlements) and [subscription entitlements](subscription_entitlements) can be created for a draft feature but they are not effective until the feature is active. A feature &#x60;status&#x60; cannot be changed back to &#x60;draft&#x60; once it is in &#x60;active&#x60; or &#x60;archived&#x60; &#x60;status&#x60;. \* archived - An &#x60;active&#x60; feature can be changed to &#x60;archived&#x60;. Once &#x60;archived&#x60;, no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60;, remain effective.
270
+
271
+ */
272
+
48
273
  status?:'draft' | 'active';
274
+
275
+ /**
276
+ * @description For features of &#x60;type&#x60; &#x60;quantity&#x60; or &#x60;range&#x60;, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as &#x60;user licenses&#x60;, the &#x60;unit&#x60; can be &#x60;license&#x60;.
277
+
278
+ */
279
+
49
280
  unit?:string;
281
+
282
+ /**
283
+ * @description Parameters for levels
284
+
285
+ */
286
+
50
287
  levels?:{is_unlimited?:boolean,level?:number,name?:string,value?:string}[];
51
288
  }
52
- export interface DeleteResponse {
53
- feature:Feature;
289
+ export interface DeleteResponse {
290
+ /**
291
+ * @description Deletes a feature. Any item entitlements and subscription entitlements defined for the feature are also removed. This action is not permissible when the &#x60;status&#x60; of the feature is &#x60;active&#x60;.
292
+
293
+ */
294
+
295
+ feature:Feature;
54
296
  }
55
297
 
56
- export interface RetrieveResponse {
57
- feature:Feature;
298
+ export interface RetrieveResponse {
299
+ /**
300
+ * @description Retrieve a specific feature using its id.
301
+
302
+ */
303
+
304
+ feature:Feature;
58
305
  }
59
306
 
60
- export interface UpdateResponse {
61
- feature:Feature;
307
+ export interface UpdateResponse {
308
+ /**
309
+ * @description Updates a specific feature.
310
+ **Note**
311
+
312
+ The list of objects &#x60;levels[]&#x60; provided as part of this operation fully replaces the existing list of objects [levels[]](features#feature_levels) of the feature.
313
+
314
+ ### Considerations when modifying &#x60;levels&#x60; {#considerations}
315
+
316
+ This section describes validations that are performed by Chargebee when modifying the &#x60;levels&#x60; list of objects for the feature, using this operation.
317
+
318
+ #### Adding &#x60;levels&#x60; {#adding}
319
+
320
+ Adding a new object to the &#x60;levels[]&#x60; list is allowed if and only if the feature [type](features#feature_type) is &#x60;quantity&#x60; or &#x60;custom&#x60;
321
+
322
+ #### Removing &#x60;levels&#x60; {#removing}
323
+
324
+ Removing an existing object in the &#x60;levels[]&#x60; list is not allowed if the &#x60;value&#x60; for that object is currently mapped to one or more [item_entitlement](item_entitlements)s or [subscription_entitlement](subscription_entitlements)s.
325
+
326
+ #### Reordering &#x60;levels&#x60; {#reorder}
327
+
328
+ **Note**
329
+
330
+ The validation described in this section is only applicable for features of &#x60;type&#x60; &#x60;custom&#x60;
331
+
332
+ If any of &#x60;levels[].value&#x60; are currently mapped to &#x60;item_entitlement&#x60;s or &#x60;subscription_entitlement&#x60;s, then the relative order of the corresponding &#x60;levels[].level&#x60; must be preserved when invoking this operation.
333
+
334
+ For example, consider that the &#x60;levels[]&#x60; list is currently in the state shown below. (For brevity, only the &#x60;value&#x60; and &#x60;level&#x60; key are shown here and the JSONs have been compacted.)
335
+ &#x60; {&quot;levels&quot;:[{&quot;value&quot;:&quot;email-basic&quot;,&quot;level&quot;:0},{&quot;value&quot;:&quot;email-rise&quot;,&quot;level&quot;:1},{&quot;value&quot;:&quot;email-advanced&quot;,&quot;level&quot;:2},{&quot;value&quot;:&quot;email-pro&quot;,&quot;level&quot;:3},{&quot;value&quot;:&quot;email-scale&quot;,&quot;level&quot;:4}]} &#x60;
336
+
337
+ Now consider that &#x60;email-rise&#x60;, &#x60;email-advanced&#x60;, and &#x60;email-pro&#x60; have already been mapped to &#x60;item_entitlement&#x60;s or &#x60;subscription_entitlement&#x60;s. As seen in the above object, the relative order of &#x60;levels[].level&#x60; is such that &#x60;email-rise&#x60; \&lt; &#x60;email-advanced&#x60; \&lt; &#x60;email-pro&#x60;.
338
+
339
+ Invoking this API to change &#x60;levels[]&#x60; to the state below is allowed since the relative order of &#x60;level&#x60; corresponding to &#x60;email-rise&#x60;, &#x60;email-advanced&#x60;, and &#x60;email-pro&#x60; has been preserved.
340
+ &#x60; {&quot;levels&quot;:[{&quot;value&quot;:&quot;email-basic&quot;,&quot;level&quot;:0},{&quot;value&quot;:&quot;email-rise&quot;,&quot;level&quot;:1},{&quot;value&quot;:&quot;email-scale&quot;,&quot;level&quot;:2},{&quot;value&quot;:&quot;email-advanced&quot;,&quot;level&quot;:3},{&quot;value&quot;:&quot;email-pro&quot;,&quot;level&quot;:4}]} &#x60;
341
+
342
+ However, changing &#x60;levels[]&#x60; to the state shown below is not permissible because the &#x60;level&#x60; of &#x60;email-advanced&#x60; is provided as greater than the &#x60;level&#x60; of &#x60;email-pro&#x60;, thereby disrupting the original order.
343
+ &#x60; {&quot;levels&quot;:[{&quot;value&quot;:&quot;email-basic&quot;,&quot;level&quot;:0},{&quot;value&quot;:&quot;email-rise&quot;,&quot;level&quot;:1},{&quot;value&quot;:&quot;email-pro&quot;,&quot;level&quot;:2},{&quot;value&quot;:&quot;email-advanced&quot;,&quot;level&quot;:3},{&quot;value&quot;:&quot;email-scale&quot;,&quot;level&quot;:4}]} &#x60;
344
+
345
+ */
346
+
347
+ feature:Feature;
62
348
  }
63
349
  export interface UpdateInputParam {
64
- [key : string] : any;
350
+ [key : string] : any;
351
+ /**
352
+ * @description A case-sensitive unique name for the feature. For example: &#x60;user license&#x60;, &#x60;data storage&#x60;, &#x60;Salesforce Integration&#x60;, &#x60;devices&#x60;, &#x60;UHD Streaming&#x60;, and so on.
353
+ **Note:** This name is not displayed on any customer-facing documents or pages such as [invoice PDFs](invoices#retrieve_invoice_as_pdf) or [hosted pages](hosted_pages). However, in the future, it is likely to be introduced on the [Self-Serve Portal](portal_sessions).
354
+
355
+ */
356
+
65
357
  name?:string;
358
+
359
+ /**
360
+ * @description A brief description of the feature. For example: &#x60;Access to 10TB cloud storage&#x60;.
361
+
362
+ */
363
+
66
364
  description?:string;
365
+
366
+ /**
367
+ * @description The current status of the feature. \* active - A &#x60;draft&#x60; or an &#x60;archived&#x60; feature can be changed to &#x60;active&#x60;. Any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined for the feature take effect immediately. \* draft - The feature is in an unpublished state. [Item](item_entitlements) and [subscription entitlements](subscription_entitlements) can be created for a draft feature but they are not effective until the feature is active. A feature &#x60;status&#x60; cannot be changed back to &#x60;draft&#x60; once it is in &#x60;active&#x60; or &#x60;archived&#x60; &#x60;status&#x60;. \* archived - An &#x60;active&#x60; feature can be changed to &#x60;archived&#x60;. Once &#x60;archived&#x60;, no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60;, remain effective.
368
+
369
+ */
370
+
67
371
  status?:'archived' | 'draft' | 'active';
372
+
373
+ /**
374
+ * @description For features of &#x60;type&#x60; &#x60;quantity&#x60; or &#x60;range&#x60;, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as &#x60;user licenses&#x60;, the &#x60;unit&#x60; can be &#x60;license&#x60;.
375
+
376
+ */
377
+
68
378
  unit?:string;
379
+
380
+ /**
381
+ * @description Parameters for levels
382
+
383
+ */
384
+
69
385
  levels?:{is_unlimited?:boolean,level?:number,name?:string,value?:string}[];
70
386
  }
71
- export interface ArchiveResponse {
72
- feature:Feature;
387
+ export interface ArchiveResponse {
388
+ /**
389
+ * @description Archives an &#x60;active&#x60; feature so that no **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created towards the feature. Any pre-existing item or subscription entitlements from the time that the feature was &#x60;active&#x60; remain effective. This operation changes the [status](features#feature_status) of the feature to &#x60;archived&#x60;. The feature &#x60;status&#x60; must be &#x60;active&#x60; when calling this endpoint.
390
+
391
+ */
392
+
393
+ feature:Feature;
73
394
  }
74
395
 
75
- export interface ActivateResponse {
76
- feature:Feature;
396
+ export interface ActivateResponse {
397
+ /**
398
+ * @description Activates a &#x60;draft&#x60; feature so that any [item](item_entitlements) or [subscription entitlements](subscription_entitlements) defined towards it take effect immediately. This operation changes the [status](features#feature_status) of the feature to &#x60;active&#x60;. The feature &#x60;status&#x60; must be &#x60;draft&#x60; when calling this endpoint.
399
+
400
+ */
401
+
402
+ feature:Feature;
77
403
  }
78
404
 
79
- export interface ReactivateResponse {
80
- feature:Feature;
405
+ export interface ReactivateResponse {
406
+ /**
407
+ * @description Reactivates an archived feature so that **new** [item](item_entitlements) or [subscription entitlements](subscription_entitlements) can be created towards the feature. This operation changes the [status](features#feature_status) of the feature to &#x60;active&#x60;. The feature &#x60;status&#x60; must be &#x60;archived&#x60; when calling this endpoint.
408
+
409
+ */
410
+
411
+ feature:Feature;
81
412
  }
82
413
 
83
- export interface Level {
414
+ export interface Level {
84
415
  name?:string;
416
+
85
417
  value?:string;
418
+
86
419
  level?:number;
420
+
87
421
  is_unlimited?:boolean;
88
422
  }
89
423
  }