chargebee 2.25.3 → 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.
- package/CHANGELOG.md +35 -0
- package/README.md +55 -49
- package/lib/chargebee.js +1 -1
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/resources/Address.d.ts +245 -5
- package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
- package/types/resources/AttachedItem.d.ts +305 -13
- package/types/resources/Card.d.ts +485 -13
- package/types/resources/Comment.d.ts +177 -11
- package/types/resources/Contact.d.ts +54 -0
- package/types/resources/ContractTerm.d.ts +83 -0
- package/types/resources/Coupon.d.ts +665 -20
- package/types/resources/CouponCode.d.ts +56 -5
- package/types/resources/CouponSet.d.ts +224 -17
- package/types/resources/CreditNote.d.ts +1202 -44
- package/types/resources/CreditNoteEstimate.d.ts +75 -6
- package/types/resources/Customer.d.ts +2132 -73
- package/types/resources/DifferentialPrice.d.ts +266 -15
- package/types/resources/Discount.d.ts +107 -0
- package/types/resources/Download.d.ts +18 -0
- package/types/resources/EntitlementOverride.d.ts +101 -7
- package/types/resources/Estimate.d.ts +1181 -27
- package/types/resources/Event.d.ts +145 -8
- package/types/resources/Export.d.ts +703 -32
- package/types/resources/Feature.d.ts +356 -22
- package/types/resources/Gift.d.ts +351 -24
- package/types/resources/Hierarchy.d.ts +30 -0
- package/types/resources/HostedPage.d.ts +1212 -37
- package/types/resources/ImpactedItem.d.ts +41 -1
- package/types/resources/ImpactedSubscription.d.ts +36 -1
- package/types/resources/InAppSubscription.d.ts +636 -9
- package/types/resources/Invoice.d.ts +2293 -93
- package/types/resources/InvoiceEstimate.d.ts +75 -6
- package/types/resources/Item.d.ts +542 -16
- package/types/resources/ItemEntitlement.d.ts +172 -13
- package/types/resources/ItemFamily.d.ts +173 -15
- package/types/resources/ItemPrice.d.ts +971 -26
- package/types/resources/Media.d.ts +24 -0
- package/types/resources/NonSubscription.d.ts +51 -3
- package/types/resources/Order.d.ts +1224 -32
- package/types/resources/PaymentIntent.d.ts +318 -8
- package/types/resources/PaymentReferenceNumber.d.ts +24 -0
- package/types/resources/PaymentSource.d.ts +1259 -55
- package/types/resources/PaymentVoucher.d.ts +262 -14
- package/types/resources/PortalSession.d.ts +187 -10
- package/types/resources/PromotionalCredit.d.ts +351 -16
- package/types/resources/Purchase.d.ts +274 -5
- package/types/resources/Quote.d.ts +1595 -62
- package/types/resources/QuoteLineGroup.d.ts +134 -5
- package/types/resources/QuotedCharge.d.ts +63 -5
- package/types/resources/QuotedSubscription.d.ts +192 -5
- package/types/resources/ResourceMigration.d.ts +73 -3
- package/types/resources/SiteMigrationDetail.d.ts +98 -5
- package/types/resources/Subscription.d.ts +3462 -137
- package/types/resources/SubscriptionEntitlement.d.ts +116 -8
- package/types/resources/SubscriptionEstimate.d.ts +36 -2
- package/types/resources/TaxWithheld.d.ts +32 -0
- package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
- package/types/resources/TimeMachine.d.ts +99 -7
- package/types/resources/Token.d.ts +179 -7
- package/types/resources/Transaction.d.ts +597 -25
- package/types/resources/UnbilledCharge.d.ts +355 -14
- package/types/resources/Usage.d.ts +259 -13
- 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, `number-of-users-ccjht01`. 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: `user license`, `data storage`, `Salesforce Integration`, `devices`, `UHD Streaming`, 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: `Access to 10TB cloud storage`.
|
|
22
|
+
|
|
23
|
+
*/
|
|
24
|
+
|
|
6
25
|
description?:string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @description The current status of the feature. \* active - A `draft` or an `archived` feature can be changed to `active`. 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 `status` cannot be changed back to `draft` once it is in `active` or `archived` `status`. \* archived - An `active` feature can be changed to `archived`. Once `archived`, 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 `active`, 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 `name` such as `number of users` can have entitlement levels of say, `5`, `20`, `50`, and `100`. `levels[is_unlimited]` is used for specifying the "unlimited" 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 `number of users` can have entitlement levels starting at `5` users and go up to `50000`. `levels[is_unlimited]` is used for specifying the "unlimited" 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 `Email Support` can have entitlement levels as `24×7` and `24×5`.
|
|
36
|
+
|
|
37
|
+
*/
|
|
38
|
+
|
|
8
39
|
type?:'quantity' | 'custom' | 'range' | 'switch';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @description For features of `type` `quantity` or `range`, 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 `user licenses`, the `unit` can be `license`.
|
|
43
|
+
|
|
44
|
+
*/
|
|
45
|
+
|
|
9
46
|
unit?:string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @description The version number of this resource. For every change made to the resource, `resource_version` 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, `resource_version` 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 `type` is other than `switch`.
|
|
71
|
+
**Note:** When the `type` of the feature is `switch`, this is not applicable. This is because any given item (or subscription) can be either fully entitled to a `switch` 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 "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
81
|
+
|
|
82
|
+
*/
|
|
83
|
+
|
|
17
84
|
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @description Creates a new feature and optionally defines the <item_entitlements> 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 `status` of the feature is `active`.
|
|
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 `levels[]` 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 `levels` {#considerations}
|
|
114
|
+
|
|
115
|
+
This section describes validations that are performed by Chargebee when modifying the `levels` list of objects for the feature, using this operation.
|
|
116
|
+
|
|
117
|
+
#### Adding `levels` {#adding}
|
|
118
|
+
|
|
119
|
+
Adding a new object to the `levels[]` list is allowed if and only if the feature [type](features#feature_type) is `quantity` or `custom`
|
|
120
|
+
|
|
121
|
+
#### Removing `levels` {#removing}
|
|
122
|
+
|
|
123
|
+
Removing an existing object in the `levels[]` list is not allowed if the `value` for that object is currently mapped to one or more [item_entitlement](item_entitlements)s or [subscription_entitlement](subscription_entitlements)s.
|
|
124
|
+
|
|
125
|
+
#### Reordering `levels` {#reorder}
|
|
126
|
+
|
|
127
|
+
**Note**
|
|
128
|
+
|
|
129
|
+
The validation described in this section is only applicable for features of `type` `custom`
|
|
130
|
+
|
|
131
|
+
If any of `levels[].value` are currently mapped to `item_entitlement`s or `subscription_entitlement`s, then the relative order of the corresponding `levels[].level` must be preserved when invoking this operation.
|
|
132
|
+
|
|
133
|
+
For example, consider that the `levels[]` list is currently in the state shown below. (For brevity, only the `value` and `level` key are shown here and the JSONs have been compacted.)
|
|
134
|
+
` {"levels":[{"value":"email-basic","level":0},{"value":"email-rise","level":1},{"value":"email-advanced","level":2},{"value":"email-pro","level":3},{"value":"email-scale","level":4}]} `
|
|
135
|
+
|
|
136
|
+
Now consider that `email-rise`, `email-advanced`, and `email-pro` have already been mapped to `item_entitlement`s or `subscription_entitlement`s. As seen in the above object, the relative order of `levels[].level` is such that `email-rise` \< `email-advanced` \< `email-pro`.
|
|
137
|
+
|
|
138
|
+
Invoking this API to change `levels[]` to the state below is allowed since the relative order of `level` corresponding to `email-rise`, `email-advanced`, and `email-pro` has been preserved.
|
|
139
|
+
` {"levels":[{"value":"email-basic","level":0},{"value":"email-rise","level":1},{"value":"email-scale","level":2},{"value":"email-advanced","level":3},{"value":"email-pro","level":4}]} `
|
|
140
|
+
|
|
141
|
+
However, changing `levels[]` to the state shown below is not permissible because the `level` of `email-advanced` is provided as greater than the `level` of `email-pro`, thereby disrupting the original order.
|
|
142
|
+
` {"levels":[{"value":"email-basic","level":0},{"value":"email-rise","level":1},{"value":"email-pro","level":2},{"value":"email-advanced","level":3},{"value":"email-scale","level":4}]} `
|
|
143
|
+
|
|
144
|
+
*/
|
|
145
|
+
|
|
21
146
|
update(feature_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @description Archives an `active` 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 `active` remain effective. This operation changes the [status](features#feature_status) of the feature to `archived`. The feature `status` must be `active` when calling this endpoint.
|
|
150
|
+
|
|
151
|
+
*/
|
|
152
|
+
|
|
22
153
|
archive(feature_id:string):ChargebeeRequest<ArchiveResponse>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @description Activates a `draft` 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 `active`. The feature `status` must be `draft` 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 `active`. The feature `status` must be `archived` when calling this endpoint.
|
|
164
|
+
|
|
165
|
+
*/
|
|
166
|
+
|
|
24
167
|
reactivate(feature_id:string):ChargebeeRequest<ReactivateResponse>;
|
|
25
168
|
}
|
|
26
|
-
export interface ListResponse {
|
|
27
|
-
|
|
28
|
-
|
|
169
|
+
export interface ListResponse {
|
|
170
|
+
/**
|
|
171
|
+
* @description "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
172
|
+
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
list:{feature:Feature}[];
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @description "This API fetches all the available features. " If the limit parameter is not set, it will return upto 10 features. "
|
|
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 \`offset\` to the value of \`next_offset\` 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: `user license`, `data storage`, `Salesforce Integration`, `devices`, `UHD Streaming`, 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, `number-of-users-ccjht01`. 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
|
-
|
|
229
|
+
export interface CreateResponse {
|
|
230
|
+
/**
|
|
231
|
+
* @description Creates a new feature and optionally defines the <item_entitlements> 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, `number-of-users-ccjht01`. 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: `user license`, `data storage`, `Salesforce Integration`, `devices`, `UHD Streaming`, 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: `Access to 10TB cloud storage`.
|
|
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 `name` such as `number of users` can have entitlement levels of say, `5`, `20`, `50`, and `100`. `levels[is_unlimited]` is used for specifying the "unlimited" 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 `number of users` can have entitlement levels starting at `5` users and go up to `50000`. `levels[is_unlimited]` is used for specifying the "unlimited" 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 `Email Support` can have entitlement levels as `24×7` and `24×5`.
|
|
263
|
+
|
|
264
|
+
*/
|
|
265
|
+
|
|
47
266
|
type?:'quantity' | 'custom' | 'range' | 'switch';
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @description The current status of the feature. \* active - A `draft` or an `archived` feature can be changed to `active`. 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 `status` cannot be changed back to `draft` once it is in `active` or `archived` `status`. \* archived - An `active` feature can be changed to `archived`. Once `archived`, 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 `active`, remain effective.
|
|
270
|
+
|
|
271
|
+
*/
|
|
272
|
+
|
|
48
273
|
status?:'draft' | 'active';
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @description For features of `type` `quantity` or `range`, 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 `user licenses`, the `unit` can be `license`.
|
|
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
|
-
|
|
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 `status` of the feature is `active`.
|
|
292
|
+
|
|
293
|
+
*/
|
|
294
|
+
|
|
295
|
+
feature:Feature;
|
|
54
296
|
}
|
|
55
297
|
|
|
56
|
-
export interface RetrieveResponse {
|
|
57
|
-
|
|
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
|
-
|
|
307
|
+
export interface UpdateResponse {
|
|
308
|
+
/**
|
|
309
|
+
* @description Updates a specific feature.
|
|
310
|
+
**Note**
|
|
311
|
+
|
|
312
|
+
The list of objects `levels[]` 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 `levels` {#considerations}
|
|
315
|
+
|
|
316
|
+
This section describes validations that are performed by Chargebee when modifying the `levels` list of objects for the feature, using this operation.
|
|
317
|
+
|
|
318
|
+
#### Adding `levels` {#adding}
|
|
319
|
+
|
|
320
|
+
Adding a new object to the `levels[]` list is allowed if and only if the feature [type](features#feature_type) is `quantity` or `custom`
|
|
321
|
+
|
|
322
|
+
#### Removing `levels` {#removing}
|
|
323
|
+
|
|
324
|
+
Removing an existing object in the `levels[]` list is not allowed if the `value` for that object is currently mapped to one or more [item_entitlement](item_entitlements)s or [subscription_entitlement](subscription_entitlements)s.
|
|
325
|
+
|
|
326
|
+
#### Reordering `levels` {#reorder}
|
|
327
|
+
|
|
328
|
+
**Note**
|
|
329
|
+
|
|
330
|
+
The validation described in this section is only applicable for features of `type` `custom`
|
|
331
|
+
|
|
332
|
+
If any of `levels[].value` are currently mapped to `item_entitlement`s or `subscription_entitlement`s, then the relative order of the corresponding `levels[].level` must be preserved when invoking this operation.
|
|
333
|
+
|
|
334
|
+
For example, consider that the `levels[]` list is currently in the state shown below. (For brevity, only the `value` and `level` key are shown here and the JSONs have been compacted.)
|
|
335
|
+
` {"levels":[{"value":"email-basic","level":0},{"value":"email-rise","level":1},{"value":"email-advanced","level":2},{"value":"email-pro","level":3},{"value":"email-scale","level":4}]} `
|
|
336
|
+
|
|
337
|
+
Now consider that `email-rise`, `email-advanced`, and `email-pro` have already been mapped to `item_entitlement`s or `subscription_entitlement`s. As seen in the above object, the relative order of `levels[].level` is such that `email-rise` \< `email-advanced` \< `email-pro`.
|
|
338
|
+
|
|
339
|
+
Invoking this API to change `levels[]` to the state below is allowed since the relative order of `level` corresponding to `email-rise`, `email-advanced`, and `email-pro` has been preserved.
|
|
340
|
+
` {"levels":[{"value":"email-basic","level":0},{"value":"email-rise","level":1},{"value":"email-scale","level":2},{"value":"email-advanced","level":3},{"value":"email-pro","level":4}]} `
|
|
341
|
+
|
|
342
|
+
However, changing `levels[]` to the state shown below is not permissible because the `level` of `email-advanced` is provided as greater than the `level` of `email-pro`, thereby disrupting the original order.
|
|
343
|
+
` {"levels":[{"value":"email-basic","level":0},{"value":"email-rise","level":1},{"value":"email-pro","level":2},{"value":"email-advanced","level":3},{"value":"email-scale","level":4}]} `
|
|
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: `user license`, `data storage`, `Salesforce Integration`, `devices`, `UHD Streaming`, 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: `Access to 10TB cloud storage`.
|
|
361
|
+
|
|
362
|
+
*/
|
|
363
|
+
|
|
66
364
|
description?:string;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @description The current status of the feature. \* active - A `draft` or an `archived` feature can be changed to `active`. 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 `status` cannot be changed back to `draft` once it is in `active` or `archived` `status`. \* archived - An `active` feature can be changed to `archived`. Once `archived`, 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 `active`, remain effective.
|
|
368
|
+
|
|
369
|
+
*/
|
|
370
|
+
|
|
67
371
|
status?:'archived' | 'draft' | 'active';
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @description For features of `type` `quantity` or `range`, 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 `user licenses`, the `unit` can be `license`.
|
|
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
|
-
|
|
387
|
+
export interface ArchiveResponse {
|
|
388
|
+
/**
|
|
389
|
+
* @description Archives an `active` 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 `active` remain effective. This operation changes the [status](features#feature_status) of the feature to `archived`. The feature `status` must be `active` when calling this endpoint.
|
|
390
|
+
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
feature:Feature;
|
|
73
394
|
}
|
|
74
395
|
|
|
75
|
-
export interface ActivateResponse {
|
|
76
|
-
|
|
396
|
+
export interface ActivateResponse {
|
|
397
|
+
/**
|
|
398
|
+
* @description Activates a `draft` 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 `active`. The feature `status` must be `draft` when calling this endpoint.
|
|
399
|
+
|
|
400
|
+
*/
|
|
401
|
+
|
|
402
|
+
feature:Feature;
|
|
77
403
|
}
|
|
78
404
|
|
|
79
|
-
export interface ReactivateResponse {
|
|
80
|
-
|
|
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 `active`. The feature `status` must be `archived` 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
|
}
|