chargebee 3.0.0-beta.3 → 3.0.0-beta.4
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 +28 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +1 -0
- package/cjs/util.js +1 -1
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +1 -0
- package/esm/util.js +1 -1
- package/package.json +2 -2
- package/types/core.d.ts +6 -3
- package/types/index.d.ts +1 -0
- package/types/resources/Card.d.ts +2 -0
- package/types/resources/Coupon.d.ts +5 -5
- package/types/resources/Estimate.d.ts +16 -0
- package/types/resources/ItemPrice.d.ts +3 -0
- package/types/resources/PaymentScheduleEstimate.d.ts +25 -0
- package/types/resources/PaymentScheduleScheme.d.ts +1 -0
- package/types/resources/PaymentSource.d.ts +5 -1
- package/types/resources/PricingPageSession.d.ts +25 -0
- package/types/resources/Quote.d.ts +1 -0
- package/types/resources/QuotedSubscription.d.ts +3 -0
- package/types/resources/Subscription.d.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
### v3.0.0-beta.4 (2024-10-18)
|
|
2
|
+
|
|
3
|
+
#### New Resource:
|
|
4
|
+
* PaymentScheduleEstimate has been added.
|
|
5
|
+
|
|
6
|
+
### New Attributes:
|
|
7
|
+
* payment_schedule_estimates has been added to Estimate.
|
|
8
|
+
* usage_accumulation_reset_frequency has been added to ItemPrice.
|
|
9
|
+
* name has been added to PaymentScheduleScheme.
|
|
10
|
+
* usage_accumulation_reset_frequency has been added to QuotedSubscription#SubscriptionItem.
|
|
11
|
+
* usage_accumulation_reset_frequency has been added to Subscription#SubscriptionItem.
|
|
12
|
+
|
|
13
|
+
### New Endpoints:
|
|
14
|
+
* Estimate#PaymentSchedule has been added.
|
|
15
|
+
|
|
16
|
+
### New Input Params:
|
|
17
|
+
* usage_accumulation_reset_frequency has been added to ItemPrice#CreateParams.
|
|
18
|
+
* usage_accumulation_reset_frequency has been added to ItemPrice#UpdateParams.
|
|
19
|
+
* discounts has been added to PricingPageSession#CreateForNewSubscriptionParams.
|
|
20
|
+
* discounts has been added to PricingPageSession#CreateForExistingSubscriptionParams.
|
|
21
|
+
* invoice_immediately has been added to Quote#ConvertParams.
|
|
22
|
+
|
|
23
|
+
### Bug Fixes:
|
|
24
|
+
* metadata field not working bug fixed.
|
|
25
|
+
|
|
26
|
+
### Dependency
|
|
27
|
+
* moved @types/node to devDependencies.
|
|
28
|
+
|
|
1
29
|
### v3.0.0-beta.3 (2024-09-20)
|
|
2
30
|
* * *
|
|
3
31
|
|
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.0.0-beta.
|
|
14
|
+
clientVersion: 'v3.0.0-beta.4',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
package/cjs/util.js
CHANGED
|
@@ -194,7 +194,7 @@ function encodeParams(paramObj, serialized, scope, index) {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
else if (key === 'meta_data') {
|
|
197
|
+
else if (key === 'meta_data' || key === "metadata") {
|
|
198
198
|
let attrVal = '';
|
|
199
199
|
if (value !== null) {
|
|
200
200
|
attrVal = encodeURIComponent(Object.prototype.toString.call(value) === '[object String]'
|
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.0.0-beta.
|
|
11
|
+
clientVersion: 'v3.0.0-beta.4',
|
|
12
12
|
port: DEFAULT_PORT,
|
|
13
13
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
14
14
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
package/esm/util.js
CHANGED
|
@@ -178,7 +178,7 @@ export function encodeParams(paramObj, serialized, scope, index) {
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
else if (key === 'meta_data') {
|
|
181
|
+
else if (key === 'meta_data' || key === "metadata") {
|
|
182
182
|
let attrVal = '';
|
|
183
183
|
if (value !== null) {
|
|
184
184
|
attrVal = encodeURIComponent(Object.prototype.toString.call(value) === '[object String]'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chargebee",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
4
4
|
"description": "A library for integrating with Chargebee.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepack": "npm install && npm run build",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@types/node": "20.0.0"
|
|
37
36
|
},
|
|
38
37
|
"exports": {
|
|
39
38
|
"types": "./types/index.d.ts",
|
|
@@ -59,6 +58,7 @@
|
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
61
|
+
"@types/node": "20.0.0",
|
|
62
62
|
"prettier": "^3.3.3",
|
|
63
63
|
"typescript": "^5.5.4"
|
|
64
64
|
},
|
package/types/core.d.ts
CHANGED
|
@@ -294,9 +294,9 @@ declare module 'chargebee' {
|
|
|
294
294
|
| 'voucher_create_failed'
|
|
295
295
|
| 'item_price_entitlements_updated'
|
|
296
296
|
| 'item_price_entitlements_removed'
|
|
297
|
-
| '
|
|
298
|
-
| '
|
|
299
|
-
| '
|
|
297
|
+
| 'subscription_ramp_created'
|
|
298
|
+
| 'subscription_ramp_deleted'
|
|
299
|
+
| 'subscription_ramp_applied'
|
|
300
300
|
| 'subscription_ramp_drafted'
|
|
301
301
|
| 'subscription_ramp_updated'
|
|
302
302
|
| 'price_variant_created'
|
|
@@ -551,6 +551,9 @@ declare module 'chargebee' {
|
|
|
551
551
|
type UnbilledChargesHandling = 'no_action' | 'invoice';
|
|
552
552
|
type UnbilledChargesOption = 'invoice' | 'delete';
|
|
553
553
|
type UnpaidInvoicesHandling = 'no_action' | 'schedule_payment_collection';
|
|
554
|
+
type UsageAccumulationResetFrequency =
|
|
555
|
+
| 'never'
|
|
556
|
+
| 'subscription_billing_frequency';
|
|
554
557
|
type ValidationStatus =
|
|
555
558
|
| 'not_validated'
|
|
556
559
|
| 'valid'
|
package/types/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
///<reference path='./resources/PaymentIntent.d.ts' />
|
|
46
46
|
///<reference path='./resources/PaymentReferenceNumber.d.ts' />
|
|
47
47
|
///<reference path='./resources/PaymentSchedule.d.ts' />
|
|
48
|
+
///<reference path='./resources/PaymentScheduleEstimate.d.ts' />
|
|
48
49
|
///<reference path='./resources/PaymentScheduleScheme.d.ts' />
|
|
49
50
|
///<reference path='./resources/PaymentSource.d.ts' />
|
|
50
51
|
///<reference path='./resources/PaymentVoucher.d.ts' />
|
|
@@ -7,7 +7,7 @@ declare module 'chargebee' {
|
|
|
7
7
|
id: string;
|
|
8
8
|
name: string;
|
|
9
9
|
invoice_name?: string;
|
|
10
|
-
discount_type: 'fixed_amount' | 'percentage';
|
|
10
|
+
discount_type: 'fixed_amount' | 'percentage' | 'offer_quantity';
|
|
11
11
|
discount_percentage?: number;
|
|
12
12
|
discount_amount?: number;
|
|
13
13
|
discount_quantity?: number;
|
|
@@ -152,7 +152,7 @@ declare module 'chargebee' {
|
|
|
152
152
|
id: string;
|
|
153
153
|
name: string;
|
|
154
154
|
invoice_name?: string;
|
|
155
|
-
discount_type?: 'fixed_amount' | 'percentage';
|
|
155
|
+
discount_type?: 'fixed_amount' | 'percentage' | 'offer_quantity';
|
|
156
156
|
discount_amount?: number;
|
|
157
157
|
currency_code?: string;
|
|
158
158
|
discount_percentage?: number /**
|
|
@@ -180,7 +180,7 @@ declare module 'chargebee' {
|
|
|
180
180
|
id: string;
|
|
181
181
|
name: string;
|
|
182
182
|
invoice_name?: string;
|
|
183
|
-
discount_type?: 'fixed_amount' | 'percentage';
|
|
183
|
+
discount_type?: 'fixed_amount' | 'percentage' | 'offer_quantity';
|
|
184
184
|
discount_amount?: number;
|
|
185
185
|
currency_code?: string;
|
|
186
186
|
discount_percentage?: number /**
|
|
@@ -207,7 +207,7 @@ declare module 'chargebee' {
|
|
|
207
207
|
export interface UpdateForItemsInputParam {
|
|
208
208
|
name?: string;
|
|
209
209
|
invoice_name?: string;
|
|
210
|
-
discount_type?: 'fixed_amount' | 'percentage';
|
|
210
|
+
discount_type?: 'fixed_amount' | 'percentage' | 'offer_quantity';
|
|
211
211
|
discount_amount?: number;
|
|
212
212
|
currency_code?: string;
|
|
213
213
|
discount_percentage?: number /**
|
|
@@ -249,7 +249,7 @@ declare module 'chargebee' {
|
|
|
249
249
|
export interface UpdateInputParam {
|
|
250
250
|
name?: string;
|
|
251
251
|
invoice_name?: string;
|
|
252
|
-
discount_type?: 'fixed_amount' | 'percentage';
|
|
252
|
+
discount_type?: 'fixed_amount' | 'percentage' | 'offer_quantity';
|
|
253
253
|
discount_amount?: number;
|
|
254
254
|
currency_code?: string;
|
|
255
255
|
discount_percentage?: number /**
|
|
@@ -8,6 +8,7 @@ declare module 'chargebee' {
|
|
|
8
8
|
subscription_estimates?: SubscriptionEstimate[];
|
|
9
9
|
invoice_estimate?: InvoiceEstimate;
|
|
10
10
|
invoice_estimates?: InvoiceEstimate[];
|
|
11
|
+
payment_schedule_estimates?: PaymentScheduleEstimate[];
|
|
11
12
|
next_invoice_estimate?: InvoiceEstimate;
|
|
12
13
|
credit_note_estimates?: CreditNoteEstimate[];
|
|
13
14
|
unbilled_charge_estimates?: UnbilledCharge[];
|
|
@@ -119,6 +120,11 @@ declare module 'chargebee' {
|
|
|
119
120
|
input: CreateInvoiceForItemsInputParam,
|
|
120
121
|
headers?: ChargebeeRequestHeader,
|
|
121
122
|
): Promise<ChargebeeResponse<CreateInvoiceForItemsResponse>>;
|
|
123
|
+
|
|
124
|
+
paymentSchedules(
|
|
125
|
+
input: PaymentSchedulesInputParam,
|
|
126
|
+
headers?: ChargebeeRequestHeader,
|
|
127
|
+
): Promise<ChargebeeResponse<PaymentSchedulesResponse>>;
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
export interface CreateSubscriptionResponse {
|
|
@@ -197,6 +203,10 @@ declare module 'chargebee' {
|
|
|
197
203
|
estimate: Estimate;
|
|
198
204
|
}
|
|
199
205
|
|
|
206
|
+
export interface PaymentSchedulesResponse {
|
|
207
|
+
estimate: Estimate;
|
|
208
|
+
}
|
|
209
|
+
|
|
200
210
|
// REQUEST PARAMS
|
|
201
211
|
//---------------
|
|
202
212
|
|
|
@@ -444,6 +454,12 @@ declare module 'chargebee' {
|
|
|
444
454
|
discounts?: DiscountsCreateInvoiceForItemsInputParam[];
|
|
445
455
|
tax_providers_fields?: TaxProvidersFieldsCreateInvoiceForItemsInputParam[];
|
|
446
456
|
}
|
|
457
|
+
export interface PaymentSchedulesInputParam {
|
|
458
|
+
scheme_id: string;
|
|
459
|
+
amount?: number;
|
|
460
|
+
invoice_id?: string;
|
|
461
|
+
payment_schedule_start_date?: number;
|
|
462
|
+
}
|
|
447
463
|
export interface BillingAddressCreateSubscriptionInputParam {
|
|
448
464
|
line1?: string;
|
|
449
465
|
line2?: string;
|
|
@@ -34,6 +34,7 @@ declare module 'chargebee' {
|
|
|
34
34
|
resource_version?: number;
|
|
35
35
|
updated_at?: number;
|
|
36
36
|
created_at: number;
|
|
37
|
+
usage_accumulation_reset_frequency?: UsageAccumulationResetFrequency;
|
|
37
38
|
archived_at?: number;
|
|
38
39
|
invoice_notes?: string;
|
|
39
40
|
tiers?: ItemPrice.Tier[];
|
|
@@ -170,6 +171,7 @@ declare module 'chargebee' {
|
|
|
170
171
|
metadata?: any;
|
|
171
172
|
show_description_in_invoices?: boolean;
|
|
172
173
|
show_description_in_quotes?: boolean;
|
|
174
|
+
usage_accumulation_reset_frequency?: UsageAccumulationResetFrequency;
|
|
173
175
|
pricing_model?: PricingModel;
|
|
174
176
|
price?: number;
|
|
175
177
|
price_in_decimal?: string;
|
|
@@ -197,6 +199,7 @@ declare module 'chargebee' {
|
|
|
197
199
|
price_variant_id?: string;
|
|
198
200
|
status?: 'active' | 'archived';
|
|
199
201
|
external_name?: string;
|
|
202
|
+
usage_accumulation_reset_frequency?: UsageAccumulationResetFrequency;
|
|
200
203
|
currency_code?: string;
|
|
201
204
|
invoice_notes?: string;
|
|
202
205
|
is_taxable?: boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface PaymentScheduleEstimate {
|
|
6
|
+
id: string;
|
|
7
|
+
scheme_id: string;
|
|
8
|
+
entity_type: 'invoice';
|
|
9
|
+
entity_id?: string;
|
|
10
|
+
amount: number;
|
|
11
|
+
currency_code?: string;
|
|
12
|
+
schedule_entries?: PaymentScheduleEstimate.ScheduleEntry[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export namespace PaymentScheduleEstimate {
|
|
16
|
+
export interface ScheduleEntry {
|
|
17
|
+
id: string;
|
|
18
|
+
date: number;
|
|
19
|
+
amount: number;
|
|
20
|
+
status: 'posted' | 'payment_due' | 'paid';
|
|
21
|
+
}
|
|
22
|
+
// REQUEST PARAMS
|
|
23
|
+
//---------------
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -224,6 +224,8 @@ declare module 'chargebee' {
|
|
|
224
224
|
| 'carnet'
|
|
225
225
|
| 'rupay'
|
|
226
226
|
| 'maestro'
|
|
227
|
+
| 'dankort'
|
|
228
|
+
| 'cartes_bancaires'
|
|
227
229
|
| 'not_applicable';
|
|
228
230
|
funding_type:
|
|
229
231
|
| 'credit'
|
|
@@ -419,7 +421,9 @@ declare module 'chargebee' {
|
|
|
419
421
|
| 'hipercard'
|
|
420
422
|
| 'carnet'
|
|
421
423
|
| 'rupay'
|
|
422
|
-
| 'maestro'
|
|
424
|
+
| 'maestro'
|
|
425
|
+
| 'dankort'
|
|
426
|
+
| 'cartes_bancaires';
|
|
423
427
|
funding_type?: 'credit' | 'debit' | 'prepaid' | 'not_known';
|
|
424
428
|
}
|
|
425
429
|
|
|
@@ -41,11 +41,13 @@ declare module 'chargebee' {
|
|
|
41
41
|
customer?: CustomerCreateForNewSubscriptionInputParam;
|
|
42
42
|
billing_address?: BillingAddressCreateForNewSubscriptionInputParam;
|
|
43
43
|
shipping_address?: ShippingAddressCreateForNewSubscriptionInputParam;
|
|
44
|
+
discounts?: DiscountsCreateForNewSubscriptionInputParam[];
|
|
44
45
|
}
|
|
45
46
|
export interface CreateForExistingSubscriptionInputParam {
|
|
46
47
|
redirect_url?: string;
|
|
47
48
|
pricing_page?: PricingPageCreateForExistingSubscriptionInputParam;
|
|
48
49
|
subscription?: SubscriptionCreateForExistingSubscriptionInputParam;
|
|
50
|
+
discounts?: DiscountsCreateForExistingSubscriptionInputParam[];
|
|
49
51
|
}
|
|
50
52
|
export interface BillingAddressCreateForNewSubscriptionInputParam {
|
|
51
53
|
first_name?: string;
|
|
@@ -95,11 +97,34 @@ declare module 'chargebee' {
|
|
|
95
97
|
id?: string;
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
export interface DiscountsCreateForNewSubscriptionInputParam {
|
|
101
|
+
apply_on: ApplyOn;
|
|
102
|
+
duration_type: DurationType;
|
|
103
|
+
percentage?: number;
|
|
104
|
+
amount?: number;
|
|
105
|
+
period?: number;
|
|
106
|
+
period_unit?: PeriodUnit;
|
|
107
|
+
included_in_mrr?: boolean;
|
|
108
|
+
item_price_id?: string;
|
|
109
|
+
label?: string;
|
|
110
|
+
}
|
|
98
111
|
export interface PricingPageCreateForExistingSubscriptionInputParam {
|
|
99
112
|
id: string;
|
|
100
113
|
}
|
|
101
114
|
export interface SubscriptionCreateForExistingSubscriptionInputParam {
|
|
102
115
|
id: string;
|
|
103
116
|
}
|
|
117
|
+
|
|
118
|
+
export interface DiscountsCreateForExistingSubscriptionInputParam {
|
|
119
|
+
apply_on: ApplyOn;
|
|
120
|
+
duration_type: DurationType;
|
|
121
|
+
percentage?: number;
|
|
122
|
+
amount?: number;
|
|
123
|
+
period?: number;
|
|
124
|
+
period_unit?: PeriodUnit;
|
|
125
|
+
included_in_mrr?: boolean;
|
|
126
|
+
item_price_id?: string;
|
|
127
|
+
label?: string;
|
|
128
|
+
}
|
|
104
129
|
}
|
|
105
130
|
}
|
|
@@ -656,6 +656,7 @@ declare module 'chargebee' {
|
|
|
656
656
|
}
|
|
657
657
|
export interface ConvertInputParam {
|
|
658
658
|
invoice_date?: number;
|
|
659
|
+
invoice_immediately?: boolean;
|
|
659
660
|
create_pending_invoices?: boolean;
|
|
660
661
|
first_invoice_pending?: boolean;
|
|
661
662
|
subscription?: SubscriptionConvertInputParam;
|
|
@@ -86,6 +86,9 @@ declare module 'chargebee' {
|
|
|
86
86
|
charge_once?: boolean;
|
|
87
87
|
charge_on_option?: 'immediately' | 'on_event';
|
|
88
88
|
proration_type?: 'full_term' | 'partial_term' | 'none';
|
|
89
|
+
usage_accumulation_reset_frequency?:
|
|
90
|
+
| 'never'
|
|
91
|
+
| 'subscription_billing_frequency';
|
|
89
92
|
}
|
|
90
93
|
export interface ItemTier {
|
|
91
94
|
item_price_id: string;
|
|
@@ -575,6 +575,9 @@ declare module 'chargebee' {
|
|
|
575
575
|
charge_once?: boolean;
|
|
576
576
|
charge_on_option?: 'immediately' | 'on_event';
|
|
577
577
|
proration_type?: 'full_term' | 'partial_term' | 'none';
|
|
578
|
+
usage_accumulation_reset_frequency?:
|
|
579
|
+
| 'never'
|
|
580
|
+
| 'subscription_billing_frequency';
|
|
578
581
|
}
|
|
579
582
|
export interface ItemTier {
|
|
580
583
|
item_price_id: string;
|
|
@@ -1621,6 +1624,7 @@ declare module 'chargebee' {
|
|
|
1621
1624
|
*/
|
|
1622
1625
|
item_type?: ItemType;
|
|
1623
1626
|
charge_on_option?: ChargeOnOption;
|
|
1627
|
+
usage_accumulation_reset_frequency?: UsageAccumulationResetFrequency;
|
|
1624
1628
|
}
|
|
1625
1629
|
export interface DiscountsCreateWithItemsInputParam {
|
|
1626
1630
|
apply_on: ApplyOn;
|
|
@@ -1949,6 +1953,7 @@ declare module 'chargebee' {
|
|
|
1949
1953
|
*/
|
|
1950
1954
|
item_type?: ItemType;
|
|
1951
1955
|
proration_type?: ProrationType;
|
|
1956
|
+
usage_accumulation_reset_frequency?: UsageAccumulationResetFrequency;
|
|
1952
1957
|
}
|
|
1953
1958
|
export interface DiscountsUpdateForItemsInputParam {
|
|
1954
1959
|
apply_on: ApplyOn;
|