chargebee 2.41.1 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/lib/chargebee.js +1 -1
- package/lib/resources/api_endpoints.js +21 -23
- package/package.json +1 -1
- package/types/core.d.ts +2 -1
- package/types/index.d.ts +4 -5
- package/types/resources/Card.d.ts +1 -1
- package/types/resources/Estimate.d.ts +26 -7
- package/types/resources/Invoice.d.ts +11 -24
- package/types/resources/Item.d.ts +67 -381
- package/types/resources/ItemPrice.d.ts +78 -844
- package/types/resources/PaymentSchedule.d.ts +41 -0
- package/types/resources/PaymentScheduleEstimate.d.ts +35 -0
- package/types/resources/PaymentScheduleScheme.d.ts +63 -0
- package/types/resources/PaymentSource.d.ts +25 -896
- package/types/resources/PricingPageSession.d.ts +4 -0
- package/types/resources/Purchase.d.ts +2 -7
- package/types/resources/Quote.d.ts +41 -38
- package/types/resources/QuotedSubscription.d.ts +53 -378
- package/types/resources/Subscription.d.ts +4 -2
- package/types/resources/Installment.d.ts +0 -123
- package/types/resources/InstallmentConfig.d.ts +0 -169
- package/types/resources/InstallmentDetail.d.ts +0 -34
|
@@ -1,221 +1,72 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
2
3
|
declare module 'chargebee' {
|
|
3
4
|
export interface Item {
|
|
4
5
|
[key : string] : any;
|
|
5
|
-
/**
|
|
6
|
-
* @description The identifier for the item. It is unique and immutable.
|
|
7
6
|
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
7
|
id:string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description A unique display name for the item. This is visible only in Chargebee and not to customers.
|
|
14
8
|
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
9
|
name:string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @description A unique display name for the item.
|
|
21
10
|
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
11
|
external_name?:string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @description Description of the item. This is visible only in Chargebee and not to customers.
|
|
28
12
|
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
13
|
description?:string;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @description The status of the item. \* archived - The item is no longer active and no new item prices can be created \* active - The item can be used to create new item prices. \* deleted - Indicates that the item has been [deleted](./items?prod_cat_ver=2#delete_an_item). The `id` and `name` can be reused. Deleted items can be retrieved using [List items](./items?prod_cat_ver=2#list_items).
|
|
35
14
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
status?:'archived' | 'deleted' | 'active';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @description The version number of this resource. For every change made to the resource, `resource_version` is updated with a new timestamp in milliseconds.
|
|
15
|
+
status?:'active' | 'archived' | 'deleted';
|
|
42
16
|
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
17
|
resource_version?:number;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description Timestamp indicating when the item was last updated.
|
|
49
18
|
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
19
|
updated_at?:number;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @description The `id` of the [Item family](./item_families?prod_cat_ver=2) that the item belongs to. Is mandatory when [Product Families](https://www.chargebee.com/docs/2.0/product-families.html) have been enabled.
|
|
56
20
|
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
21
|
item_family_id?:string;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @description The type of the item. \* plan - An essential component of a subscription. Every subscription has exactly one plan. It has a recurring charge and its period defines the billing period of the subscription. \* charge - A non-recurring component that can be added to a subscription in addition to its plan. An charge can also be applied to a customer [directly](./invoices?prod_cat_ver=2#create_invoice_for_a_charge-item) without being applied to a subscription. \* addon - A recurring component that can be added to a subscription in addition to its plan.
|
|
63
22
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
type:'charge' | 'addon' | 'plan';
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @description Indicates that the item is a physical product. If Orders are enabled in Chargebee, subscriptions created for this item will have orders associated with them.
|
|
23
|
+
type:'plan' | 'addon' | 'charge';
|
|
70
24
|
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
25
|
is_shippable?:boolean;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @description Specifies if gift subscriptions can be created for this item.
|
|
77
26
|
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
27
|
is_giftable:boolean;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @description If `enabled_for_checkout`, then the URL to be redirected to once the checkout is complete. This attribute is only available for plan-items.
|
|
84
28
|
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
29
|
redirect_url?:string;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @description Allow the plan to subscribed to via Checkout. Applies only for plan-items.
|
|
91
|
-
**Note:** Only the in-app version of Checkout is supported for Product Catalog v2.
|
|
92
30
|
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
31
|
enabled_for_checkout:boolean;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* @description Allow customers to change their subscription to this plan via the [Self-Serve Portal](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html). Applies only for plan-items. This requires the Portal configuration to [allow changing subscriptions](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html#allow-change-subscription).
|
|
99
32
|
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
33
|
enabled_in_portal:boolean;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @description The item is included in MRR calculations for your site. This attribute is only applicable for items of `type = charge` and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude charge-items from MRR calculations, this value is always returned `false`.
|
|
106
34
|
|
|
107
|
-
*/
|
|
108
|
-
|
|
109
35
|
included_in_mrr?:boolean;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @description Indicates which addon-items and charge-items can be applied to the item. Only meant for plan-items. Other details of attaching items such as whether to attach as a mandatory item or to attach on a certain event, can be specified using the [Create](./attached_items?prod_cat_ver=2#create_an_attached_item) or [Update an attached item](./attached_items?prod_cat_ver=2#update_an_attached_item) API. \* all - all addon-items and charge-items are applicable to this plan-item. \* restricted - only the addon-items or charge-items provided in `applicable_items` can be applied to this plan-item.
|
|
113
36
|
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
37
|
item_applicability:'all' | 'restricted';
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* @description The URL to redirect to once the gift has been claimed by the receiver.
|
|
120
38
|
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
39
|
gift_claim_redirect_url?:string;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @description The unit of measure for a quantity-based item. This is displayed on the Chargebee UI and on customer facing documents/pages. The latter includes [hosted pages](./hosted_pages?prod_cat_ver=2), [invoices](./invoices?prod_cat_ver=2) and [quotes](./quotes?prod_cat_ver=2#). Examples follow:
|
|
127
40
|
|
|
128
|
-
* "user" for a cloud-collaboration platform.
|
|
129
|
-
* "GB" for a data service.
|
|
130
|
-
* "issue" for a magazine.
|
|
131
|
-
|
|
132
|
-
**Note:** `unit` is only exposed via the API to quantity-based addons; it is however NOT exposed to quantity-based plans.
|
|
133
|
-
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
41
|
unit?:string;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* @description Specifies whether the item undergoes metered billing. When `true`, the quantity is calculated from [usage records](/docs/api/usages?prod_cat_ver=2). When `false`, the `quantity` is as determined while adding an item price to the subscription. Applicable only for items of `type` `plan` or `addon` and when [Metered Billing](https://www.chargebee.com/docs/2.0/metered_billing.html) is enabled. The value of this attribute cannot be changed.
|
|
140
42
|
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
43
|
metered:boolean;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @description How the quantity is calculated from usage data for the item prices belonging to this item. Only applicable when the item is `metered`. This value overrides the one [set at the site level](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing). \* sum_of_usages - the net quantity is the sum of the `quantity` of all usages for the current term. \* last_usage - from among the usage records for the [item price](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items_item_price_id) with `usage_date` within the relevant billing period, the `quantity` of the usage record with the most recent `usage_date` is taken as the net quantity consumed. \* max_usage - from among the usage records for the [item price](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items_item_price_id) with `usage_date` within the relevant billing period, the `quantity` of the usage record with the maximum value is taken as the net quantity consumed.
|
|
147
44
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
usage_calculation?:'max_usage' | 'sum_of_usages' | 'last_usage';
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @description Timestamp indicating when this item was archived.
|
|
45
|
+
usage_calculation?:'sum_of_usages' | 'last_usage' | 'max_usage';
|
|
154
46
|
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
47
|
archived_at?:number;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* @description The subscription channel this object originated from and is maintained in. \* app_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed. \* web - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI. \* play_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
|
|
161
48
|
|
|
162
|
-
In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information.
|
|
163
|
-
|
|
164
|
-
*/
|
|
165
|
-
|
|
166
49
|
channel?:Channel;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* @description A collection of key-value pairs that provides extra information about the item. [Learn more](advanced-features#metadata).
|
|
170
50
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
metadata?:object;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* @description The list of addons and charges that are allowed to be applied to the plan. This attribute is applicable only for plan-items and that too when `item_applicability` is `restricted`.
|
|
51
|
+
applicable_items?:Item.ApplicableItem[];
|
|
177
52
|
|
|
178
|
-
|
|
53
|
+
bundle_items?:Item.BundleItem[];
|
|
54
|
+
|
|
55
|
+
bundle_configuration?:Item.BundleConfiguration;
|
|
56
|
+
|
|
57
|
+
metadata?:object;
|
|
179
58
|
|
|
180
|
-
*/
|
|
181
|
-
|
|
182
|
-
applicable_items?:Item.ApplicableItem[];
|
|
183
59
|
}
|
|
184
60
|
export namespace Item {
|
|
185
61
|
export class ItemResource {
|
|
186
|
-
/**
|
|
187
|
-
* @description Creates a new item.
|
|
188
|
-
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
62
|
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
192
63
|
|
|
193
|
-
/**
|
|
194
|
-
* @description Retrieve an item resource.
|
|
195
|
-
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
64
|
retrieve(item_id:string):ChargebeeRequest<RetrieveResponse>;
|
|
199
65
|
|
|
200
|
-
/**
|
|
201
|
-
* @description Updates an item with the changes specified. Unspecified item parameters are not modified.
|
|
202
|
-
|
|
203
|
-
*/
|
|
204
|
-
|
|
205
66
|
update(item_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
|
|
206
67
|
|
|
207
|
-
/**
|
|
208
|
-
* @description Returns a list of items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
|
|
209
|
-
|
|
210
|
-
*/
|
|
211
|
-
|
|
212
68
|
list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
|
|
213
69
|
|
|
214
|
-
/**
|
|
215
|
-
* @description Deletes an item, marking its `status` as deleted. This is not allowed if there are `active` or `archived` item prices under the item. Once deleted, the id and name of the item can be reused.
|
|
216
|
-
|
|
217
|
-
*/
|
|
218
|
-
|
|
219
70
|
delete(item_id:string):ChargebeeRequest<DeleteResponse>;
|
|
220
71
|
}
|
|
221
72
|
export interface CreateResponse {
|
|
@@ -223,145 +74,45 @@ Other details of attaching items can be specified using the [Create](./attached_
|
|
|
223
74
|
}
|
|
224
75
|
export interface CreateInputParam {
|
|
225
76
|
[key : string] : any;
|
|
226
|
-
|
|
227
|
-
* @description The identifier for the item. Must be unique and is immutable once set.
|
|
228
|
-
|
|
229
|
-
*/
|
|
77
|
+
bundle_configuration?:{type?:'fixed'};
|
|
230
78
|
|
|
231
|
-
|
|
79
|
+
bundle_items_to_add?:{item_id?:string,item_type?:ItemType,price_allocation?:number,quantity?:number}[];
|
|
232
80
|
|
|
233
|
-
|
|
234
|
-
* @description A unique display name for the item. Must be unique. This is visible only in Chargebee and not to customers.
|
|
235
|
-
|
|
236
|
-
*/
|
|
81
|
+
id:string;
|
|
237
82
|
|
|
238
83
|
name:string;
|
|
239
84
|
|
|
240
|
-
|
|
241
|
-
* @description The type of the item. \* plan - An essential component of a subscription. Every subscription has exactly one plan. It has a recurring charge and its period defines the billing period of the subscription. \* charge - A non-recurring component that can be added to a subscription in addition to its plan. An charge can also be applied to a customer [directly](./invoices?prod_cat_ver=2#create_invoice_for_a_charge-item) without being applied to a subscription. \* addon - A recurring component that can be added to a subscription in addition to its plan.
|
|
242
|
-
|
|
243
|
-
*/
|
|
244
|
-
|
|
245
|
-
type:'charge' | 'addon' | 'plan';
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* @description Description of the item. This is visible only in Chargebee and not to customers.
|
|
249
|
-
|
|
250
|
-
*/
|
|
85
|
+
type:'plan' | 'addon' | 'charge';
|
|
251
86
|
|
|
252
87
|
description?:string;
|
|
253
88
|
|
|
254
|
-
/**
|
|
255
|
-
* @description The `id` of the [Item family](./item_families?prod_cat_ver=2) that the item belongs to. Is mandatory when [Product Families](https://www.chargebee.com/docs/2.0/product-families.html) have been enabled.
|
|
256
|
-
|
|
257
|
-
*/
|
|
258
|
-
|
|
259
89
|
item_family_id:string;
|
|
260
90
|
|
|
261
|
-
/**
|
|
262
|
-
* @description Specifies if gift subscriptions can be created for this item.
|
|
263
|
-
|
|
264
|
-
*/
|
|
265
|
-
|
|
266
91
|
is_giftable?:boolean;
|
|
267
92
|
|
|
268
|
-
/**
|
|
269
|
-
* @description Indicates that the item is a physical product. If Orders are enabled in Chargebee, subscriptions created for this item will have orders associated with them.
|
|
270
|
-
|
|
271
|
-
*/
|
|
272
|
-
|
|
273
93
|
is_shippable?:boolean;
|
|
274
94
|
|
|
275
|
-
/**
|
|
276
|
-
* @description A unique display name for the item.
|
|
277
|
-
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
95
|
external_name?:string;
|
|
281
96
|
|
|
282
|
-
/**
|
|
283
|
-
* @description Allow customers to change their subscription to this plan via the [Self-Serve Portal](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html). Applies only for plan-items. This requires the Portal configuration to [allow changing subscriptions](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html#allow-change-subscription). Only the in-app version of the Portal is supported for Product Catalog v2.
|
|
284
|
-
|
|
285
|
-
*/
|
|
286
|
-
|
|
287
97
|
enabled_in_portal?:boolean;
|
|
288
98
|
|
|
289
|
-
/**
|
|
290
|
-
* @description If `enabled_for_checkout`, then the URL to be redirected to once the checkout is complete. This attribute is only available for plan-items.
|
|
291
|
-
|
|
292
|
-
*/
|
|
293
|
-
|
|
294
99
|
redirect_url?:string;
|
|
295
100
|
|
|
296
|
-
/**
|
|
297
|
-
* @description Allow the plan to subscribed to via Checkout. Applies only for plan-items.
|
|
298
|
-
**Note:** Only the in-app version of Checkout is supported for Product Catalog v2.
|
|
299
|
-
|
|
300
|
-
*/
|
|
301
|
-
|
|
302
101
|
enabled_for_checkout?:boolean;
|
|
303
102
|
|
|
304
|
-
/**
|
|
305
|
-
* @description Indicates which addon-items and charge-items can be applied to the item. Only possible for plan-items. Other details of attaching items such as whether to attach as a mandatory item or to attach on a certain event, can be specified using the [Create](./attached_items?prod_cat_ver=2#create_an_attached_item) or [Update an attached item](./attached_items?prod_cat_ver=2#update_an_attached_item) API. \* all - all addon-items and charge-items are applicable to this plan-item. \* restricted - only the addon-items or charge-items provided in `applicable_items` can be applied to this plan-item.
|
|
306
|
-
|
|
307
|
-
*/
|
|
308
|
-
|
|
309
103
|
item_applicability?:'all' | 'restricted';
|
|
310
104
|
|
|
311
|
-
/**
|
|
312
|
-
* @description The list of ids of addon-items and charge-items that can be applied to the plan-item. This parameter can be provided only for plan-items and that too when item_applicability is restricted. Other details of attaching items can be specified using the [Create](./attached_items?prod_cat_ver=2#create_an_attached_item) or [Update an attached item](./attached_items?prod_cat_ver=2#update_an_attached_item) API.
|
|
313
|
-
|
|
314
|
-
*/
|
|
315
|
-
|
|
316
105
|
applicable_items?:string[];
|
|
317
106
|
|
|
318
|
-
/**
|
|
319
|
-
* @description The unit of measure for a quantity-based item. This is displayed on the Chargebee UI and on customer facing documents/pages. The latter includes [hosted pages](./hosted_pages?prod_cat_ver=2), [invoices](./invoices?prod_cat_ver=2) and [quotes](./quotes?prod_cat_ver=2#). Examples follow:
|
|
320
|
-
|
|
321
|
-
* "user" for a cloud-collaboration platform.
|
|
322
|
-
* "GB" for a data service.
|
|
323
|
-
* "issue" for a magazine.
|
|
324
|
-
|
|
325
|
-
**Note:** `unit` is only exposed via the API to quantity-based addons; it is however NOT exposed to quantity-based plans. .
|
|
326
|
-
|
|
327
|
-
*/
|
|
328
|
-
|
|
329
107
|
unit?:string;
|
|
330
108
|
|
|
331
|
-
/**
|
|
332
|
-
* @description The URL to redirect to once the gift has been claimed by the receiver.
|
|
333
|
-
|
|
334
|
-
*/
|
|
335
|
-
|
|
336
109
|
gift_claim_redirect_url?:string;
|
|
337
110
|
|
|
338
|
-
/**
|
|
339
|
-
* @description The item is included in MRR calculations for your site. This attribute is only applicable for items of `type = charge` and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude charge-items from MRR calculations, this value is always returned `false`.
|
|
340
|
-
|
|
341
|
-
*/
|
|
342
|
-
|
|
343
111
|
included_in_mrr?:boolean;
|
|
344
112
|
|
|
345
|
-
/**
|
|
346
|
-
* @description Specifies whether the item undergoes metered billing. When `true`, the quantity is calculated from [usage records](/docs/api/usages?prod_cat_ver=2). When `false`, the `quantity` is as determined while adding an item price to the subscription. Applicable only for items of `type` `plan` or `addon` and when [Metered Billing](https://www.chargebee.com/docs/2.0/metered_billing.html) is enabled. The value of this attribute cannot be changed.
|
|
347
|
-
|
|
348
|
-
*/
|
|
349
|
-
|
|
350
113
|
metered?:boolean;
|
|
351
114
|
|
|
352
|
-
|
|
353
|
-
* @description How the quantity is calculated from usage data for the item prices belonging to this item. Only applicable when the item is `metered`. This value overrides the one [set at the site level](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing). . \* sum_of_usages - the net quantity is the sum of the `quantity` of all usages for the current term. \* last_usage - from among the usage records for the [item price](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items_item_price_id) with `usage_date` within the relevant billing period, the `quantity` of the usage record with the most recent `usage_date` is taken as the net quantity consumed. \* max_usage - from among the usage records for the [item price](/docs/api/subscriptions?prod_cat_ver=2#subscription_subscription_items_item_price_id) with `usage_date` within the relevant billing period, the `quantity` of the usage record with the maximum value is taken as the net quantity consumed.
|
|
354
|
-
|
|
355
|
-
*/
|
|
356
|
-
|
|
357
|
-
usage_calculation?:'max_usage' | 'sum_of_usages' | 'last_usage';
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* @description A collection of key-value pairs that provides extra information about the item.
|
|
361
|
-
**Note:** There's a character limit of 65,535.
|
|
362
|
-
[Learn more](advanced-features#metadata).
|
|
363
|
-
|
|
364
|
-
*/
|
|
115
|
+
usage_calculation?:'sum_of_usages' | 'last_usage' | 'max_usage';
|
|
365
116
|
|
|
366
117
|
metadata?:object;
|
|
367
118
|
}
|
|
@@ -374,258 +125,193 @@ Other details of attaching items can be specified using the [Create](./attached_
|
|
|
374
125
|
}
|
|
375
126
|
export interface UpdateInputParam {
|
|
376
127
|
[key : string] : any;
|
|
377
|
-
|
|
378
|
-
* @description The display name for the item. Must be unique. This is visible only in Chargebee and not to customers.
|
|
379
|
-
|
|
380
|
-
*/
|
|
128
|
+
bundle_configuration?:{type?:'fixed'};
|
|
381
129
|
|
|
382
|
-
|
|
130
|
+
bundle_items_to_add?:{item_id?:string,item_type?:ItemType,price_allocation?:number,quantity?:number}[];
|
|
383
131
|
|
|
384
|
-
|
|
385
|
-
* @description Description of the item. This is visible only in Chargebee and not to customers.
|
|
386
|
-
|
|
387
|
-
*/
|
|
132
|
+
bundle_items_to_update?:{item_id?:string,item_type?:ItemType,price_allocation?:number,quantity?:number}[];
|
|
388
133
|
|
|
389
|
-
|
|
134
|
+
bundle_items_to_remove?:{item_id?:string,item_type?:ItemType}[];
|
|
390
135
|
|
|
391
|
-
|
|
392
|
-
* @description Indicates that the item is a physical product. If Orders are enabled in Chargebee, subscriptions created for this item will have orders associated with them.
|
|
393
|
-
|
|
394
|
-
*/
|
|
136
|
+
name?:string;
|
|
395
137
|
|
|
396
|
-
|
|
138
|
+
description?:string;
|
|
397
139
|
|
|
398
|
-
|
|
399
|
-
* @description A unique display name for the item.
|
|
400
|
-
|
|
401
|
-
*/
|
|
140
|
+
is_shippable?:boolean;
|
|
402
141
|
|
|
403
142
|
external_name?:string;
|
|
404
143
|
|
|
405
|
-
/**
|
|
406
|
-
* @description The `id` of the [Item family](./item_families?prod_cat_ver=2) that the item belongs to. Is mandatory when [Product Families](https://www.chargebee.com/docs/2.0/product-families.html) have been enabled.
|
|
407
|
-
|
|
408
|
-
*/
|
|
409
|
-
|
|
410
144
|
item_family_id?:string;
|
|
411
145
|
|
|
412
|
-
/**
|
|
413
|
-
* @description Allow customers to change their subscription to this plan via the [Self-Serve Portal](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html). Applies only for plan-items. This requires the Portal configuration to [allow changing subscriptions](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html#allow-change-subscription).
|
|
414
|
-
|
|
415
|
-
*/
|
|
416
|
-
|
|
417
146
|
enabled_in_portal?:boolean;
|
|
418
147
|
|
|
419
|
-
/**
|
|
420
|
-
* @description If `enabled_for_checkout`, then the URL to be redirected to once the checkout is complete. This parameter is only meant for plan-items.
|
|
421
|
-
|
|
422
|
-
*/
|
|
423
|
-
|
|
424
148
|
redirect_url?:string;
|
|
425
149
|
|
|
426
|
-
/**
|
|
427
|
-
* @description Allow the plan to subscribed to via Checkout. Applies only for plan-items.
|
|
428
|
-
**Note:** Only the in-app version of Checkout is supported for Product Catalog v2.
|
|
429
|
-
|
|
430
|
-
*/
|
|
431
|
-
|
|
432
150
|
enabled_for_checkout?:boolean;
|
|
433
151
|
|
|
434
|
-
/**
|
|
435
|
-
* @description Indicates which addon-items and charge-items can be applied to the item. Only possible for plan-items. Other details of attaching items such as whether to attach as a mandatory item or to attach on a certain event, can be specified using the [Create](./attached_items?prod_cat_ver=2#create_an_attached_item) or [Update an attached item](./attached_items?prod_cat_ver=2#update_an_attached_item) API. \* all - all addon-items and charge-items are applicable to this plan-item. \* restricted - only the addon-items or charge-items provided in `applicable_items` can be applied to this plan-item.
|
|
436
|
-
|
|
437
|
-
*/
|
|
438
|
-
|
|
439
152
|
item_applicability?:'all' | 'restricted';
|
|
440
153
|
|
|
441
|
-
|
|
442
|
-
* @description The list of ids of addon-items and charge-items that can be applied to the plan-item. This parameter can be provided only for plan-items and that too when item_applicability is restricted. Other details of attaching items can be specified using the [Create](./attached_items?prod_cat_ver=2#create_an_attached_item) or [Update an attached item](./attached_items?prod_cat_ver=2#update_an_attached_item) API.
|
|
443
|
-
|
|
444
|
-
*/
|
|
154
|
+
clear_applicable_items?:boolean;
|
|
445
155
|
|
|
446
156
|
applicable_items?:string[];
|
|
447
157
|
|
|
448
|
-
/**
|
|
449
|
-
* @description The unit of measure for a quantity-based item. This is displayed on the Chargebee UI and on customer facing documents/pages. The latter includes [hosted pages](./hosted_pages?prod_cat_ver=2), [invoices](./invoices?prod_cat_ver=2) and [quotes](./quotes?prod_cat_ver=2#). Examples follow:
|
|
450
|
-
|
|
451
|
-
* "user" for a cloud-collaboration platform.
|
|
452
|
-
* "GB" for a data service.
|
|
453
|
-
* "issue" for a magazine.
|
|
454
|
-
|
|
455
|
-
**Note:** `unit` is only exposed via the API to quantity-based addons; it is however NOT exposed to quantity-based plans. .
|
|
456
|
-
|
|
457
|
-
*/
|
|
458
|
-
|
|
459
158
|
unit?:string;
|
|
460
159
|
|
|
461
|
-
/**
|
|
462
|
-
* @description The URL to redirect to once the gift has been claimed by the receiver.
|
|
463
|
-
|
|
464
|
-
*/
|
|
465
|
-
|
|
466
160
|
gift_claim_redirect_url?:string;
|
|
467
161
|
|
|
468
|
-
/**
|
|
469
|
-
* @description A collection of key-value pairs that provides extra information about the item. [Learn more](advanced-features#metadata).
|
|
470
|
-
|
|
471
|
-
*/
|
|
472
|
-
|
|
473
162
|
metadata?:object;
|
|
474
163
|
|
|
475
|
-
/**
|
|
476
|
-
* @description The item is included in MRR calculations for your site. This attribute is only applicable for items of `type = charge` and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude charge-items from MRR calculations, this value is always returned `false`.
|
|
477
|
-
|
|
478
|
-
*/
|
|
479
|
-
|
|
480
164
|
included_in_mrr?:boolean;
|
|
481
165
|
|
|
482
|
-
|
|
483
|
-
* @description The status of the item. \* active - The item can be used to create new item prices. \* deleted - Indicates that the item has been [deleted](./items?prod_cat_ver=2#delete_an_item). The `id` and `name` can be reused. Deleted items can be retrieved using [List items](./items?prod_cat_ver=2#list_items). \* archived - The item is no longer active and no new item prices can be created
|
|
484
|
-
|
|
485
|
-
*/
|
|
486
|
-
|
|
487
|
-
status?:'archived' | 'active';
|
|
166
|
+
status?:'active' | 'archived';
|
|
488
167
|
}
|
|
489
168
|
export interface ListResponse {
|
|
490
|
-
/**
|
|
491
|
-
* @description Returns a list of items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
|
|
492
|
-
|
|
493
|
-
*/
|
|
494
|
-
|
|
495
169
|
list:{item:Item}[];
|
|
496
170
|
|
|
497
|
-
/**
|
|
498
|
-
* @description Returns a list of items satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
|
|
499
|
-
|
|
500
|
-
*/
|
|
501
|
-
|
|
502
171
|
next_offset?:string;
|
|
503
172
|
}
|
|
504
173
|
export interface ListInputParam {
|
|
505
174
|
[key : string]: any;
|
|
506
175
|
/**
|
|
507
|
-
* @description
|
|
176
|
+
* @description The number of resources to be returned.
|
|
508
177
|
|
|
509
178
|
*/
|
|
510
179
|
|
|
511
180
|
limit?:number;
|
|
512
181
|
|
|
513
182
|
/**
|
|
514
|
-
* @description
|
|
183
|
+
* @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.
|
|
515
184
|
|
|
516
185
|
*/
|
|
517
186
|
|
|
518
187
|
offset?:string;
|
|
519
188
|
|
|
520
189
|
/**
|
|
521
|
-
* @description
|
|
190
|
+
* @description Parameters for bundle_configuration
|
|
191
|
+
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
bundle_configuration?:{type?:{in?:string,is?:'fixed',is_not?:'fixed',not_in?:string}};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @description Filter items based on item id.
|
|
522
198
|
|
|
523
199
|
*/
|
|
524
200
|
|
|
525
201
|
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
526
202
|
|
|
527
203
|
/**
|
|
528
|
-
* @description
|
|
204
|
+
* @description Filter items based on `item_family_id`.
|
|
529
205
|
|
|
530
206
|
*/
|
|
531
207
|
|
|
532
208
|
item_family_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
533
209
|
|
|
534
210
|
/**
|
|
535
|
-
* @description
|
|
211
|
+
* @description Filter items based on item `type`.
|
|
536
212
|
|
|
537
213
|
*/
|
|
538
214
|
|
|
539
|
-
type?:{in?:string,is?:'
|
|
215
|
+
type?:{in?:string,is?:'plan' | 'addon' | 'charge',is_not?:'plan' | 'addon' | 'charge',not_in?:string};
|
|
540
216
|
|
|
541
217
|
/**
|
|
542
|
-
* @description
|
|
218
|
+
* @description Filter items based on item `name`.
|
|
543
219
|
|
|
544
220
|
*/
|
|
545
221
|
|
|
546
222
|
name?:{is?:string,is_not?:string,starts_with?:string};
|
|
547
223
|
|
|
548
224
|
/**
|
|
549
|
-
* @description
|
|
225
|
+
* @description Filter items based on `item_applicability`.
|
|
550
226
|
|
|
551
227
|
*/
|
|
552
228
|
|
|
553
229
|
item_applicability?:{in?:string,is?:'all' | 'restricted',is_not?:'all' | 'restricted',not_in?:string};
|
|
554
230
|
|
|
555
231
|
/**
|
|
556
|
-
* @description
|
|
232
|
+
* @description Filter items based on item `status`.
|
|
557
233
|
|
|
558
234
|
*/
|
|
559
235
|
|
|
560
|
-
status?:{in?:string,is?:'
|
|
236
|
+
status?:{in?:string,is?:'active' | 'archived' | 'deleted',is_not?:'active' | 'archived' | 'deleted',not_in?:string};
|
|
561
237
|
|
|
562
238
|
/**
|
|
563
|
-
* @description
|
|
239
|
+
* @description Specifies if gift subscriptions can be created for this item.
|
|
564
240
|
|
|
565
241
|
*/
|
|
566
242
|
|
|
567
243
|
is_giftable?:{is?:'true' | 'false'};
|
|
568
244
|
|
|
569
245
|
/**
|
|
570
|
-
* @description
|
|
246
|
+
* @description Filter items based on when the items were last updated.
|
|
571
247
|
|
|
572
248
|
*/
|
|
573
249
|
|
|
574
250
|
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
575
251
|
|
|
576
252
|
/**
|
|
577
|
-
* @description
|
|
253
|
+
* @description Allow the plan to subscribed to via Checkout. Applies only for plan-items.
|
|
254
|
+
**Note:** Only the in-app version of Checkout is supported for Product Catalog v2.
|
|
578
255
|
|
|
579
256
|
*/
|
|
580
257
|
|
|
581
258
|
enabled_for_checkout?:{is?:'true' | 'false'};
|
|
582
259
|
|
|
583
260
|
/**
|
|
584
|
-
* @description
|
|
261
|
+
* @description Allow customers to change their subscription to this plan via the [Self-Serve Portal](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html). Applies only for plan-items. This requires the Portal configuration to [allow changing subscriptions](https://www.chargebee.com/docs/2.0/inapp-self-serve-portal.html#allow-change-subscription).
|
|
585
262
|
|
|
586
263
|
*/
|
|
587
264
|
|
|
588
265
|
enabled_in_portal?:{is?:'true' | 'false'};
|
|
589
266
|
|
|
590
267
|
/**
|
|
591
|
-
* @description
|
|
268
|
+
* @description Specifies whether the item undergoes metered billing. When `true`, the quantity is calculated from [usage records](/docs/api/usages?prod_cat_ver=2). When `false`, the `quantity` is as determined while adding an item price to the subscription. Applicable only for items of `type` `plan` or `addon` and when [Metered Billing](https://www.chargebee.com/docs/2.0/metered_billing.html) is enabled. The value of this attribute cannot be changed.
|
|
592
269
|
|
|
593
270
|
*/
|
|
594
271
|
|
|
595
272
|
metered?:{is?:'true' | 'false'};
|
|
596
273
|
|
|
597
274
|
/**
|
|
598
|
-
* @description
|
|
275
|
+
* @description How the quantity is calculated from usage data for the item prices belonging to this item. Only applicable when the item is `metered`. This value overrides the one [set at the site level](https://www.chargebee.com/docs/2.0/metered_billing.html#configuring-metered-billing).
|
|
599
276
|
|
|
600
277
|
*/
|
|
601
278
|
|
|
602
|
-
usage_calculation?:{in?:string,is?:'
|
|
279
|
+
usage_calculation?:{in?:string,is?:'sum_of_usages' | 'last_usage' | 'max_usage',is_not?:'sum_of_usages' | 'last_usage' | 'max_usage',not_in?:string};
|
|
603
280
|
|
|
604
281
|
/**
|
|
605
|
-
* @description
|
|
282
|
+
* @description Indicates Whether a plan is grouped(bundle) or not. If it is grouped, it gives us the type of group.
|
|
606
283
|
|
|
607
284
|
*/
|
|
608
285
|
|
|
609
|
-
|
|
286
|
+
item_grouping_category?:{in?:string,is?:'non_bundle' | 'fixed',is_not?:'non_bundle' | 'fixed',not_in?:string};
|
|
610
287
|
|
|
611
288
|
/**
|
|
612
|
-
* @description
|
|
289
|
+
* @description The subscription channel this object originated from and is maintained in.
|
|
613
290
|
|
|
614
291
|
*/
|
|
615
292
|
|
|
616
|
-
|
|
293
|
+
channel?:{in?:string,is?:'web' | 'app_store' | 'play_store',is_not?:'web' | 'app_store' | 'play_store',not_in?:string};
|
|
294
|
+
|
|
295
|
+
sort_by?:{asc?:'name' | 'id' | 'updated_at',desc?:'name' | 'id' | 'updated_at'};
|
|
617
296
|
}
|
|
618
297
|
export interface DeleteResponse {
|
|
619
298
|
item:Item;
|
|
620
299
|
}
|
|
621
300
|
|
|
622
301
|
export interface ApplicableItem {
|
|
623
|
-
/**
|
|
624
|
-
* @description Id of the addon-item or plan-item that can be applied to the plan-item.
|
|
625
|
-
|
|
626
|
-
*/
|
|
627
|
-
|
|
628
302
|
id?:string;
|
|
629
303
|
}
|
|
304
|
+
export interface BundleItem {
|
|
305
|
+
item_id:string;
|
|
306
|
+
|
|
307
|
+
item_type?:'plan' | 'addon' | 'charge';
|
|
308
|
+
|
|
309
|
+
quantity?:number;
|
|
310
|
+
|
|
311
|
+
price_allocation?:number;
|
|
312
|
+
}
|
|
313
|
+
export interface BundleConfiguration {
|
|
314
|
+
type?:'fixed';
|
|
315
|
+
}
|
|
630
316
|
}
|
|
631
317
|
}
|