chargebee 3.2.1 → 3.3.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 CHANGED
@@ -1,3 +1,43 @@
1
+ ### v3.3.0 (2024-12-19)
2
+ * * *
3
+
4
+ #### New Resource:
5
+ * Configuration has been added.
6
+
7
+ #### New Attribute:
8
+ * discount_type has been added to CreditNote#Discount.
9
+ * discount_type has been added to CreditNoteEstimate#Discount.
10
+ * discount_type has been added to Invoice#Discount.
11
+ * discount_type has been added to InvoiceEstimate#Discount.
12
+ * discount_type has been added to QuoteLineGroup#Discount.
13
+ * initial_purchase_transaction has been added to OmnichannelSubscription.
14
+ * error_cause_id has been added to GatewayErrorDetail.
15
+ * error_cause_id has been added to Transaction#GatewayErrorDetail.
16
+ * error_cause_id has been added to APIError.
17
+ * deleted has been added to Quote.
18
+ * current_term_start has been added to QuotedSubscripiton#SubscriptionItem.
19
+ * current_term_end has been added to QuotedSubscripiton#SubscriptionItem.
20
+ * next_billing_at has been added to QuotedSubscripiton#SubscriptionItem.
21
+ * current_term_start has been added to Subscription#SubscriptionItem.
22
+ * current_term_end has been added to Subscription#SubscriptionItem.
23
+ * next_billing_at has been added to Subscription#SubscriptionItem.
24
+ * billing_override has been added to Subscription.
25
+ * grace_period_expires_at has been added to OmnichannelSubscriptionItem.
26
+
27
+ #### New Input Params:
28
+ * billing_override has been added to Subscription#CreateWithItemsInputParam.
29
+ * billing_override has been added to Subscription#UpdateForItemsInputParam.
30
+
31
+ #### New Enum Values:
32
+ * OMNICHANNEL_SUBSCRIPTION_IMPORTED has been added to EventTypeEnum.
33
+ * DISABLED has been added to Event#WebhookStatus.
34
+ * OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_STARTED has been added to EventTypeEnum.
35
+ * OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_EXPIRED has been added to EventTypeEnum.
36
+ * OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_STARTED has been added to EventTypeEnum.
37
+ * OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_EXPIRED has been added to EventTypeEnum.
38
+ * IGNORED has been added to RecordedPurchase#StatusEnum.
39
+ * IN_DUNNING & IN_GRACE_PERIOD have been added to OmnichannelSubscriptionItem#StatusEnum.
40
+
1
41
  ### v3.2.1 (2024-12-04)
2
42
  * * *
3
43
 
@@ -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.2.1',
14
+ clientVersion: 'v3.3.0',
15
15
  port: DEFAULT_PORT,
16
16
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
17
17
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,
@@ -930,6 +930,7 @@ exports.Endpoints = {
930
930
  ['delete', 'POST', '/differential_prices', '/delete', true],
931
931
  ['list', 'GET', '/differential_prices', null, false],
932
932
  ],
