chargebee 2.41.0 → 3.0.0-beta.2
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 +11 -15
- package/LICENSE +1 -1
- package/README.md +90 -170
- package/cjs/RequestWrapper.js +84 -0
- package/cjs/asyncApiSupport.js +39 -0
- package/cjs/chargebee.cjs.js +13 -0
- package/cjs/chargebee.cjs.worker.js +9 -0
- package/cjs/chargebeeError.js +17 -0
- package/cjs/coreCommon.js +72 -0
- package/cjs/createChargebee.js +92 -0
- package/cjs/environment.js +18 -0
- package/cjs/filter.js +1 -0
- package/cjs/net/ClientInterface.js +40 -0
- package/cjs/net/FetchClient.js +86 -0
- package/cjs/net/NodeClient.js +61 -0
- package/cjs/package.json +1 -0
- package/cjs/resources/api_endpoints.js +1086 -0
- package/cjs/util.js +218 -0
- package/esm/RequestWrapper.js +80 -0
- package/esm/asyncApiSupport.js +35 -0
- package/esm/chargebee.esm.js +9 -0
- package/esm/chargebee.esm.worker.js +5 -0
- package/esm/chargebeeError.js +13 -0
- package/esm/coreCommon.js +67 -0
- package/esm/createChargebee.js +88 -0
- package/esm/environment.js +15 -0
- package/esm/filter.js +1 -0
- package/esm/net/ClientInterface.js +35 -0
- package/esm/net/FetchClient.js +81 -0
- package/esm/net/NodeClient.js +56 -0
- package/esm/package.json +1 -0
- package/esm/resources/api_endpoints.js +1083 -0
- package/esm/util.js +202 -0
- package/package.json +69 -38
- package/types/core.d.ts +558 -89
- package/types/index.d.ts +90 -55
- package/types/resources/Address.d.ts +57 -272
- package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
- package/types/resources/AttachedItem.d.ts +91 -329
- package/types/resources/Attribute.d.ts +5 -5
- package/types/resources/BusinessEntity.d.ts +49 -69
- package/types/resources/BusinessEntityTransfer.d.ts +11 -17
- package/types/resources/Card.d.ts +146 -424
- package/types/resources/Comment.d.ts +72 -189
- package/types/resources/Contact.d.ts +12 -64
- package/types/resources/ContractTerm.d.ts +15 -96
- package/types/resources/Coupon.d.ts +282 -758
- package/types/resources/CouponCode.d.ts +56 -52
- package/types/resources/CouponSet.d.ts +92 -234
- package/types/resources/CreditNote.d.ts +588 -1758
- package/types/resources/CreditNoteEstimate.d.ts +131 -157
- package/types/resources/Currency.d.ts +75 -62
- package/types/resources/Customer.d.ts +892 -835
- package/types/resources/CustomerEntitlement.d.ts +24 -35
- package/types/resources/DifferentialPrice.d.ts +116 -314
- package/types/resources/Discount.d.ts +20 -125
- package/types/resources/Download.d.ts +6 -22
- package/types/resources/Entitlement.d.ts +51 -160
- package/types/resources/EntitlementOverride.d.ts +58 -139
- package/types/resources/Estimate.d.ts +1178 -527
- package/types/resources/Event.d.ts +67 -178
- package/types/resources/Export.d.ts +563 -723
- package/types/resources/Feature.d.ts +117 -433
- package/types/resources/GatewayErrorDetail.d.ts +16 -72
- package/types/resources/Gift.d.ts +265 -432
- package/types/resources/Hierarchy.d.ts +8 -36
- package/types/resources/HostedPage.d.ts +1017 -1153
- package/types/resources/ImpactedItem.d.ts +13 -50
- package/types/resources/ImpactedItemPrice.d.ts +13 -15
- package/types/resources/ImpactedSubscription.d.ts +13 -45
- package/types/resources/InAppSubscription.d.ts +93 -389
- package/types/resources/Installment.d.ts +35 -110
- package/types/resources/InstallmentConfig.d.ts +54 -155
- package/types/resources/InstallmentDetail.d.ts +19 -27
- package/types/resources/Invoice.d.ts +1574 -3157
- package/types/resources/InvoiceEstimate.d.ts +131 -161
- package/types/resources/Item.d.ts +133 -611
- package/types/resources/ItemEntitlement.d.ts +78 -215
- package/types/resources/ItemFamily.d.ts +69 -178
- package/types/resources/ItemPrice.d.ts +291 -1203
- package/types/resources/Metadata.d.ts +3 -5
- package/types/resources/Order.d.ts +538 -1471
- package/types/resources/PaymentIntent.d.ts +163 -347
- package/types/resources/PaymentReferenceNumber.d.ts +7 -29
- package/types/resources/PaymentSource.d.ts +476 -1272
- package/types/resources/PaymentVoucher.d.ts +87 -306
- package/types/resources/PortalSession.d.ts +71 -207
- package/types/resources/PriceVariant.d.ts +91 -279
- package/types/resources/PricingPageSession.d.ts +92 -41
- package/types/resources/PromotionalCredit.d.ts +90 -346
- package/types/resources/Purchase.d.ts +185 -315
- package/types/resources/Quote.d.ts +1406 -887
- package/types/resources/QuoteLineGroup.d.ts +125 -452
- package/types/resources/QuotedCharge.d.ts +45 -274
- package/types/resources/QuotedSubscription.d.ts +100 -488
- package/types/resources/Ramp.d.ts +230 -747
- package/types/resources/ResourceMigration.d.ts +25 -80
- package/types/resources/SiteMigrationDetail.d.ts +34 -112
- package/types/resources/Subscription.d.ts +2390 -4336
- package/types/resources/SubscriptionEntitlement.d.ts +59 -160
- package/types/resources/SubscriptionEstimate.d.ts +51 -75
- package/types/resources/TaxWithheld.d.ts +15 -40
- package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
- package/types/resources/TimeMachine.d.ts +43 -97
- package/types/resources/Token.d.ts +15 -85
- package/types/resources/Transaction.d.ts +276 -911
- package/types/resources/UnbilledCharge.d.ts +189 -164
- package/types/resources/Usage.d.ts +89 -279
- package/types/resources/VirtualBankAccount.d.ts +103 -255
- package/types/resources/filter.d.ts +52 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
- package/.github/ISSUE_TEMPLATE/config.yml +0 -6
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/lib/chargebee.js +0 -512
- package/lib/resources/api_endpoints.js +0 -2935
- package/types/resources/NonSubscription.d.ts +0 -30
- package/types/resources/Session.d.ts +0 -41
|
@@ -1,631 +1,153 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
2
4
|
declare module 'chargebee' {
|
|
3
5
|
export interface Item {
|
|
4
|
-
[key
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
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
|
-
|
|
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.
|
|
42
|
-
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
resource_version?:number;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @description Timestamp indicating when the item was last updated.
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
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
|
-
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
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
|
-
|
|
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.
|
|
70
|
-
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
is_shippable?:boolean;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @description Specifies if gift subscriptions can be created for this item.
|
|
77
|
-
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
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
|
-
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
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
|
-
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
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
|
-
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
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
|
-
|
|
107
|
-
*/
|
|
108
|
-
|
|
109
|
-
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
|
-
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
item_applicability:'all' | 'restricted';
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* @description The URL to redirect to once the gift has been claimed by the receiver.
|
|
120
|
-
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
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
|
-
|
|
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
|
-
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
|
-
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
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
|
-
|
|
148
|
-
*/
|
|
149
|
-
|
|
150
|
-
usage_calculation?:'max_usage' | 'sum_of_usages' | 'last_usage';
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @description Timestamp indicating when this item was archived.
|
|
154
|
-
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
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
|
-
|
|
162
|
-
In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information.
|
|
163
|
-
|
|
164
|
-
*/
|
|
165
|
-
|
|
166
|
-
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
|
-
|
|
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`.
|
|
177
|
-
|
|
178
|
-
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.
|
|
179
|
-
|
|
180
|
-
*/
|
|
181
|
-
|
|
182
|
-
applicable_items?:Item.ApplicableItem[];
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
external_name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
status?: 'active' | 'archived' | 'deleted';
|
|
12
|
+
resource_version?: number;
|
|
13
|
+
updated_at?: number;
|
|
14
|
+
item_family_id?: string;
|
|
15
|
+
type: 'plan' | 'addon' | 'charge';
|
|
16
|
+
is_shippable?: boolean;
|
|
17
|
+
is_giftable: boolean;
|
|
18
|
+
redirect_url?: string;
|
|
19
|
+
enabled_for_checkout: boolean;
|
|
20
|
+
enabled_in_portal: boolean;
|
|
21
|
+
included_in_mrr?: boolean;
|
|
22
|
+
item_applicability: 'all' | 'restricted';
|
|
23
|
+
gift_claim_redirect_url?: string;
|
|
24
|
+
unit?: string;
|
|
25
|
+
metered: boolean;
|
|
26
|
+
usage_calculation?: 'sum_of_usages' | 'last_usage' | 'max_usage';
|
|
27
|
+
archived_at?: number;
|
|
28
|
+
channel?: Channel;
|
|
29
|
+
applicable_items?: Item.ApplicableItem[];
|
|
30
|
+
metadata?: any;
|
|
183
31
|
}
|
|
184
|
-
export namespace Item {
|
|
185
|
-
export class ItemResource {
|
|
186
|
-
/**
|
|
187
|
-
* @description Creates a new item.
|
|
188
|
-
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
|
-
create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* @description Retrieve an item resource.
|
|
195
32
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
delete(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
33
|
+
export namespace Item {
|
|
34
|
+
export class ItemResource {
|
|
35
|
+
create(
|
|
36
|
+
input: CreateInputParam,
|
|
37
|
+
headers?: ChargebeeRequestHeader,
|
|
38
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
39
|
+
|
|
40
|
+
retrieve(
|
|
41
|
+
item_id: string,
|
|
42
|
+
headers?: ChargebeeRequestHeader,
|
|
43
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
44
|
+
|
|
45
|
+
update(
|
|
46
|
+
item_id: string,
|
|
47
|
+
input?: UpdateInputParam,
|
|
48
|
+
headers?: ChargebeeRequestHeader,
|
|
49
|
+
): Promise<ChargebeeResponse<UpdateResponse>>;
|
|
50
|
+
|
|
51
|
+
list(
|
|
52
|
+
input?: ListInputParam,
|
|
53
|
+
headers?: ChargebeeRequestHeader,
|
|
54
|
+
): Promise<ChargebeeResponse<ListResponse>>;
|
|
55
|
+
|
|
56
|
+
delete(
|
|
57
|
+
item_id: string,
|
|
58
|
+
headers?: ChargebeeRequestHeader,
|
|
59
|
+
): Promise<ChargebeeResponse<DeleteResponse>>;
|
|
223
60
|
}
|
|
224
|
-
export interface CreateInputParam {
|
|
225
|
-
[key : string] : any;
|
|
226
|
-
/**
|
|
227
|
-
* @description The identifier for the item. Must be unique and is immutable once set.
|
|
228
|
-
|
|
229
|
-
*/
|
|
230
|
-
|
|
231
|
-
id:string;
|
|
232
|
-
|
|
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
|
-
*/
|
|
237
|
-
|
|
238
|
-
name:string;
|
|
239
|
-
|
|
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
|
-
*/
|
|
251
|
-
|
|
252
|
-
description?:string;
|
|
253
|
-
|
|
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
|
-
item_family_id:string;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* @description Specifies if gift subscriptions can be created for this item.
|
|
263
|
-
|
|
264
|
-
*/
|
|
265
|
-
|
|
266
|
-
is_giftable?:boolean;
|
|
267
|
-
|
|
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
|
-
is_shippable?:boolean;
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @description A unique display name for the item.
|
|
277
|
-
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
|
-
external_name?:string;
|
|
281
|
-
|
|
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
|
-
enabled_in_portal?:boolean;
|
|
288
|
-
|
|
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
|
-
redirect_url?:string;
|
|
295
|
-
|
|
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
|
-
enabled_for_checkout?:boolean;
|
|
303
|
-
|
|
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
|
-
item_applicability?:'all' | 'restricted';
|
|
310
|
-
|
|
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
61
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
applicable_items?:string[];
|
|
317
|
-
|
|
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
|
-
unit?:string;
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* @description The URL to redirect to once the gift has been claimed by the receiver.
|
|
333
|
-
|
|
334
|
-
*/
|
|
335
|
-
|
|
336
|
-
gift_claim_redirect_url?:string;
|
|
337
|
-
|
|
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
|
-
included_in_mrr?:boolean;
|
|
344
|
-
|
|
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
|
-
metered?:boolean;
|
|
351
|
-
|
|
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
|
-
*/
|
|
365
|
-
|
|
366
|
-
metadata?:object;
|
|
367
|
-
}
|
|
368
|
-
export interface RetrieveResponse {
|
|
369
|
-
item:Item;
|
|
62
|
+
export interface CreateResponse {
|
|
63
|
+
item: Item;
|
|
370
64
|
}
|
|
371
|
-
|
|
372
|
-
export interface UpdateResponse {
|
|
373
|
-
item:Item;
|
|
374
|
-
}
|
|
375
|
-
export interface UpdateInputParam {
|
|
376
|
-
[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
|
-
*/
|
|
381
|
-
|
|
382
|
-
name?:string;
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* @description Description of the item. This is visible only in Chargebee and not to customers.
|
|
386
|
-
|
|
387
|
-
*/
|
|
388
|
-
|
|
389
|
-
description?:string;
|
|
390
|
-
|
|
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
|
-
*/
|
|
395
|
-
|
|
396
|
-
is_shippable?:boolean;
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* @description A unique display name for the item.
|
|
400
|
-
|
|
401
|
-
*/
|
|
402
|
-
|
|
403
|
-
external_name?:string;
|
|
404
|
-
|
|
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
|
-
item_family_id?:string;
|
|
411
|
-
|
|
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
|
-
enabled_in_portal?:boolean;
|
|
418
|
-
|
|
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
|
-
redirect_url?:string;
|
|
425
|
-
|
|
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
|
-
enabled_for_checkout?:boolean;
|
|
433
|
-
|
|
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
|
-
item_applicability?:'all' | 'restricted';
|
|
440
|
-
|
|
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
|
-
*/
|
|
445
|
-
|
|
446
|
-
applicable_items?:string[];
|
|
447
|
-
|
|
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
|
-
unit?:string;
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* @description The URL to redirect to once the gift has been claimed by the receiver.
|
|
463
65
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
gift_claim_redirect_url?:string;
|
|
467
|
-
|
|
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
|
-
metadata?:object;
|
|
474
|
-
|
|
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
|
-
included_in_mrr?:boolean;
|
|
481
|
-
|
|
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';
|
|
66
|
+
export interface RetrieveResponse {
|
|
67
|
+
item: Item;
|
|
488
68
|
}
|
|
489
|
-
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
69
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
list:{item:Item}[];
|
|
496
|
-
|
|
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
|
-
next_offset?:string;
|
|
70
|
+
export interface UpdateResponse {
|
|
71
|
+
item: Item;
|
|
503
72
|
}
|
|
504
|
-
export interface ListInputParam {
|
|
505
|
-
[key : string]: any;
|
|
506
|
-
/**
|
|
507
|
-
* @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.
|
|
508
|
-
|
|
509
|
-
*/
|
|
510
|
-
|
|
511
|
-
limit?:number;
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* @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.
|
|
515
|
-
|
|
516
|
-
*/
|
|
517
|
-
|
|
518
|
-
offset?:string;
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* @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.
|
|
522
|
-
|
|
523
|
-
*/
|
|
524
|
-
|
|
525
|
-
id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
526
|
-
|
|
527
|
-
/**
|
|
528
|
-
* @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.
|
|
529
|
-
|
|
530
|
-
*/
|
|
531
|
-
|
|
532
|
-
item_family_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* @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.
|
|
536
|
-
|
|
537
|
-
*/
|
|
538
|
-
|
|
539
|
-
type?:{in?:string,is?:'charge' | 'addon' | 'plan',is_not?:'charge' | 'addon' | 'plan',not_in?:string};
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* @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.
|
|
543
|
-
|
|
544
|
-
*/
|
|
545
|
-
|
|
546
|
-
name?:{is?:string,is_not?:string,starts_with?:string};
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* @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.
|
|
550
|
-
|
|
551
|
-
*/
|
|
552
|
-
|
|
553
|
-
item_applicability?:{in?:string,is?:'all' | 'restricted',is_not?:'all' | 'restricted',not_in?:string};
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* @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.
|
|
557
73
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* @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.
|
|
564
|
-
|
|
565
|
-
*/
|
|
566
|
-
|
|
567
|
-
is_giftable?:{is?:'true' | 'false'};
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* @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.
|
|
571
|
-
|
|
572
|
-
*/
|
|
573
|
-
|
|
574
|
-
updated_at?:{after?:string,before?:string,between?:string,on?:string};
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* @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.
|
|
578
|
-
|
|
579
|
-
*/
|
|
580
|
-
|
|
581
|
-
enabled_for_checkout?:{is?:'true' | 'false'};
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* @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.
|
|
585
|
-
|
|
586
|
-
*/
|
|
587
|
-
|
|
588
|
-
enabled_in_portal?:{is?:'true' | 'false'};
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
* @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.
|
|
592
|
-
|
|
593
|
-
*/
|
|
594
|
-
|
|
595
|
-
metered?:{is?:'true' | 'false'};
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
* @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.
|
|
74
|
+
export interface ListResponse {
|
|
75
|
+
list: { item: Item }[];
|
|
76
|
+
next_offset?: string;
|
|
77
|
+
}
|
|
599
78
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* @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.
|
|
79
|
+
export interface DeleteResponse {
|
|
80
|
+
item: Item;
|
|
81
|
+
}
|
|
606
82
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
* @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.
|
|
83
|
+
export interface ApplicableItem {
|
|
84
|
+
id?: string;
|
|
85
|
+
}
|
|
86
|
+
// REQUEST PARAMS
|
|
87
|
+
//---------------
|
|
613
88
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
89
|
+
export interface CreateInputParam {
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
type: 'plan' | 'addon' | 'charge';
|
|
93
|
+
description?: string;
|
|
94
|
+
item_family_id: string;
|
|
95
|
+
is_giftable?: boolean;
|
|
96
|
+
is_shippable?: boolean;
|
|
97
|
+
external_name?: string;
|
|
98
|
+
enabled_in_portal?: boolean;
|
|
99
|
+
redirect_url?: string;
|
|
100
|
+
enabled_for_checkout?: boolean;
|
|
101
|
+
item_applicability?: 'all' | 'restricted';
|
|
102
|
+
applicable_items?: string[];
|
|
103
|
+
unit?: string;
|
|
104
|
+
gift_claim_redirect_url?: string;
|
|
105
|
+
included_in_mrr?: boolean;
|
|
106
|
+
metered?: boolean;
|
|
107
|
+
usage_calculation?: 'sum_of_usages' | 'last_usage' | 'max_usage';
|
|
108
|
+
metadata?: any;
|
|
109
|
+
[key: string]: unknown;
|
|
617
110
|
}
|
|
618
|
-
export interface
|
|
619
|
-
|
|
111
|
+
export interface UpdateInputParam {
|
|
112
|
+
name?: string;
|
|
113
|
+
description?: string;
|
|
114
|
+
is_shippable?: boolean;
|
|
115
|
+
external_name?: string;
|
|
116
|
+
item_family_id?: string;
|
|
117
|
+
enabled_in_portal?: boolean;
|
|
118
|
+
redirect_url?: string;
|
|
119
|
+
enabled_for_checkout?: boolean;
|
|
120
|
+
item_applicability?: 'all' | 'restricted' /**
|
|
121
|
+
* @deprecated Please refer API docs to use other attributes
|
|
122
|
+
*/;
|
|
123
|
+
|
|
124
|
+
clear_applicable_items?: boolean;
|
|
125
|
+
applicable_items?: string[];
|
|
126
|
+
unit?: string;
|
|
127
|
+
gift_claim_redirect_url?: string;
|
|
128
|
+
metadata?: any;
|
|
129
|
+
included_in_mrr?: boolean;
|
|
130
|
+
status?: 'active' | 'archived';
|
|
131
|
+
[key: string]: unknown;
|
|
620
132
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
133
|
+
export interface ListInputParam {
|
|
134
|
+
limit?: number;
|
|
135
|
+
offset?: string;
|
|
136
|
+
id?: filter.String;
|
|
137
|
+
item_family_id?: filter.String;
|
|
138
|
+
type?: filter.Enum;
|
|
139
|
+
name?: filter.String;
|
|
140
|
+
item_applicability?: filter.Enum;
|
|
141
|
+
status?: filter.Enum;
|
|
142
|
+
is_giftable?: filter.Boolean;
|
|
143
|
+
updated_at?: filter.Timestamp;
|
|
144
|
+
enabled_for_checkout?: filter.Boolean;
|
|
145
|
+
enabled_in_portal?: filter.Boolean;
|
|
146
|
+
metered?: filter.Boolean;
|
|
147
|
+
usage_calculation?: filter.Enum;
|
|
148
|
+
channel?: filter.Enum;
|
|
149
|
+
'sort_by[asc]'?: string;
|
|
150
|
+
'sort_by[desc]'?: string;
|
|
629
151
|
}
|
|
630
152
|
}
|
|
631
|
-
}
|
|
153
|
+
}
|