chargebee 3.12.0 → 3.14.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 +70 -0
- package/README.md +30 -1
- package/cjs/coreCommon.js +1 -1
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +66 -0
- package/esm/coreCommon.js +1 -1
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +66 -0
- package/package.json +2 -2
- package/types/core.d.ts +8 -1
- package/types/index.d.ts +16 -0
- package/types/resources/BusinessEntityChange.d.ts +16 -0
- package/types/resources/Comment.d.ts +0 -9
- package/types/resources/Content.d.ts +110 -0
- package/types/resources/CreditNote.d.ts +3 -1
- package/types/resources/CreditNoteEstimate.d.ts +31 -31
- package/types/resources/Currency.d.ts +11 -5
- package/types/resources/Customer.d.ts +1 -0
- package/types/resources/Estimate.d.ts +2 -0
- package/types/resources/Event.d.ts +208 -1
- package/types/resources/GatewayErrorDetail.d.ts +1 -0
- package/types/resources/HostedPage.d.ts +3 -1
- package/types/resources/Invoice.d.ts +5 -1
- package/types/resources/InvoiceEstimate.d.ts +42 -42
- package/types/resources/OfferEvent.d.ts +25 -0
- package/types/resources/OfferFulfillment.d.ts +77 -0
- package/types/resources/OmnichannelOneTimeOrder.d.ts +1 -13
- package/types/resources/OmnichannelSubscription.d.ts +13 -12
- package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
- package/types/resources/OmnichannelSubscriptionItemOffer.d.ts +22 -0
- package/types/resources/OmnichannelTransaction.d.ts +13 -0
- package/types/resources/Order.d.ts +0 -1
- package/types/resources/PersonalizedOffer.d.ts +64 -0
- package/types/resources/Product.d.ts +135 -0
- package/types/resources/Quote.d.ts +35 -34
- package/types/resources/QuoteLineGroup.d.ts +21 -21
- package/types/resources/Ramp.d.ts +46 -0
- package/types/resources/SalesOrder.d.ts +143 -0
- package/types/resources/Subscription.d.ts +1 -1
- package/types/resources/SubscriptionEstimate.d.ts +0 -1
- package/types/resources/Transaction.d.ts +1 -0
- package/types/resources/UsageFile.d.ts +2 -0
- package/types/resources/UsageReminderInfo.d.ts +9 -0
- package/types/resources/Variant.d.ts +116 -0
- package/types/resources/WebhookEvent.d.ts +1619 -0
|
@@ -19,6 +19,7 @@ declare module 'chargebee' {
|
|
|
19
19
|
items_to_remove?: string[];
|
|
20
20
|
coupons_to_remove?: string[];
|
|
21
21
|
discounts_to_remove?: string[];
|
|
22
|
+
contract_term?: Ramp.ContractTerm;
|
|
22
23
|
deleted: boolean;
|
|
23
24
|
status_transition_reason?: Ramp.StatusTransitionReason;
|
|
24
25
|
}
|
|
@@ -88,6 +89,13 @@ declare module 'chargebee' {
|
|
|
88
89
|
billing_cycles?: number;
|
|
89
90
|
service_period_days?: number;
|
|
90
91
|
metered_quantity?: string;
|
|
92
|
+
charge_once?: boolean;
|
|
93
|
+
charge_on_option?: 'immediately' | 'on_event';
|
|
94
|
+
charge_on_event?:
|
|
95
|
+
| 'subscription_trial_start'
|
|
96
|
+
| 'plan_activation'
|
|
97
|
+
| 'subscription_activation'
|
|
98
|
+
| 'contract_termination';
|
|
91
99
|
}
|
|
92
100
|
export interface ItemsToUpdate {
|
|
93
101
|
item_price_id: string;
|
|
@@ -103,6 +111,13 @@ declare module 'chargebee' {
|
|
|
103
111
|
billing_cycles?: number;
|
|
104
112
|
service_period_days?: number;
|
|
105
113
|
metered_quantity?: string;
|
|
114
|
+
charge_once?: boolean;
|
|
115
|
+
charge_on_option?: 'immediately' | 'on_event';
|
|
116
|
+
charge_on_event?:
|
|
117
|
+
| 'subscription_trial_start'
|
|
118
|
+
| 'plan_activation'
|
|
119
|
+
| 'subscription_activation'
|
|
120
|
+
| 'contract_termination';
|
|
106
121
|
}
|
|
107
122
|
export interface CouponsToAdd {
|
|
108
123
|
coupon_id: string;
|
|
@@ -134,6 +149,11 @@ declare module 'chargebee' {
|
|
|
134
149
|
package_size?: number;
|
|
135
150
|
index: number;
|
|
136
151
|
}
|
|
152
|
+
export interface ContractTerm {
|
|
153
|
+
cancellation_cutoff_period?: number;
|
|
154
|
+
renewal_billing_cycles?: number;
|
|
155
|
+
action_at_term_end: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
156
|
+
}
|
|
137
157
|
export interface StatusTransitionReason {
|
|
138
158
|
code?: string;
|
|
139
159
|
message?: string;
|
|
@@ -147,6 +167,7 @@ declare module 'chargebee' {
|
|
|
147
167
|
coupons_to_remove?: string[];
|
|
148
168
|
discounts_to_remove?: string[];
|
|
149
169
|
items_to_remove?: string[];
|
|
170
|
+
contract_term?: ContractTermCreateForSubscriptionInputParam;
|
|
150
171
|
items_to_add?: ItemsToAddCreateForSubscriptionInputParam[];
|
|
151
172
|
items_to_update?: ItemsToUpdateCreateForSubscriptionInputParam[];
|
|
152
173
|
item_tiers?: ItemTiersCreateForSubscriptionInputParam[];
|
|
@@ -159,6 +180,7 @@ declare module 'chargebee' {
|
|
|
159
180
|
coupons_to_remove?: string[];
|
|
160
181
|
discounts_to_remove?: string[];
|
|
161
182
|
items_to_remove?: string[];
|
|
183
|
+
contract_term?: ContractTermUpdateInputParam;
|
|
162
184
|
items_to_add?: ItemsToAddUpdateInputParam[];
|
|
163
185
|
items_to_update?: ItemsToUpdateUpdateInputParam[];
|
|
164
186
|
item_tiers?: ItemTiersUpdateInputParam[];
|
|
@@ -176,6 +198,12 @@ declare module 'chargebee' {
|
|
|
176
198
|
'sort_by[asc]'?: string;
|
|
177
199
|
'sort_by[desc]'?: string;
|
|
178
200
|
}
|
|
201
|
+
export interface ContractTermCreateForSubscriptionInputParam {
|
|
202
|
+
action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
203
|
+
cancellation_cutoff_period?: number;
|
|
204
|
+
renewal_billing_cycles?: number;
|
|
205
|
+
}
|
|
206
|
+
|
|
179
207
|
export interface ItemsToAddCreateForSubscriptionInputParam {
|
|
180
208
|
item_price_id: string;
|
|
181
209
|
quantity?: number;
|
|
@@ -184,6 +212,9 @@ declare module 'chargebee' {
|
|
|
184
212
|
unit_price_in_decimal?: string;
|
|
185
213
|
billing_cycles?: number;
|
|
186
214
|
service_period_days?: number;
|
|
215
|
+
charge_on_event?: ChargeOnEventEnum;
|
|
216
|
+
charge_once?: boolean;
|
|
217
|
+
charge_on_option?: ChargeOnOptionEnum;
|
|
187
218
|
}
|
|
188
219
|
export interface CouponsToAddCreateForSubscriptionInputParam {
|
|
189
220
|
coupon_id?: string;
|
|
@@ -208,6 +239,9 @@ declare module 'chargebee' {
|
|
|
208
239
|
unit_price_in_decimal?: string;
|
|
209
240
|
billing_cycles?: number;
|
|
210
241
|
service_period_days?: number;
|
|
242
|
+
charge_on_event?: ChargeOnEventEnum;
|
|
243
|
+
charge_once?: boolean;
|
|
244
|
+
charge_on_option?: ChargeOnOptionEnum;
|
|
211
245
|
}
|
|
212
246
|
export interface DiscountsToAddCreateForSubscriptionInputParam {
|
|
213
247
|
apply_on: ApplyOnEnum;
|
|
@@ -219,6 +253,12 @@ declare module 'chargebee' {
|
|
|
219
253
|
included_in_mrr?: boolean;
|
|
220
254
|
item_price_id?: string;
|
|
221
255
|
}
|
|
256
|
+
export interface ContractTermUpdateInputParam {
|
|
257
|
+
action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
258
|
+
cancellation_cutoff_period?: number;
|
|
259
|
+
renewal_billing_cycles?: number;
|
|
260
|
+
}
|
|
261
|
+
|
|
222
262
|
export interface ItemsToAddUpdateInputParam {
|
|
223
263
|
item_price_id: string;
|
|
224
264
|
quantity?: number;
|
|
@@ -227,6 +267,9 @@ declare module 'chargebee' {
|
|
|
227
267
|
unit_price_in_decimal?: string;
|
|
228
268
|
billing_cycles?: number;
|
|
229
269
|
service_period_days?: number;
|
|
270
|
+
charge_on_event?: ChargeOnEventEnum;
|
|
271
|
+
charge_once?: boolean;
|
|
272
|
+
charge_on_option?: ChargeOnOptionEnum;
|
|
230
273
|
}
|
|
231
274
|
export interface CouponsToAddUpdateInputParam {
|
|
232
275
|
coupon_id?: string;
|
|
@@ -251,6 +294,9 @@ declare module 'chargebee' {
|
|
|
251
294
|
unit_price_in_decimal?: string;
|
|
252
295
|
billing_cycles?: number;
|
|
253
296
|
service_period_days?: number;
|
|
297
|
+
charge_on_event?: ChargeOnEventEnum;
|
|
298
|
+
charge_once?: boolean;
|
|
299
|
+
charge_on_option?: ChargeOnOptionEnum;
|
|
254
300
|
}
|
|
255
301
|
export interface DiscountsToAddUpdateInputParam {
|
|
256
302
|
apply_on: ApplyOnEnum;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface SalesOrder {
|
|
6
|
+
id: string;
|
|
7
|
+
version: number;
|
|
8
|
+
renewed_from_order_id?: string;
|
|
9
|
+
updated_at?: number;
|
|
10
|
+
created_at: number;
|
|
11
|
+
po_number?: string;
|
|
12
|
+
meta_data?: string;
|
|
13
|
+
quote_id?: string;
|
|
14
|
+
effective_date: number;
|
|
15
|
+
end_date?: number;
|
|
16
|
+
business_entity_id?: string;
|
|
17
|
+
customer_id: string;
|
|
18
|
+
subscription_id: string;
|
|
19
|
+
currency_code: string;
|
|
20
|
+
line_items?: SalesOrder.LineItem[];
|
|
21
|
+
billing_addresses?: SalesOrder.BillingAddress[];
|
|
22
|
+
discounts?: SalesOrder.Discount[];
|
|
23
|
+
shipping_addresses?: SalesOrder.ShippingAddress[];
|
|
24
|
+
subscription_ids?: string[];
|
|
25
|
+
line_item_tiers?: SalesOrder.LineItemTier[];
|
|
26
|
+
payment_configuration?: SalesOrder.PaymentConfiguration;
|
|
27
|
+
billing_configuration?: SalesOrder.BillingConfiguration;
|
|
28
|
+
renewal_term?: SalesOrder.RenewalTerm;
|
|
29
|
+
status: 'active' | 'completed';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export namespace SalesOrder {
|
|
33
|
+
export interface LineItem {
|
|
34
|
+
id: string;
|
|
35
|
+
association_id?: string;
|
|
36
|
+
item_price_id: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
quantity: string;
|
|
39
|
+
unit_price: string;
|
|
40
|
+
billing_period?: number;
|
|
41
|
+
billing_period_unit?: 'day' | 'week' | 'month' | 'year';
|
|
42
|
+
service_period_days?: number;
|
|
43
|
+
charge_on_event?:
|
|
44
|
+
| 'subscription_creation'
|
|
45
|
+
| 'subscription_trial_start'
|
|
46
|
+
| 'plan_activation'
|
|
47
|
+
| 'subscription_activation'
|
|
48
|
+
| 'contract_termination';
|
|
49
|
+
charge_once?: boolean;
|
|
50
|
+
billing_cycles?: number;
|
|
51
|
+
billing_type: 'recurring' | 'one_time' | 'event_based';
|
|
52
|
+
start_date: number;
|
|
53
|
+
end_date?: number;
|
|
54
|
+
trial_end?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface BillingAddress {
|
|
57
|
+
first_name?: string;
|
|
58
|
+
last_name?: string;
|
|
59
|
+
email?: string;
|
|
60
|
+
company?: string;
|
|
61
|
+
phone?: string;
|
|
62
|
+
line1?: string;
|
|
63
|
+
line2?: string;
|
|
64
|
+
line3?: string;
|
|
65
|
+
city?: string;
|
|
66
|
+
state_code?: string;
|
|
67
|
+
state?: string;
|
|
68
|
+
country?: string;
|
|
69
|
+
zip?: string;
|
|
70
|
+
validation_status?:
|
|
71
|
+
| 'not_validated'
|
|
72
|
+
| 'valid'
|
|
73
|
+
| 'partially_valid'
|
|
74
|
+
| 'invalid';
|
|
75
|
+
}
|
|
76
|
+
export interface Discount {
|
|
77
|
+
id: string;
|
|
78
|
+
invoice_name?: string;
|
|
79
|
+
type: 'fixed_amount' | 'percentage';
|
|
80
|
+
apply_on: 'invoice_amount' | 'specific_item_price';
|
|
81
|
+
duration_type: 'one_time' | 'forever' | 'limited_period';
|
|
82
|
+
percentage?: number;
|
|
83
|
+
amount?: string;
|
|
84
|
+
coupon_id?: string;
|
|
85
|
+
period?: number;
|
|
86
|
+
period_unit?: 'day' | 'week' | 'month' | 'year';
|
|
87
|
+
item_price_id?: string;
|
|
88
|
+
start_date: number;
|
|
89
|
+
end_date?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface ShippingAddress {
|
|
92
|
+
first_name?: string;
|
|
93
|
+
last_name?: string;
|
|
94
|
+
email?: string;
|
|
95
|
+
company?: string;
|
|
96
|
+
phone?: string;
|
|
97
|
+
line1?: string;
|
|
98
|
+
line2?: string;
|
|
99
|
+
line3?: string;
|
|
100
|
+
city?: string;
|
|
101
|
+
state_code?: string;
|
|
102
|
+
state?: string;
|
|
103
|
+
country?: string;
|
|
104
|
+
zip?: string;
|
|
105
|
+
validation_status?:
|
|
106
|
+
| 'not_validated'
|
|
107
|
+
| 'valid'
|
|
108
|
+
| 'partially_valid'
|
|
109
|
+
| 'invalid';
|
|
110
|
+
}
|
|
111
|
+
export interface LineItemTier {
|
|
112
|
+
starting_unit: string;
|
|
113
|
+
ending_unit?: string;
|
|
114
|
+
price: string;
|
|
115
|
+
pricing_type?: 'per_unit' | 'flat_fee' | 'package';
|
|
116
|
+
package_size?: number;
|
|
117
|
+
line_item_association_id?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface PaymentConfiguration {
|
|
120
|
+
auto_collection?: AutoCollectionEnum;
|
|
121
|
+
payment_source_id?: string;
|
|
122
|
+
payment_intent_id?: string;
|
|
123
|
+
offline_payment_method?: OfflinePaymentMethodEnum;
|
|
124
|
+
}
|
|
125
|
+
export interface BillingConfiguration {
|
|
126
|
+
create_pending_invoices?: boolean;
|
|
127
|
+
invoice_immediately?: boolean;
|
|
128
|
+
first_invoice_pending?: boolean;
|
|
129
|
+
invoice_usages?: boolean;
|
|
130
|
+
net_term_days?: number;
|
|
131
|
+
invoice_date?: number;
|
|
132
|
+
billing_cycles_to_invoice?: number;
|
|
133
|
+
billing_alignment_mode?: BillingAlignmentModeEnum;
|
|
134
|
+
}
|
|
135
|
+
export interface RenewalTerm {
|
|
136
|
+
end_of_term_action: 'renew' | 'cancel' | 'evergreen';
|
|
137
|
+
cancellation_cutoff_period?: number;
|
|
138
|
+
renewal_billing_cycles?: number;
|
|
139
|
+
}
|
|
140
|
+
// REQUEST PARAMS
|
|
141
|
+
//---------------
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -650,7 +650,6 @@ declare module 'chargebee' {
|
|
|
650
650
|
country?: string;
|
|
651
651
|
zip?: string;
|
|
652
652
|
validation_status?: ValidationStatusEnum;
|
|
653
|
-
index: number;
|
|
654
653
|
}
|
|
655
654
|
export interface ReferralInfo {
|
|
656
655
|
referral_code?: string;
|
|
@@ -825,6 +824,7 @@ declare module 'chargebee' {
|
|
|
825
824
|
auto_collection?: AutoCollectionEnum;
|
|
826
825
|
terms_to_charge?: number;
|
|
827
826
|
billing_alignment_mode?: BillingAlignmentModeEnum;
|
|
827
|
+
offline_payment_method?: OfflinePaymentMethodEnum;
|
|
828
828
|
po_number?: string;
|
|
829
829
|
coupon_ids?: string[];
|
|
830
830
|
payment_source_id?: string;
|
|
@@ -0,0 +1,116 @@
|
|
|
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 Variant {
|
|
6
|
+
id?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
external_name?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
sku?: string;
|
|
11
|
+
deleted: boolean;
|
|
12
|
+
product_id: string;
|
|
13
|
+
status?: 'active' | 'inactive';
|
|
14
|
+
created_at: number;
|
|
15
|
+
resource_version?: number;
|
|
16
|
+
updated_at?: number;
|
|
17
|
+
option_values?: Variant.OptionValue[];
|
|
18
|
+
metadata?: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export namespace Variant {
|
|
22
|
+
export class VariantResource {
|
|
23
|
+
createProductVariant(
|
|
24
|
+
product_id: string,
|
|
25
|
+
input: CreateProductVariantInputParam,
|
|
26
|
+
headers?: ChargebeeRequestHeader,
|
|
27
|
+
): Promise<ChargebeeResponse<CreateProductVariantResponse>>;
|
|
28
|
+
|
|
29
|
+
retrieve(
|
|
30
|
+
product_variant_id: string,
|
|
31
|
+
headers?: ChargebeeRequestHeader,
|
|
32
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
33
|
+
|
|
34
|
+
update(
|
|
35
|
+
product_variant_id: string,
|
|
36
|
+
input?: UpdateInputParam,
|
|
37
|
+
headers?: ChargebeeRequestHeader,
|
|
38
|
+
): Promise<ChargebeeResponse<UpdateResponse>>;
|
|
39
|
+
|
|
40
|
+
delete(
|
|
41
|
+
product_variant_id: string,
|
|
42
|
+
headers?: ChargebeeRequestHeader,
|
|
43
|
+
): Promise<ChargebeeResponse<DeleteResponse>>;
|
|
44
|
+
|
|
45
|
+
listProductVariants(
|
|
46
|
+
product_id: string,
|
|
47
|
+
input?: ListProductVariantsInputParam,
|
|
48
|
+
headers?: ChargebeeRequestHeader,
|
|
49
|
+
): Promise<ChargebeeResponse<ListProductVariantsResponse>>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CreateProductVariantResponse {
|
|
53
|
+
variant: Variant;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface RetrieveResponse {
|
|
57
|
+
variant: Variant;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface UpdateResponse {
|
|
61
|
+
variant: Variant;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface DeleteResponse {
|
|
65
|
+
variant: Variant;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ListProductVariantsResponse {
|
|
69
|
+
list: { variant: Variant }[];
|
|
70
|
+
next_offset?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface OptionValue {
|
|
74
|
+
name?: string;
|
|
75
|
+
value?: string;
|
|
76
|
+
}
|
|
77
|
+
// REQUEST PARAMS
|
|
78
|
+
//---------------
|
|
79
|
+
|
|
80
|
+
export interface CreateProductVariantInputParam {
|
|
81
|
+
id?: string;
|
|
82
|
+
name: string;
|
|
83
|
+
external_name?: string;
|
|
84
|
+
description?: string;
|
|
85
|
+
sku?: string;
|
|
86
|
+
metadata?: any;
|
|
87
|
+
status?: 'active' | 'inactive';
|
|
88
|
+
option_values?: OptionValuesCreateProductVariantInputParam[];
|
|
89
|
+
}
|
|
90
|
+
export interface UpdateInputParam {
|
|
91
|
+
name?: string;
|
|
92
|
+
description?: string;
|
|
93
|
+
status?: 'active' | 'inactive';
|
|
94
|
+
external_name?: string;
|
|
95
|
+
sku?: string;
|
|
96
|
+
metadata?: any;
|
|
97
|
+
}
|
|
98
|
+
export interface ListProductVariantsInputParam {
|
|
99
|
+
limit?: number;
|
|
100
|
+
offset?: string;
|
|
101
|
+
include_deleted?: boolean;
|
|
102
|
+
id?: filter.String;
|
|
103
|
+
name?: filter.String;
|
|
104
|
+
sku?: filter.String;
|
|
105
|
+
status?: filter.Enum;
|
|
106
|
+
updated_at?: filter.Timestamp;
|
|
107
|
+
created_at?: filter.Timestamp;
|
|
108
|
+
'sort_by[asc]'?: string;
|
|
109
|
+
'sort_by[desc]'?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface OptionValuesCreateProductVariantInputParam {
|
|
112
|
+
name: string;
|
|
113
|
+
value: string;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|