933
+ configuration: [['list', 'GET', '/configurations', null, false]],
933
934
  feature: [
934
935
  ['list', 'GET', '/features', null, false],
935
936
  ['create', 'POST', '/features', null, false],
@@ -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.2.1',
11
+ clientVersion: 'v3.3.0',
12
12
  port: DEFAULT_PORT,
13
13
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
14
14
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,
@@ -927,6 +927,7 @@ export const Endpoints = {
927
927
  ['delete', 'POST', '/differential_prices', '/delete', true],
928
928
  ['list', 'GET', '/differential_prices', null, false],
929
929
  ],
930
+ configuration: [['list', 'GET', '/configurations', null, false]],
930
931
  feature: [
931
932
  ['list', 'GET', '/features', null, false],
932
933
  ['create', 'POST', '/features', null, false],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chargebee",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "description": "A library for integrating with Chargebee.",
5
5
  "scripts": {
6
6
  "prepack": "npm install && npm run build",
package/types/core.d.ts CHANGED
@@ -324,6 +324,11 @@ declare module 'chargebee' {
324
324
  | 'omnichannel_subscription_item_resubscribed'
325
325
  | 'omnichannel_subscription_item_upgraded'
326
326
  | 'omnichannel_subscription_item_cancelled'
327
+ | 'omnichannel_subscription_imported'
328
+ | 'omnichannel_subscription_item_grace_period_started'
329
+ | 'omnichannel_subscription_item_grace_period_expired'
330
+ | 'omnichannel_subscription_item_dunning_started'
331
+ | 'omnichannel_subscription_item_dunning_expired'
327
332
  | 'plan_created'
328
333
  | 'plan_updated'
329
334
  | 'plan_deleted'
@@ -492,6 +497,7 @@ declare module 'chargebee' {
492
497
  | 'tiered'
493
498
  | 'volume'
494
499
  | 'stairstep';
500
+ type ProductCatalogVersionEnum = 'v1' | 'v2';
495
501
  type ProrationTypeEnum = 'full_term' | 'partial_term' | 'none';
496
502
  type ReferralSystemEnum =
497
503
  | 'referral_candy'
package/types/index.d.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  ///<reference path='./resources/BusinessEntityTransfer.d.ts' />
7
7
  ///<reference path='./resources/Card.d.ts' />
8
8
  ///<reference path='./resources/Comment.d.ts' />
9
+ ///<reference path='./resources/Configuration.d.ts' />
9
10
  ///<reference path='./resources/Contact.d.ts' />
10
11
  ///<reference path='./resources/ContractTerm.d.ts' />
11
12
  ///<reference path='./resources/Coupon.d.ts' />
@@ -123,6 +124,7 @@ declare module 'chargebee' {
123
124
  businessEntity: BusinessEntity.BusinessEntityResource;
124
125
  card: Card.CardResource;
125
126
  comment: Comment.CommentResource;
127
+ configuration: Configuration.ConfigurationResource;
126
128
  coupon: Coupon.CouponResource;
127
129
  couponCode: CouponCode.CouponCodeResource;
128
130
  couponSet: CouponSet.CouponSetResource;
@@ -0,0 +1,24 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface Configuration {
6
+ domain?: string;
7
+ product_catalog_version?: ProductCatalogVersionEnum;
8
+ }
9
+
10
+ export namespace Configuration {
11
+ export class ConfigurationResource {
12
+ list(
13
+ headers?: ChargebeeRequestHeader,
14
+ ): Promise<ChargebeeResponse<ListResponse>>;
15
+ }
16
+
17
+ export interface ListResponse {
18
+ configurations: Configuration[];
19
+ }
20
+
21
+ // REQUEST PARAMS
22
+ //---------------
23
+ }
24
+ }
@@ -274,6 +274,7 @@ declare module 'chargebee' {
274
274
  | 'prorated_credits'
275
275
  | 'item_level_discount'
276
276
  | 'document_level_discount';
277
+ discount_type?: 'fixed_amount' | 'percentage';
277
278
  entity_id?: string;
278
279
  coupon_set_code?: string;
279
280
  }
@@ -80,6 +80,7 @@ declare module 'chargebee' {
80
80
  | 'prorated_credits'
81
81
  | 'item_level_discount'
82
82
  | 'document_level_discount';
83
+ discount_type?: 'fixed_amount' | 'percentage';
83
84
  entity_id?: string;
84
85
  coupon_set_code?: string;
85
86
  }
@@ -14,7 +14,8 @@ declare module 'chargebee' {
14
14
  | 're_scheduled'
15
15
  | 'failed'
16
16
  | 'skipped'
17
- | 'not_applicable';
17
+ | 'not_applicable'
18
+ | 'disabled';
18
19
  webhook_failure_reason?: string;
19
20
  webhooks?: Event.Webhook[];
20
21
  event_type?: EventTypeEnum;
@@ -54,7 +55,8 @@ declare module 'chargebee' {
54
55
  | 're_scheduled'
55
56
  | 'failed'
56
57
  | 'skipped'
57
- | 'not_applicable';
58
+ | 'not_applicable'
59
+ | 'disabled';
58
60
  }
59
61
  // REQUEST PARAMS
60
62
  //---------------
@@ -16,5 +16,6 @@ declare module 'chargebee' {
16
16
  recommendation_message?: string;
17
17
  processor_error_code?: string;
18
18
  processor_error_message?: string;
19
+ error_cause_id?: string;
19
20
  }
20
21
  }
@@ -519,6 +519,7 @@ declare module 'chargebee' {
519
519
  | 'prorated_credits'
520
520
  | 'item_level_discount'
521
521
  | 'document_level_discount';
522
+ discount_type?: 'fixed_amount' | 'percentage';
522
523
  entity_id?: string;
523
524
  coupon_set_code?: string;
524
525
  }
@@ -80,6 +80,7 @@ declare module 'chargebee' {
80
80
  | 'prorated_credits'
81
81
  | 'item_level_discount'
82
82
  | 'document_level_discount';
83
+ discount_type?: 'fixed_amount' | 'percentage';
83
84
  entity_id?: string;
84
85
  coupon_set_code?: string;
85
86
  }
@@ -11,6 +11,7 @@ declare module 'chargebee' {
11
11
  created_at: number;
12
12
  resource_version?: number;
13
13
  omnichannel_subscription_items: OmnichannelSubscriptionItem[];
14
+ initial_purchase_transaction?: OmnichannelSubscription.OmnichannelTransaction;
14
15
  }
15
16
 
16
17
  export namespace OmnichannelSubscription {
@@ -48,6 +49,18 @@ declare module 'chargebee' {
48
49
  next_offset?: string;
49
50
  }
50
51
 
52
+ export interface OmnichannelTransaction {
53
+ id: string;
54
+ id_at_source: string;
55
+ app_id: string;
56
+ price_currency: string;
57
+ price_units: number;
58
+ price_nanos: number;
59
+ type: 'purchase' | 'renewal';
60
+ transacted_at: number;
61
+ created_at: number;
62
+ resource_version?: number;
63
+ }
51
64
  // REQUEST PARAMS
52
65
  //---------------
53
66
 
@@ -5,7 +5,12 @@ declare module 'chargebee' {
5
5
  export interface OmnichannelSubscriptionItem {
6
6
  id: string;
7
7
  item_id_at_source: string;
8
- status: 'active' | 'expired' | 'cancelled';
8
+ status:
9
+ | 'active'
10
+ | 'expired'
11
+ | 'cancelled'
12
+ | 'in_dunning'
13
+ | 'in_grace_period';
9
14
  current_term_start?: number;
10
15
  current_term_end?: number;
11
16
  expired_at?: number;
@@ -14,6 +19,7 @@ declare module 'chargebee' {
14
19
  cancellation_reason?:
15
20
  | 'customer_cancelled'
16
21
  | 'customer_did_not_consent_to_price_increase';
22
+ grace_period_expires_at?: number;
17
23
  resource_version?: number;
18
24
  }
19
25
  }
@@ -44,6 +44,7 @@ declare module 'chargebee' {
44
44
  contract_term_end?: number;
45
45
  contract_term_termination_fee?: number;
46
46
  business_entity_id?: string;
47
+ deleted: boolean;
47
48
  }
48
49
 
49
50
  export namespace Quote {
@@ -332,6 +333,7 @@ declare module 'chargebee' {
332
333
  | 'prorated_credits'
333
334
  | 'item_level_discount'
334
335
  | 'document_level_discount';
336
+ discount_type?: 'fixed_amount' | 'percentage';
335
337
  entity_id?: string;
336
338
  coupon_set_code?: string;
337
339
  }
@@ -84,6 +84,7 @@ declare module 'chargebee' {
84
84
  | 'prorated_credits'
85
85
  | 'item_level_discount'
86
86
  | 'document_level_discount';
87
+ discount_type?: 'fixed_amount' | 'percentage';
87
88
  entity_id?: string;
88
89
  coupon_set_code?: string;
89
90
  }
@@ -69,6 +69,9 @@ declare module 'chargebee' {
69
69
  unit_price?: number;
70
70
  unit_price_in_decimal?: string;
71
71
  amount?: number;
72
+ current_term_start?: number;
73
+ current_term_end?: number;
74
+ next_billing_at?: number;
72
75
  amount_in_decimal?: string;
73
76
  billing_period?: number;
74
77
  billing_period_unit?: 'day' | 'week' | 'month' | 'year';
@@ -7,7 +7,7 @@ declare module 'chargebee' {
7
7
  customer_id: string;
8
8
  app_id: string;
9
9
  source: 'apple_app_store';
10
- status: 'in_process' | 'completed' | 'failed';
10
+ status: 'in_process' | 'completed' | 'failed' | 'ignored';
11
11
  omnichannel_transaction_id?: string;
12
12
  created_at: number;
13
13
  resource_version?: number;
@@ -83,6 +83,7 @@ declare module 'chargebee' {
83
83
  coupons?: Subscription.Coupon[];
84
84
  shipping_address?: Subscription.ShippingAddress;
85
85
  referral_info?: Subscription.ReferralInfo;
86
+ billing_override?: Subscription.BillingOverride;
86
87
  invoice_notes?: string;
87
88
  meta_data?: any;
88
89
  deleted: boolean;
@@ -557,6 +558,9 @@ declare module 'chargebee' {
557
558
  unit_price?: number;
558
559
  unit_price_in_decimal?: string;
559
560
  amount?: number;
561
+ current_term_start?: number;
562
+ current_term_end?: number;
563
+ next_billing_at?: number;
560
564
  amount_in_decimal?: string;
561
565
  billing_period?: number;
562
566
  billing_period_unit?: 'day' | 'week' | 'month' | 'year';
@@ -662,6 +666,10 @@ declare module 'chargebee' {
662
666
  destination_url?: string;
663
667
  post_purchase_widget_enabled: boolean;
664
668
  }
669
+ export interface BillingOverride {
670
+ max_excess_payment_usage?: number;
671
+ max_refundable_credits_usage?: number;
672
+ }
665
673
  export interface ContractTerm {
666
674
  id: string;
667
675
  status: 'active' | 'completed' | 'cancelled' | 'terminated';
@@ -835,6 +843,7 @@ declare module 'chargebee' {
835
843
  statement_descriptor?: StatementDescriptorCreateWithItemsInputParam;
836
844
  payment_intent?: PaymentIntentCreateWithItemsInputParam;
837
845
  contract_term?: ContractTermCreateWithItemsInputParam;
846
+ billing_override?: BillingOverrideCreateWithItemsInputParam;
838
847
  subscription_items?: SubscriptionItemsCreateWithItemsInputParam[];
839
848
  discounts?: DiscountsCreateWithItemsInputParam[];
840
849
  item_tiers?: ItemTiersCreateWithItemsInputParam[];
@@ -991,6 +1000,7 @@ declare module 'chargebee' {
991
1000
  statement_descriptor?: StatementDescriptorUpdateForItemsInputParam;
992
1001
  customer?: CustomerUpdateForItemsInputParam;
993
1002
  contract_term?: ContractTermUpdateForItemsInputParam;
1003
+ billing_override?: BillingOverrideUpdateForItemsInputParam;
994
1004
  subscription_items?: SubscriptionItemsUpdateForItemsInputParam[];
995
1005
  discounts?: DiscountsUpdateForItemsInputParam[];
996
1006
  item_tiers?: ItemTiersUpdateForItemsInputParam[];
@@ -1548,6 +1558,10 @@ declare module 'chargebee' {
1548
1558
  billing_cycles?: number;
1549
1559
  trial_end?: number;
1550
1560
  }
1561
+ export interface BillingOverrideCreateWithItemsInputParam {
1562
+ max_excess_payment_usage?: number;
1563
+ max_refundable_credits_usage?: number;
1564
+ }
1551
1565
  export interface StatementDescriptorCreateWithItemsInputParam {
1552
1566
  descriptor?: string;
1553
1567
  }
@@ -1810,6 +1824,10 @@ declare module 'chargebee' {
1810
1824
  trial_end?: number;
1811
1825
  proration_type?: ProrationTypeEnum;
1812
1826
  }
1827
+ export interface BillingOverrideUpdateForItemsInputParam {
1828
+ max_excess_payment_usage?: number;
1829
+ max_refundable_credits_usage?: number;
1830
+ }
1813
1831
  export interface BillingAddressUpdateForItemsInputParam {
1814
1832
  first_name?: string;
1815
1833
  last_name?: string;
@@ -248,6 +248,7 @@ declare module 'chargebee' {
248
248
  recommendation_message?: string;
249
249
  processor_error_code?: string;
250
250
  processor_error_message?: string;
251
+ error_cause_id?: string;
251
252
  }
252
253
  // REQUEST PARAMS
253
254
  //---------------