chargebee 3.4.0 → 3.6.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +149 -0
  2. package/README.md +6 -3
  3. package/cjs/environment.js +1 -1
  4. package/cjs/resources/api_endpoints.js +14 -1
  5. package/esm/environment.js +1 -1
  6. package/esm/resources/api_endpoints.js +14 -1
  7. package/package.json +1 -1
  8. package/types/core.d.ts +17 -5
  9. package/types/index.d.ts +6 -0
  10. package/types/resources/Addon.d.ts +283 -0
  11. package/types/resources/Comment.d.ts +2 -0
  12. package/types/resources/CreditNote.d.ts +26 -1
  13. package/types/resources/CreditNoteEstimate.d.ts +4 -1
  14. package/types/resources/DifferentialPrice.d.ts +6 -0
  15. package/types/resources/Estimate.d.ts +19 -0
  16. package/types/resources/HostedPage.d.ts +6 -0
  17. package/types/resources/Invoice.d.ts +33 -1
  18. package/types/resources/InvoiceEstimate.d.ts +26 -1
  19. package/types/resources/Item.d.ts +2 -0
  20. package/types/resources/ItemPrice.d.ts +6 -0
  21. package/types/resources/OmnichannelSubscription.d.ts +5 -5
  22. package/types/resources/OmnichannelSubscriptionItem.d.ts +38 -2
  23. package/types/resources/OmnichannelSubscriptionItemScheduledChange.d.ts +27 -0
  24. package/types/resources/OmnichannelTransaction.d.ts +4 -4
  25. package/types/resources/PaymentSource.d.ts +1 -0
  26. package/types/resources/Plan.d.ts +401 -0
  27. package/types/resources/Purchase.d.ts +33 -0
  28. package/types/resources/Quote.d.ts +22 -1
  29. package/types/resources/QuoteLineGroup.d.ts +2 -1
  30. package/types/resources/QuotedCharge.d.ts +2 -0
  31. package/types/resources/QuotedSubscription.d.ts +2 -0
  32. package/types/resources/Ramp.d.ts +6 -0
  33. package/types/resources/RecordedPurchase.d.ts +7 -1
  34. package/types/resources/Subscription.d.ts +8 -0
  35. package/types/resources/UnbilledCharge.d.ts +4 -0
