chargebee 3.21.1 → 3.22.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 +29 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +26 -0
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +26 -0
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/index.d.ts +4 -0
- package/types/resources/Content.d.ts +2 -0
- package/types/resources/Invoice.d.ts +1 -0
- package/types/resources/ItemEntitlement.d.ts +2 -2
- package/types/resources/PricingPageSession.d.ts +10 -0
- package/types/resources/Quote.d.ts +4 -0
- package/types/resources/QuotedSubscription.d.ts +2 -0
- package/types/resources/UsageCharge.d.ts +47 -0
- package/types/resources/UsageSummary.d.ts +45 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
### v3.22.0 (2026-03-02)
|
|
2
|
+
* * *
|
|
3
|
+
### New Resources:
|
|
4
|
+
- [`UsageCharge`](https://apidocs.chargebee.com/docs/api/usage_charges) has been added.
|
|
5
|
+
- [`UsageSummary`](https://apidocs.chargebee.com/docs/api/usage_summaries) has been added.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### New Attributes:
|
|
9
|
+
- [`free_period`](https://apidocs.chargebee.com/docs/api/quoted_subscriptions/quoted-subscription-object#free_period) has been added to [`QuotedSubscription`](https://apidocs.chargebee.com/docs/api/quoted_subscriptions).
|
|
10
|
+
- [`free_period_unit`](https://apidocs.chargebee.com/docs/api/quoted_subscriptions/quoted-subscription-object#free_period_unit) has been added to [`QuotedSubscription`](https://apidocs.chargebee.com/docs/api/quoted_subscriptions).
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### New Parameters:
|
|
14
|
+
- [`net_term_days`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#net_term_days) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices).
|
|
15
|
+
- [`contract_term`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-existing-subscription#contract_term) has been added as request body parameter to [`create_pricing_page_for_existing_subscription`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-existing-subscription) in [`PricingPageSession`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions).
|
|
16
|
+
- [`contract_term`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-new-subscription#contract_term) has been added as request body parameter to [`create_pricing_page_for_new_subscription`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-new-subscription) in [`PricingPageSession`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions).
|
|
17
|
+
- [`subscription.free_period`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#subscription_free_period) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes).
|
|
18
|
+
- [`subscription.free_period_unit`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#subscription_free_period_unit) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes).
|
|
19
|
+
- [`subscription.free_period`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#subscription_free_period) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes).
|
|
20
|
+
- [`subscription.free_period_unit`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#subscription_free_period_unit) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes).
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### New Enums:
|
|
24
|
+
- `month`, `week`, `day`, `hour`, and `minute` have been added as new values enum `WindowSize`.
|
|
25
|
+
- `cancel`, `renew_once`, `renew`, and `evergreen` have been added as new values to enum request body parameter `contract_term.action_at_term_end` in [`create_pricing_page_for_existing_subscription`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-existing-subscription) of [`PricingPageSession`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions).
|
|
26
|
+
- `cancel`, `renew_once`, `renew`, and `evergreen` have been added as new values to enum request body parameter `contract_term.action_at_term_end` in [`create_pricing_page_for_new_subscription`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-new-subscription) of [`PricingPageSession`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions).
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
1
30
|
### v3.21.1 (2026-02-20)
|
|
2
31
|
* * *
|
|
3
32
|
|
package/cjs/environment.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.Environment = {
|
|
|
11
11
|
hostSuffix: '.chargebee.com',
|
|
12
12
|
apiPath: '/api/v2',
|
|
13
13
|
timeout: DEFAULT_TIME_OUT,
|
|
14
|
-
clientVersion: 'v3.
|
|
14
|
+
clientVersion: 'v3.22.0',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
|
@@ -4872,6 +4872,32 @@ exports.Endpoints = {
|
|
|
4872
4872
|
],
|
|
4873
4873
|
['list', 'GET', '/webhook_endpoints', null, false, null, false, {}, {}],
|
|
4874
4874
|
],
|
|
4875
|
+
usageSummary: [
|
|
4876
|
+
[
|
|
4877
|
+
'retrieveUsageSummaryForSubscription',
|
|
4878
|
+
'GET',
|
|
4879
|
+
'/subscriptions',
|
|
4880
|
+
'/usage_summary',
|
|
4881
|
+
true,
|
|
4882
|
+
null,
|
|
4883
|
+
false,
|
|
4884
|
+
{},
|
|
4885
|
+
{},
|
|
4886
|
+
],
|
|
4887
|
+
],
|
|
4888
|
+
usageCharge: [
|
|
4889
|
+
[
|
|
4890
|
+
'retrieveUsageChargesForSubscription',
|
|
4891
|
+
'GET',
|
|
4892
|
+
'/subscriptions',
|
|
4893
|
+
'/usage_charges',
|
|
4894
|
+
true,
|
|
4895
|
+
null,
|
|
4896
|
+
false,
|
|
4897
|
+
{},
|
|
4898
|
+
{},
|
|
4899
|
+
],
|
|
4900
|
+
],
|
|
4875
4901
|
impactedCustomer: [],
|
|
4876
4902
|
subscriptionEntitlementsUpdatedDetail: [],
|
|
4877
4903
|
subscriptionEntitlementsCreatedDetail: [],
|
package/esm/environment.js
CHANGED
|
@@ -8,7 +8,7 @@ export const Environment = {
|
|
|
8
8
|
hostSuffix: '.chargebee.com',
|
|
9
9
|
apiPath: '/api/v2',
|
|
10
10
|
timeout: DEFAULT_TIME_OUT,
|
|
11
|
-
clientVersion: 'v3.
|
|
11
|
+
clientVersion: 'v3.22.0',
|
|
12
12
|
port: DEFAULT_PORT,
|
|
13
13
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
14
14
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
|
@@ -4869,6 +4869,32 @@ export const Endpoints = {
|
|
|
4869
4869
|
],
|
|
4870
4870
|
['list', 'GET', '/webhook_endpoints', null, false, null, false, {}, {}],
|
|
4871
4871
|
],
|
|
4872
|
+
usageSummary: [
|
|
4873
|
+
[
|
|
4874
|
+
'retrieveUsageSummaryForSubscription',
|
|
4875
|
+
'GET',
|
|
4876
|
+
'/subscriptions',
|
|
4877
|
+
'/usage_summary',
|
|
4878
|
+
true,
|
|
4879
|
+
null,
|
|
4880
|
+
false,
|
|
4881
|
+
{},
|
|
4882
|
+
{},
|
|
4883
|
+
],
|
|
4884
|
+
],
|
|
4885
|
+
usageCharge: [
|
|
4886
|
+
[
|
|
4887
|
+
'retrieveUsageChargesForSubscription',
|
|
4888
|
+
'GET',
|
|
4889
|
+
'/subscriptions',
|
|
4890
|
+
'/usage_charges',
|
|
4891
|
+
true,
|
|
4892
|
+
null,
|
|
4893
|
+
false,
|
|
4894
|
+
{},
|
|
4895
|
+
{},
|
|
4896
|
+
],
|
|
4897
|
+
],
|
|
4872
4898
|
impactedCustomer: [],
|
|
4873
4899
|
subscriptionEntitlementsUpdatedDetail: [],
|
|
4874
4900
|
subscriptionEntitlementsCreatedDetail: [],
|
package/package.json
CHANGED
package/types/core.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -94,8 +94,10 @@
|
|
|
94
94
|
///<reference path='./resources/Transaction.d.ts' />
|
|
95
95
|
///<reference path='./resources/UnbilledCharge.d.ts' />
|
|
96
96
|
///<reference path='./resources/Usage.d.ts' />
|
|
97
|
+
///<reference path='./resources/UsageCharge.d.ts' />
|
|
97
98
|
///<reference path='./resources/UsageEvent.d.ts' />
|
|
98
99
|
///<reference path='./resources/UsageFile.d.ts' />
|
|
100
|
+
///<reference path='./resources/UsageSummary.d.ts' />
|
|
99
101
|
///<reference path='./resources/VirtualBankAccount.d.ts' />
|
|
100
102
|
///<reference path='./resources/WebhookEndpoint.d.ts' />
|
|
101
103
|
///<reference path='./resources/Content.d.ts' />
|
|
@@ -238,8 +240,10 @@ declare module 'chargebee' {
|
|
|
238
240
|
transaction: Transaction.TransactionResource;
|
|
239
241
|
unbilledCharge: UnbilledCharge.UnbilledChargeResource;
|
|
240
242
|
usage: Usage.UsageResource;
|
|
243
|
+
usageCharge: UsageCharge.UsageChargeResource;
|
|
241
244
|
usageEvent: UsageEvent.UsageEventResource;
|
|
242
245
|
usageFile: UsageFile.UsageFileResource;
|
|
246
|
+
usageSummary: UsageSummary.UsageSummaryResource;
|
|
243
247
|
virtualBankAccount: VirtualBankAccount.VirtualBankAccountResource;
|
|
244
248
|
webhookEndpoint: WebhookEndpoint.WebhookEndpointResource;
|
|
245
249
|
|
|
@@ -99,8 +99,10 @@ declare module 'chargebee' {
|
|
|
99
99
|
transaction: Transaction;
|
|
100
100
|
unbilled_charge: UnbilledCharge;
|
|
101
101
|
usage: Usage;
|
|
102
|
+
usage_charge: UsageCharge;
|
|
102
103
|
usage_event: UsageEvent;
|
|
103
104
|
usage_file: UsageFile;
|
|
105
|
+
usage_summary: UsageSummary;
|
|
104
106
|
virtual_bank_account: VirtualBankAccount;
|
|
105
107
|
webhook_endpoint: WebhookEndpoint;
|
|
106
108
|
}
|
|
@@ -907,6 +907,7 @@ declare module 'chargebee' {
|
|
|
907
907
|
authorization_transaction_id?: string;
|
|
908
908
|
payment_source_id?: string;
|
|
909
909
|
auto_collection?: AutoCollectionEnum;
|
|
910
|
+
net_term_days?: number;
|
|
910
911
|
invoice_date?: number;
|
|
911
912
|
token_id?: string;
|
|
912
913
|
replace_primary_payment_source?: boolean;
|
|
@@ -52,11 +52,11 @@ declare module 'chargebee' {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export interface AddItemEntitlementsResponse {
|
|
55
|
-
item_entitlement: ItemEntitlement;
|
|
55
|
+
list: { item_entitlement: ItemEntitlement }[];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export interface UpsertOrRemoveItemEntitlementsForItemResponse {
|
|
59
|
-
item_entitlement: ItemEntitlement;
|
|
59
|
+
list: { item_entitlement: ItemEntitlement }[];
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// REQUEST PARAMS
|
|
@@ -43,6 +43,7 @@ declare module 'chargebee' {
|
|
|
43
43
|
customer?: CustomerCreateForNewSubscriptionInputParam;
|
|
44
44
|
billing_address?: BillingAddressCreateForNewSubscriptionInputParam;
|
|
45
45
|
shipping_address?: ShippingAddressCreateForNewSubscriptionInputParam;
|
|
46
|
+
contract_term?: ContractTermCreateForNewSubscriptionInputParam;
|
|
46
47
|
discounts?: DiscountsCreateForNewSubscriptionInputParam[];
|
|
47
48
|
}
|
|
48
49
|
export interface CreateForExistingSubscriptionInputParam {
|
|
@@ -50,6 +51,7 @@ declare module 'chargebee' {
|
|
|
50
51
|
custom?: any;
|
|
51
52
|
pricing_page?: PricingPageCreateForExistingSubscriptionInputParam;
|
|
52
53
|
subscription?: SubscriptionCreateForExistingSubscriptionInputParam;
|
|
54
|
+
contract_term?: ContractTermCreateForExistingSubscriptionInputParam;
|
|
53
55
|
discounts?: DiscountsCreateForExistingSubscriptionInputParam[];
|
|
54
56
|
}
|
|
55
57
|
export interface BillingAddressCreateForNewSubscriptionInputParam {
|
|
@@ -96,6 +98,10 @@ declare module 'chargebee' {
|
|
|
96
98
|
country?: string;
|
|
97
99
|
validation_status?: ValidationStatusEnum;
|
|
98
100
|
}
|
|
101
|
+
export interface ContractTermCreateForNewSubscriptionInputParam {
|
|
102
|
+
action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
103
|
+
cancellation_cutoff_period?: number;
|
|
104
|
+
}
|
|
99
105
|
export interface SubscriptionCreateForNewSubscriptionInputParam {
|
|
100
106
|
id?: string;
|
|
101
107
|
}
|
|
@@ -115,6 +121,10 @@ declare module 'chargebee' {
|
|
|
115
121
|
export interface PricingPageCreateForExistingSubscriptionInputParam {
|
|
116
122
|
id?: string;
|
|
117
123
|
}
|
|
124
|
+
export interface ContractTermCreateForExistingSubscriptionInputParam {
|
|
125
|
+
action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
126
|
+
cancellation_cutoff_period?: number;
|
|
127
|
+
}
|
|
118
128
|
export interface SubscriptionCreateForExistingSubscriptionInputParam {
|
|
119
129
|
id: string;
|
|
120
130
|
}
|
|
@@ -1120,6 +1120,8 @@ declare module 'chargebee' {
|
|
|
1120
1120
|
start_date?: number;
|
|
1121
1121
|
offline_payment_method?: OfflinePaymentMethodEnum;
|
|
1122
1122
|
contract_term_billing_cycle_on_renewal?: number;
|
|
1123
|
+
free_period?: number;
|
|
1124
|
+
free_period_unit?: FreePeriodUnitEnum;
|
|
1123
1125
|
}
|
|
1124
1126
|
|
|
1125
1127
|
export interface SubscriptionItemsCreateSubItemsForCustomerQuoteInputParam {
|
|
@@ -1219,6 +1221,8 @@ declare module 'chargebee' {
|
|
|
1219
1221
|
start_date?: number;
|
|
1220
1222
|
offline_payment_method?: OfflinePaymentMethodEnum;
|
|
1221
1223
|
contract_term_billing_cycle_on_renewal?: number;
|
|
1224
|
+
free_period?: number;
|
|
1225
|
+
free_period_unit?: FreePeriodUnitEnum;
|
|
1222
1226
|
}
|
|
1223
1227
|
|
|
1224
1228
|
export interface SubscriptionItemsEditCreateSubCustomerQuoteForItemsInputParam {
|
|
@@ -19,6 +19,8 @@ declare module 'chargebee' {
|
|
|
19
19
|
plan_unit_price_in_decimal?: string;
|
|
20
20
|
changes_scheduled_at?: number;
|
|
21
21
|
change_option?: 'end_of_term' | 'specific_date' | 'immediately';
|
|
22
|
+
free_period?: number;
|
|
23
|
+
free_period_unit?: FreePeriodUnitEnum;
|
|
22
24
|
contract_term_billing_cycle_on_renewal?: number;
|
|
23
25
|
addons?: QuotedSubscription.Addon[];
|
|
24
26
|
event_based_addons?: QuotedSubscription.EventBasedAddon[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface UsageCharge {
|
|
6
|
+
subscription_id: string;
|
|
7
|
+
feature_id: string;
|
|
8
|
+
included_usage?: string;
|
|
9
|
+
total_usage?: string;
|
|
10
|
+
on_demand_usage?: string;
|
|
11
|
+
metered_item_price_id?: string;
|
|
12
|
+
amount?: string;
|
|
13
|
+
currency_code?: string;
|
|
14
|
+
usage_from: number;
|
|
15
|
+
usage_to: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export namespace UsageCharge {
|
|
19
|
+
export class UsageChargeResource {
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
retrieveUsageChargesForSubscription(
|
|
25
|
+
subscription_id: string,
|
|
26
|
+
input?: RetrieveUsageChargesForSubscriptionInputParam,
|
|
27
|
+
headers?: ChargebeeRequestHeader,
|
|
28
|
+
): Promise<
|
|
29
|
+
ChargebeeResponse<RetrieveUsageChargesForSubscriptionResponse>
|
|
30
|
+
>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface RetrieveUsageChargesForSubscriptionResponse {
|
|
34
|
+
list: { usage_charge: UsageCharge }[];
|
|
35
|
+
next_offset?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// REQUEST PARAMS
|
|
39
|
+
//---------------
|
|
40
|
+
|
|
41
|
+
export interface RetrieveUsageChargesForSubscriptionInputParam {
|
|
42
|
+
limit?: number;
|
|
43
|
+
offset?: string;
|
|
44
|
+
feature_id?: filter.String;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface UsageSummary {
|
|
6
|
+
subscription_id: string;
|
|
7
|
+
feature_id: string;
|
|
8
|
+
aggregated_value: string;
|
|
9
|
+
aggregated_from: number;
|
|
10
|
+
aggregated_to: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export namespace UsageSummary {
|
|
14
|
+
export class UsageSummaryResource {
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
retrieveUsageSummaryForSubscription(
|
|
20
|
+
subscription_id: string,
|
|
21
|
+
input: RetrieveUsageSummaryForSubscriptionInputParam,
|
|
22
|
+
headers?: ChargebeeRequestHeader,
|
|
23
|
+
): Promise<
|
|
24
|
+
ChargebeeResponse<RetrieveUsageSummaryForSubscriptionResponse>
|
|
25
|
+
>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface RetrieveUsageSummaryForSubscriptionResponse {
|
|
29
|
+
list: { usage_summary: UsageSummary }[];
|
|
30
|
+
next_offset?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// REQUEST PARAMS
|
|
34
|
+
//---------------
|
|
35
|
+
|
|
36
|
+
export interface RetrieveUsageSummaryForSubscriptionInputParam {
|
|
37
|
+
limit?: number;
|
|
38
|
+
offset?: string;
|
|
39
|
+
feature_id: string;
|
|
40
|
+
window_size?: 'month' | 'week' | 'day' | 'hour' | 'minute';
|
|
41
|
+
timeframe_start?: number;
|
|
42
|
+
timeframe_end?: number;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|