@@ -80,6 +80,8 @@ declare module 'chargebee' {
80
80
  | 'omnichannel_subscription_item'
81
81
  | 'omnichannel_transaction'
82
82
  | 'recorded_purchase'
83
+ | 'omnichannel_subscription_item_scheduled_change'
84
+ | 'sales_order'
83
85
  | 'item_family'
84
86
  | 'item'
85
87
  | 'item_price'
@@ -61,6 +61,7 @@ declare module 'chargebee' {
61
61
  billing_address?: CreditNote.BillingAddress;
62
62
  site_details_at_creation?: CreditNote.SiteDetailsAtCreation;
63
63
  tax_origin?: CreditNote.TaxOrigin;
64
+ line_item_addresses?: CreditNote.LineItemAddress[];
64
65
  }
65
66
 
66
67
  export namespace CreditNote {
@@ -238,7 +239,8 @@ declare module 'chargebee' {
238
239
  amount_in_decimal?: string;
239
240
  discount_amount?: number;
240
241
  item_level_discount_amount?: number;
241
- usage_percentage?: string;
242
+ metered?: boolean;
243
+ percentage?: string;
242
244
  reference_line_item_id?: string;
243
245
  description: string;
244
246
  entity_description?: string;
@@ -301,6 +303,8 @@ declare module 'chargebee' {
301
303
  ending_unit_in_decimal?: string;
302
304
  quantity_used_in_decimal?: string;
303
305
  unit_amount_in_decimal?: string;
306
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
307
+ package_size?: number;
304
308
  }
305
309
  export interface Tax {
306
310
  name: string;
@@ -403,6 +407,27 @@ declare module 'chargebee' {
403
407
  country?: string;
404
408
  registration_number?: string;
405
409
  }
410
+ export interface LineItemAddress {
411
+ line_item_id?: string;
412
+ first_name?: string;
413
+ last_name?: string;
414
+ email?: string;
415
+ company?: string;
416
+ phone?: string;
417
+ line1?: string;
418
+ line2?: string;
419
+ line3?: string;
420
+ city?: string;
421
+ state_code?: string;
422
+ state?: string;
423
+ country?: string;
424
+ zip?: string;
425
+ validation_status?:
426
+ | 'not_validated'
427
+ | 'valid'
428
+ | 'partially_valid'
429
+ | 'invalid';
430
+ }
406
431
  // REQUEST PARAMS
407
432
  //---------------
408
433
 
@@ -44,7 +44,8 @@ declare module 'chargebee' {
44
44
  amount_in_decimal?: string;
45
45
  discount_amount?: number;
46
46
  item_level_discount_amount?: number;
47
- usage_percentage?: string;
47
+ metered?: boolean;
48
+ percentage?: string;
48
49
  reference_line_item_id?: string;
49
50
  description: string;
50
51
  entity_description?: string;
@@ -137,6 +138,8 @@ declare module 'chargebee' {
137
138
  ending_unit_in_decimal?: string;
138
139
  quantity_used_in_decimal?: string;
139
140
  unit_amount_in_decimal?: string;
141
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
142
+ package_size?: number;
140
143
  }
141
144
  // REQUEST PARAMS
142
145
  //---------------
@@ -80,6 +80,8 @@ declare module 'chargebee' {
80
80
  starting_unit_in_decimal?: string;
81
81
  ending_unit_in_decimal?: string;
82
82
  price_in_decimal?: string;
83
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
84
+ package_size?: number;
83
85
  }
84
86
  export interface ParentPeriod {
85
87
  period_unit: 'day' | 'week' | 'month' | 'year';
@@ -124,6 +126,8 @@ declare module 'chargebee' {
124
126
  starting_unit_in_decimal?: string;
125
127
  ending_unit_in_decimal?: string;
126
128
  price_in_decimal?: string;
129
+ pricing_type?: PricingTypeEnum;
130
+ package_size?: number;
127
131
  }
128
132
  export interface ParentPeriodsCreateInputParam {
129
133
  period_unit: 'day' | 'week' | 'month' | 'year';
@@ -136,6 +140,8 @@ declare module 'chargebee' {
136
140
  starting_unit_in_decimal?: string;
137
141
  ending_unit_in_decimal?: string;
138
142
  price_in_decimal?: string;
143
+ pricing_type?: PricingTypeEnum;
144
+ package_size?: number;
139
145
  }
140
146
  export interface ParentPeriodsUpdateInputParam {
141
147
  period_unit: 'day' | 'week' | 'month' | 'year';
@@ -447,6 +447,7 @@ declare module 'chargebee' {
447
447
  invoice_date?: number;
448
448
  invoice?: InvoiceCreateInvoiceForItemsInputParam;
449
449
  shipping_address?: ShippingAddressCreateInvoiceForItemsInputParam;
450
+ billing_address?: BillingAddressCreateInvoiceForItemsInputParam;
450
451
  item_prices?: ItemPricesCreateInvoiceForItemsInputParam[];
451
452
  item_tiers?: ItemTiersCreateInvoiceForItemsInputParam[];
452
453
  charges?: ChargesCreateInvoiceForItemsInputParam[];
@@ -631,6 +632,8 @@ declare module 'chargebee' {
631
632
  starting_unit_in_decimal?: string;
632
633
  ending_unit_in_decimal?: string;
633
634
  price_in_decimal?: string;
635
+ pricing_type?: PricingTypeEnum;
636
+ package_size?: number;
634
637
  }
635
638
  export interface TaxProvidersFieldsCreateSubItemEstimateInputParam {
636
639
  provider_name?: string;
@@ -765,6 +768,8 @@ declare module 'chargebee' {
765
768
  starting_unit_in_decimal?: string;
766
769
  ending_unit_in_decimal?: string;
767
770
  price_in_decimal?: string;
771
+ pricing_type?: PricingTypeEnum;
772
+ package_size?: number;
768
773
  }
769
774
  export interface BillingAddressUpdateSubscriptionInputParam {
770
775
  line1?: string;
@@ -923,6 +928,8 @@ declare module 'chargebee' {
923
928
  starting_unit_in_decimal?: string;
924
929
  ending_unit_in_decimal?: string;
925
930
  price_in_decimal?: string;
931
+ pricing_type?: PricingTypeEnum;
932
+ package_size?: number;
926
933
  }
927
934
  export interface FixedIntervalScheduleAdvanceInvoiceEstimateInputParam {
928
935
  number_of_occurrences?: number;
@@ -1163,6 +1170,16 @@ declare module 'chargebee' {
1163
1170
  entity_type?: EntityTypeEnum;
1164
1171
  entity_id?: string;
1165
1172
  }
1173
+ export interface BillingAddressCreateInvoiceForItemsInputParam {
1174
+ line1?: string;
1175
+ line2?: string;
1176
+ line3?: string;
1177
+ city?: string;
1178
+ state_code?: string;
1179
+ zip?: string;
1180
+ country?: string;
1181
+ validation_status?: ValidationStatusEnum;
1182
+ }
1166
1183
  export interface InvoiceCreateInvoiceForItemsInputParam {
1167
1184
  customer_id?: string;
1168
1185
  subscription_id?: string;
@@ -1214,6 +1231,8 @@ declare module 'chargebee' {
1214
1231
  starting_unit_in_decimal?: string;
1215
1232
  ending_unit_in_decimal?: string;
1216
1233
  price_in_decimal?: string;
1234
+ pricing_type?: PricingTypeEnum;
1235
+ package_size?: number;
1217
1236
  }
1218
1237
  export interface ItemPricesCreateInvoiceForItemsInputParam {
1219
1238
  item_price_id?: string;
@@ -738,6 +738,8 @@ declare module 'chargebee' {
738
738
  starting_unit_in_decimal?: string;
739
739
  ending_unit_in_decimal?: string;
740
740
  price_in_decimal?: string;
741
+ pricing_type?: PricingTypeEnum;
742
+ package_size?: number;
741
743
  }
742
744
  export interface ItemPricesCheckoutOneTimeForItemsInputParam {
743
745
  item_price_id?: string;
@@ -864,6 +866,8 @@ declare module 'chargebee' {
864
866
  starting_unit_in_decimal?: string;
865
867
  ending_unit_in_decimal?: string;
866
868
  price_in_decimal?: string;
869
+ pricing_type?: PricingTypeEnum;
870
+ package_size?: number;
867
871
  }
868
872
  export interface CustomerCheckoutExistingInputParam {
869
873
  vat_number?: string;
@@ -999,6 +1003,8 @@ declare module 'chargebee' {
999
1003
  starting_unit_in_decimal?: string;
1000
1004
  ending_unit_in_decimal?: string;
1001
1005
  price_in_decimal?: string;
1006
+ pricing_type?: PricingTypeEnum;
1007
+ package_size?: number;
1002
1008
  }
1003
1009
  export interface CustomerUpdateCardInputParam {
1004
1010
  id: string;
@@ -76,6 +76,7 @@ declare module 'chargebee' {
76
76
  business_entity_id?: string;
77
77
  site_details_at_creation?: Invoice.SiteDetailsAtCreation;
78
78
  tax_origin?: Invoice.TaxOrigin;
79
+ line_item_addresses?: Invoice.LineItemAddress[];
79
80
  }
80
81
 
81
82
  export namespace Invoice {
@@ -484,7 +485,8 @@ declare module 'chargebee' {
484
485
  amount_in_decimal?: string;
485
486
  discount_amount?: number;
486
487
  item_level_discount_amount?: number;
487
- usage_percentage?: string;
488
+ metered?: boolean;
489
+ percentage?: string;
488
490
  reference_line_item_id?: string;
489
491
  description: string;
490
492
  entity_description?: string;
@@ -582,6 +584,8 @@ declare module 'chargebee' {
582
584
  ending_unit_in_decimal?: string;
583
585
  quantity_used_in_decimal?: string;
584
586
  unit_amount_in_decimal?: string;
587
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
588
+ package_size?: number;
585
589
  }
586
590
  export interface LinkedPayment {
587
591
  txn_id: string;
@@ -768,6 +772,27 @@ declare module 'chargebee' {
768
772
  country?: string;
769
773
  registration_number?: string;
770
774
  }
775
+ export interface LineItemAddress {
776
+ line_item_id?: string;
777
+ first_name?: string;
778
+ last_name?: string;
779
+ email?: string;
780
+ company?: string;
781
+ phone?: string;
782
+ line1?: string;
783
+ line2?: string;
784
+ line3?: string;
785
+ city?: string;
786
+ state_code?: string;
787
+ state?: string;
788
+ country?: string;
789
+ zip?: string;
790
+ validation_status?:
791
+ | 'not_validated'
792
+ | 'valid'
793
+ | 'partially_valid'
794
+ | 'invalid';
795
+ }
771
796
  // REQUEST PARAMS
772
797
  //---------------
773
798
 
@@ -1373,6 +1398,8 @@ declare module 'chargebee' {
1373
1398
  starting_unit_in_decimal?: string;
1374
1399
  ending_unit_in_decimal?: string;
1375
1400
  price_in_decimal?: string;
1401
+ pricing_type?: PricingTypeEnum;
1402
+ package_size?: number;
1376
1403
  }
1377
1404
  export interface ItemPricesCreateForChargeItemsAndChargesInputParam {
1378
1405
  item_price_id?: string;
@@ -1414,6 +1441,8 @@ declare module 'chargebee' {
1414
1441
  starting_unit_in_decimal?: string;
1415
1442
  ending_unit_in_decimal?: string;
1416
1443
  price_in_decimal?: string;
1444
+ pricing_type?: PricingTypeEnum;
1445
+ package_size?: number;
1417
1446
  }
1418
1447
  export interface BillingAddressImportInvoiceInputParam {
1419
1448
  first_name?: string;
@@ -1552,6 +1581,7 @@ declare module 'chargebee' {
1552
1581
  tax9_amount?: number;
1553
1582
  tax10_name?: string;
1554
1583
  tax10_amount?: number;
1584
+ created_at?: number;
1555
1585
  }
1556
1586
  export interface TransactionsApplyPaymentsInputParam {
1557
1587
  id?: string;
@@ -1598,6 +1628,8 @@ declare module 'chargebee' {
1598
1628
  starting_unit_in_decimal?: string;
1599
1629
  ending_unit_in_decimal?: string;
1600
1630
  price_in_decimal?: string;
1631
+ pricing_type?: PricingTypeEnum;
1632
+ package_size?: number;
1601
1633
  }
1602
1634
  export interface NotesToRemoveCloseInputParam {
1603
1635
  entity_type?: EntityTypeEnum;
@@ -20,6 +20,7 @@ declare module 'chargebee' {
20
20
  line_item_discounts?: InvoiceEstimate.LineItemDiscount[];
21
21
  round_off_amount?: number;
22
22
  customer_id?: string;
23
+ line_item_addresses?: InvoiceEstimate.LineItemAddress[];
23
24
  }
24
25
 
25
26
  export namespace InvoiceEstimate {
@@ -45,7 +46,8 @@ declare module 'chargebee' {
45
46
  amount_in_decimal?: string;
46
47
  discount_amount?: number;
47
48
  item_level_discount_amount?: number;
48
- usage_percentage?: string;
49
+ metered?: boolean;
50
+ percentage?: string;
49
51
  reference_line_item_id?: string;
50
52
  description: string;
51
53
  entity_description?: string;
@@ -125,6 +127,8 @@ declare module 'chargebee' {
125
127
  ending_unit_in_decimal?: string;
126
128
  quantity_used_in_decimal?: string;
127
129
  unit_amount_in_decimal?: string;
130
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
131
+ package_size?: number;
128
132
  }
129
133
  export interface LineItemCredit {
130
134
  cn_id: string;
@@ -144,6 +148,27 @@ declare module 'chargebee' {
144
148
  entity_id?: string;
145
149
  discount_amount: number;
146
150
  }
151
+ export interface LineItemAddress {
152
+ line_item_id?: string;
153
+ first_name?: string;
154
+ last_name?: string;
155
+ email?: string;
156
+ company?: string;
157
+ phone?: string;
158
+ line1?: string;
159
+ line2?: string;
160
+ line3?: string;
161
+ city?: string;
162
+ state_code?: string;
163
+ state?: string;
164
+ country?: string;
165
+ zip?: string;
166
+ validation_status?:
167
+ | 'not_validated'
168
+ | 'valid'
169
+ | 'partially_valid'
170
+ | 'invalid';
171
+ }
147
172
  // REQUEST PARAMS
148
173
  //---------------
149
174
  }
@@ -24,6 +24,7 @@ declare module 'chargebee' {
24
24
  unit?: string;
25
25
  metered: boolean;
26
26
  usage_calculation?: 'sum_of_usages' | 'last_usage' | 'max_usage';
27
+ is_percentage_pricing: boolean;
27
28
  archived_at?: number;
28
29
  channel?: ChannelEnum;
29
30
  applicable_items?: Item.ApplicableItem[];
@@ -120,6 +121,7 @@ declare module 'chargebee' {
120
121
  usage_calculation?: 'sum_of_usages' | 'last_usage' | 'max_usage';
121
122
  metadata?: any;
122
123
  business_entity_id?: string;
124
+ is_percentage_pricing?: boolean;
123
125
  bundle_configuration?: BundleConfigurationCreateInputParam;
124
126
  bundle_items_to_add?: BundleItemsToAddCreateInputParam[];
125
127
  [key: `cf_${string}`]: unknown;
@@ -131,6 +131,8 @@ declare module 'chargebee' {
131
131
  starting_unit_in_decimal?: string;
132
132
  ending_unit_in_decimal?: string;
133
133
  price_in_decimal?: string;
134
+ pricing_type?: 'per_unit' | 'flat_fee' | 'package';
135
+ package_size?: number;
134
136
  }
135
137
  export interface TaxDetail {
136
138
  tax_profile_id?: string;
@@ -292,6 +294,8 @@ declare module 'chargebee' {
292
294
  starting_unit_in_decimal?: string;
293
295
  ending_unit_in_decimal?: string;
294
296
  price_in_decimal?: string;
297
+ pricing_type?: PricingTypeEnum;
298
+ package_size?: number;
295
299
  }
296
300
  export interface TaxProvidersFieldsCreateInputParam {
297
301
  provider_name: string;
@@ -323,6 +327,8 @@ declare module 'chargebee' {
323
327
  starting_unit_in_decimal?: string;
324
328
  ending_unit_in_decimal?: string;
325
329
  price_in_decimal?: string;
330
+ pricing_type?: PricingTypeEnum;
331
+ package_size?: number;
326
332
  }
327
333
  export interface TaxProvidersFieldsUpdateInputParam {
328
334
  provider_name: string;
@@ -6,7 +6,7 @@ declare module 'chargebee' {
6
6
  id: string;
7
7
  id_at_source: string;
8
8
  app_id: string;
9
- source: 'apple_app_store';
9
+ source: 'apple_app_store' | 'google_play_store';
10
10
  customer_id?: string;
11
11
  created_at: number;
12
12
  resource_version?: number;
@@ -53,11 +53,11 @@ declare module 'chargebee' {
53
53
  id: string;
54
54
  id_at_source: string;
55
55
  app_id: string;
56
- price_currency: string;
57
- price_units: number;
58
- price_nanos: number;
56
+ price_currency?: string;
57
+ price_units?: number;
58
+ price_nanos?: number;
59
59
  type: 'purchase' | 'renewal';
60
- transacted_at: number;
60
+ transacted_at?: number;
61
61
  created_at: number;
62
62
  resource_version?: number;
63
63
  }
@@ -1,16 +1,18 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  ///<reference path='./../index.d.ts'/>
3
-
3
+ ///<reference path='./filter.d.ts'/>
4
4
  declare module 'chargebee' {
5
5
  export interface OmnichannelSubscriptionItem {
6
6
  id: string;
7
7
  item_id_at_source: string;
8
+ item_parent_id_at_source?: string;
8
9
  status:
9
10
  | 'active'
10
11
  | 'expired'
11
12
  | 'cancelled'
12
13
  | 'in_dunning'
13
14
  | 'in_grace_period';
15
+ auto_renew_status?: 'off' | 'on';
14
16
  current_term_start?: number;
15
17
  current_term_end?: number;
16
18
  expired_at?: number;
@@ -18,8 +20,42 @@ declare module 'chargebee' {
18
20
  cancelled_at?: number;
19
21
  cancellation_reason?:
20
22
  | 'customer_cancelled'
21
- | 'customer_did_not_consent_to_price_increase';
23
+ | 'customer_did_not_consent_to_price_increase'
24
+ | 'refunded_due_to_app_issue'
25
+ | 'refunded_for_other_reason';
22
26
  grace_period_expires_at?: number;
27
+ has_scheduled_changes: boolean;
23
28
  resource_version?: number;
29
+ upcoming_renewal?: OmnichannelSubscriptionItem.UpcomingRenewal;
30
+ }
31
+
32
+ export namespace OmnichannelSubscriptionItem {
33
+ export class OmnichannelSubscriptionItemResource {
34
+ listOmniSubItemScheduleChanges(
35
+ omnichannel_subscription_item_id: string,
36
+ input?: ListOmniSubItemScheduleChangesInputParam,
37
+ headers?: ChargebeeRequestHeader,
38
+ ): Promise<ChargebeeResponse<ListOmniSubItemScheduleChangesResponse>>;
39
+ }
40
+
41
+ export interface ListOmniSubItemScheduleChangesResponse {
42
+ list: {
43
+ omnichannel_subscription_item_scheduled_change: OmnichannelSubscriptionItemScheduledChange;
44
+ }[];
45
+ next_offset?: string;
46
+ }
47
+
48
+ export interface UpcomingRenewal {
49
+ price_currency?: string;
50
+ price_units?: number;
51
+ price_nanos?: number;
52
+ }
53
+ // REQUEST PARAMS
54
+ //---------------
55
+
56
+ export interface ListOmniSubItemScheduleChangesInputParam {
57
+ limit?: number;
58
+ offset?: string;
59
+ }
24
60
  }
25
61
  }
@@ -0,0 +1,27 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface OmnichannelSubscriptionItemScheduledChange {
6
+ id?: string;
7
+ omnichannel_subscription_item_id?: string;
8
+ scheduled_at: number;
9
+ change_type: 'downgrade';
10
+ created_at: number;
11
+ modified_at: number;
12
+ resource_version?: number;
13
+ current_state?: OmnichannelSubscriptionItemScheduledChange.CurrentState;
14
+ scheduled_state?: OmnichannelSubscriptionItemScheduledChange.ScheduledState;
15
+ }
16
+
17
+ export namespace OmnichannelSubscriptionItemScheduledChange {
18
+ export interface CurrentState {
19
+ item_id_at_source?: string;
20
+ }
21
+ export interface ScheduledState {
22
+ item_id_at_source?: string;
23
+ }
24
+ // REQUEST PARAMS
25
+ //---------------
26
+ }
27
+ }
@@ -6,11 +6,11 @@ declare module 'chargebee' {
6
6
  id: string;
7
7
  id_at_source: string;
8
8
  app_id: string;
9
- price_currency: string;
10
- price_units: number;
11
- price_nanos: number;
9
+ price_currency?: string;
10
+ price_units?: number;
11
+ price_nanos?: number;
12
12
  type: 'purchase' | 'renewal';
13
- transacted_at: number;
13
+ transacted_at?: number;
14
14
  created_at: number;
15
15
  resource_version?: number;
16
16
  }
@@ -370,6 +370,7 @@ declare module 'chargebee' {
370
370
  limit?: number;
371
371
  offset?: string;
372
372
  subscription_id?: string;
373
+ include_deleted?: boolean;
373
374
  customer_id?: filter.String;
374
375
  type?: filter.Enum;
375
376
  status?: filter.Enum;