chargebee 2.39.0 → 2.41.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,34 @@
1
+ ### v2.41.0 (2024-08-29)
2
+ * * *
3
+
4
+ #### New Resource:
5
+ * CustomerEntitlement has been added.
6
+
7
+ #### New Endpoints:
8
+ * Ramp#UpdateRequest has been added to Ramp resource.
9
+ * Transaction#ReconcileRequest has been added to Transaction resource.
10
+
11
+ ### New Attributes:
12
+ * arr has been added to Subscription.
13
+
14
+ ### New Enum Values:
15
+ * customer_entitlements_updated has been added to EntityTypeEnum.
16
+ * subscription_moved_in has been added in EventType enum.
17
+ * subscription_moved_out has been added in EventType enum.
18
+ * subscription_movement_failed has been added in EventType enum.
19
+
20
+ ### v2.40.0 (2024-08-14)
21
+ * * *
22
+
23
+ #### New Attributes:
24
+ * feature_type has been added in SubscriptionEntitlement.
25
+ * business_entity_id has been made optional in Quote.
26
+ * business_entity_id has been made optional in CreditNote.
27
+
28
+ #### New Input parameters:
29
+ * invoice_usages has been added in Subscription#UpdateForItemsRequest.
30
+ * invoice_usages has been added in Estimate#UpdateSubscriptionForItemsRequest.
31
+
1
32
  ### v2.39.0 (2024-07-31)
2
33
  * * *
3
34
 
package/lib/chargebee.js CHANGED
@@ -11,7 +11,7 @@ ChargeBee._env = {
11
11
  hostSuffix: '.chargebee.com',
12
12
  apiPath: '/api/v2',
13
13
  timeout: 80000,
14
- clientVersion: 'v2.39.0',
14
+ clientVersion: 'v2.41.0',
15
15
  port: 443,
16
16
  timemachineWaitInMillis: 3000,
17
17
  exportWaitInMillis: 3000
@@ -1243,6 +1243,13 @@ var _endpoints = {
1243
1243
  "/record_refund",
1244
1244
  true
1245
1245
  ],
1246
+ [
1247
+ "reconcile",
1248
+ "POST",
1249
+ "/transactions",
1250
+ "/reconcile",
1251
+ true
1252
+ ],
1246
1253
  [
1247
1254
  "refund",
1248
1255
  "POST",
@@ -2615,6 +2622,15 @@ var _endpoints = {
2615
2622
  true
2616
2623
  ]
2617
2624
  ],
2625
+ "customer_entitlement": [
2626
+ [
2627
+ "entitlements_for_customer",
2628
+ "GET",
2629
+ "/customers",
2630
+ "/customer_entitlements",
2631
+ true
2632
+ ]
2633
+ ],
2618
2634
  "item_entitlement": [
2619
2635
  [
2620
2636
  "item_entitlements_for_item",
@@ -2830,6 +2846,13 @@ var _endpoints = {
2830
2846
  "/create_ramp",
2831
2847
  true
2832
2848
  ],
2849
+ [
2850
+ "update",
2851
+ "POST",
2852
+ "/ramps",
2853
+ "/update",
2854
+ true
2855
+ ],
2833
2856
  [
2834
2857
  "retrieve",
2835
2858
  "GET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"chargebee",
3
- "version":"2.39.0",
3
+ "version":"2.41.0",
4
4
  "description":"A library for integrating with ChargeBee.",
5
5
  "keywords":[
6
6
  "payments",
package/types/core.d.ts CHANGED
@@ -44,7 +44,7 @@ declare module 'chargebee' {
44
44
  type EntityCode = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'p' | 'q' | 'r' | 'med1' | 'med2'
45
45
  type EntityType = 'customer' | 'subscription' | 'coupon' | 'plan_item_price' | 'addon_item_price' | 'charge_item_price' | 'invoice' | 'quote' | 'credit_note' | 'transaction' | 'plan' | 'addon' | 'order' | 'item_family' | 'item' | 'item_price' | 'plan_item' | 'addon_item' | 'charge_item' | 'plan_price' | 'addon_price' | 'charge_price' | 'differential_price' | 'attached_item' | 'feature' | 'subscription_entitlement' | 'item_entitlement' | 'business_entity' | 'price_variant'
46
46
  type EventName = 'cancellation_page_loaded'
47
- type EventType = 'coupon_created' | 'coupon_updated' | 'coupon_deleted' | 'coupon_set_created' | 'coupon_set_updated' | 'coupon_set_deleted' | 'coupon_codes_added' | 'coupon_codes_deleted' | 'coupon_codes_updated' | 'customer_created' | 'customer_changed' | 'customer_deleted' | 'customer_moved_out' | 'customer_moved_in' | 'promotional_credits_added' | 'promotional_credits_deducted' | 'subscription_created' | 'subscription_created_with_backdating' | 'subscription_started' | 'subscription_trial_end_reminder' | 'subscription_activated' | 'subscription_activated_with_backdating' | 'subscription_changed' | 'subscription_trial_extended' | 'mrr_updated' | 'subscription_changed_with_backdating' | 'subscription_cancellation_scheduled' | 'subscription_cancellation_reminder' | 'subscription_cancelled' | 'subscription_canceled_with_backdating' | 'subscription_reactivated' | 'subscription_reactivated_with_backdating' | 'subscription_renewed' | 'subscription_items_renewed' | 'subscription_scheduled_cancellation_removed' | 'subscription_changes_scheduled' | 'subscription_scheduled_changes_removed' | 'subscription_shipping_address_updated' | 'subscription_deleted' | 'subscription_paused' | 'subscription_pause_scheduled' | 'subscription_scheduled_pause_removed' | 'subscription_resumed' | 'subscription_resumption_scheduled' | 'subscription_scheduled_resumption_removed' | 'subscription_advance_invoice_schedule_added' | 'subscription_advance_invoice_schedule_updated' | 'subscription_advance_invoice_schedule_removed' | 'pending_invoice_created' | 'pending_invoice_updated' | 'invoice_generated' | 'invoice_generated_with_backdating' | 'invoice_updated' | 'invoice_deleted' | 'credit_note_created' | 'credit_note_created_with_backdating' | 'credit_note_updated' | 'credit_note_deleted' | 'invoice_installments_created' | 'invoice_installment_updated' | 'installment_config_created' | 'installment_config_deleted' | 'subscription_renewal_reminder' | 'add_usages_reminder' | 'transaction_created' | 'transaction_updated' | 'transaction_deleted' | 'payment_succeeded' | 'payment_failed' | 'payment_refunded' | 'payment_initiated' | 'refund_initiated' | 'authorization_succeeded' | 'authorization_voided' | 'card_added' | 'card_updated' | 'card_expiry_reminder' | 'card_expired' | 'card_deleted' | 'payment_source_added' | 'payment_source_updated' | 'payment_source_deleted' | 'payment_source_expiring' | 'payment_source_expired' | 'payment_source_locally_deleted' | 'virtual_bank_account_added' | 'virtual_bank_account_updated' | 'virtual_bank_account_deleted' | 'token_created' | 'token_consumed' | 'token_expired' | 'unbilled_charges_created' | 'unbilled_charges_voided' | 'unbilled_charges_deleted' | 'unbilled_charges_invoiced' | 'order_created' | 'order_updated' | 'order_cancelled' | 'order_delivered' | 'order_returned' | 'order_ready_to_process' | 'order_ready_to_ship' | 'order_deleted' | 'order_resent' | 'quote_created' | 'quote_updated' | 'quote_deleted' | 'tax_withheld_recorded' | 'tax_withheld_deleted' | 'tax_withheld_refunded' | 'gift_scheduled' | 'gift_unclaimed' | 'gift_claimed' | 'gift_expired' | 'gift_cancelled' | 'gift_updated' | 'hierarchy_created' | 'hierarchy_deleted' | 'payment_intent_created' | 'payment_intent_updated' | 'contract_term_created' | 'contract_term_renewed' | 'contract_term_terminated' | 'contract_term_completed' | 'contract_term_cancelled' | 'item_family_created' | 'item_family_updated' | 'item_family_deleted' | 'item_created' | 'item_updated' | 'item_deleted' | 'item_price_created' | 'item_price_updated' | 'item_price_deleted' | 'attached_item_created' | 'attached_item_updated' | 'attached_item_deleted' | 'differential_price_created' | 'differential_price_updated' | 'differential_price_deleted' | 'feature_created' | 'feature_updated' | 'feature_deleted' | 'feature_activated' | 'feature_reactivated' | 'feature_archived' | 'item_entitlements_updated' | 'entitlement_overrides_updated' | 'entitlement_overrides_removed' | 'item_entitlements_removed' | 'entitlement_overrides_auto_removed' | 'subscription_entitlements_created' | 'business_entity_created' | 'business_entity_updated' | 'business_entity_deleted' | 'customer_business_entity_changed' | 'subscription_business_entity_changed' | 'purchase_created' | 'voucher_created' | 'voucher_expired' | 'voucher_create_failed' | 'item_price_entitlements_updated' | 'item_price_entitlements_removed' | 'ramp_created' | 'ramp_deleted' | 'ramp_applied' | 'subscription_ramp_drafted' | 'subscription_ramp_updated' | 'price_variant_created' | 'price_variant_updated' | 'price_variant_deleted' | 'plan_created' | 'plan_updated' | 'plan_deleted' | 'addon_created' | 'addon_updated' | 'addon_deleted'
47
+ type EventType = 'coupon_created' | 'coupon_updated' | 'coupon_deleted' | 'coupon_set_created' | 'coupon_set_updated' | 'coupon_set_deleted' | 'coupon_codes_added' | 'coupon_codes_deleted' | 'coupon_codes_updated' | 'customer_created' | 'customer_changed' | 'customer_deleted' | 'customer_moved_out' | 'customer_moved_in' | 'promotional_credits_added' | 'promotional_credits_deducted' | 'subscription_created' | 'subscription_created_with_backdating' | 'subscription_started' | 'subscription_trial_end_reminder' | 'subscription_activated' | 'subscription_activated_with_backdating' | 'subscription_changed' | 'subscription_trial_extended' | 'mrr_updated' | 'subscription_changed_with_backdating' | 'subscription_cancellation_scheduled' | 'subscription_cancellation_reminder' | 'subscription_cancelled' | 'subscription_canceled_with_backdating' | 'subscription_reactivated' | 'subscription_reactivated_with_backdating' | 'subscription_renewed' | 'subscription_items_renewed' | 'subscription_scheduled_cancellation_removed' | 'subscription_changes_scheduled' | 'subscription_scheduled_changes_removed' | 'subscription_shipping_address_updated' | 'subscription_deleted' | 'subscription_paused' | 'subscription_pause_scheduled' | 'subscription_scheduled_pause_removed' | 'subscription_resumed' | 'subscription_resumption_scheduled' | 'subscription_scheduled_resumption_removed' | 'subscription_advance_invoice_schedule_added' | 'subscription_advance_invoice_schedule_updated' | 'subscription_advance_invoice_schedule_removed' | 'pending_invoice_created' | 'pending_invoice_updated' | 'invoice_generated' | 'invoice_generated_with_backdating' | 'invoice_updated' | 'invoice_deleted' | 'credit_note_created' | 'credit_note_created_with_backdating' | 'credit_note_updated' | 'credit_note_deleted' | 'invoice_installments_created' | 'invoice_installment_updated' | 'installment_config_created' | 'installment_config_deleted' | 'subscription_renewal_reminder' | 'add_usages_reminder' | 'transaction_created' | 'transaction_updated' | 'transaction_deleted' | 'payment_succeeded' | 'payment_failed' | 'payment_refunded' | 'payment_initiated' | 'refund_initiated' | 'authorization_succeeded' | 'authorization_voided' | 'card_added' | 'card_updated' | 'card_expiry_reminder' | 'card_expired' | 'card_deleted' | 'payment_source_added' | 'payment_source_updated' | 'payment_source_deleted' | 'payment_source_expiring' | 'payment_source_expired' | 'payment_source_locally_deleted' | 'virtual_bank_account_added' | 'virtual_bank_account_updated' | 'virtual_bank_account_deleted' | 'token_created' | 'token_consumed' | 'token_expired' | 'unbilled_charges_created' | 'unbilled_charges_voided' | 'unbilled_charges_deleted' | 'unbilled_charges_invoiced' | 'order_created' | 'order_updated' | 'order_cancelled' | 'order_delivered' | 'order_returned' | 'order_ready_to_process' | 'order_ready_to_ship' | 'order_deleted' | 'order_resent' | 'quote_created' | 'quote_updated' | 'quote_deleted' | 'tax_withheld_recorded' | 'tax_withheld_deleted' | 'tax_withheld_refunded' | 'gift_scheduled' | 'gift_unclaimed' | 'gift_claimed' | 'gift_expired' | 'gift_cancelled' | 'gift_updated' | 'hierarchy_created' | 'hierarchy_deleted' | 'payment_intent_created' | 'payment_intent_updated' | 'contract_term_created' | 'contract_term_renewed' | 'contract_term_terminated' | 'contract_term_completed' | 'contract_term_cancelled' | 'item_family_created' | 'item_family_updated' | 'item_family_deleted' | 'item_created' | 'item_updated' | 'item_deleted' | 'item_price_created' | 'item_price_updated' | 'item_price_deleted' | 'attached_item_created' | 'attached_item_updated' | 'attached_item_deleted' | 'differential_price_created' | 'differential_price_updated' | 'differential_price_deleted' | 'feature_created' | 'feature_updated' | 'feature_deleted' | 'feature_activated' | 'feature_reactivated' | 'feature_archived' | 'item_entitlements_updated' | 'entitlement_overrides_updated' | 'entitlement_overrides_removed' | 'item_entitlements_removed' | 'entitlement_overrides_auto_removed' | 'subscription_entitlements_created' | 'business_entity_created' | 'business_entity_updated' | 'business_entity_deleted' | 'customer_business_entity_changed' | 'subscription_business_entity_changed' | 'purchase_created' | 'voucher_created' | 'voucher_expired' | 'voucher_create_failed' | 'item_price_entitlements_updated' | 'item_price_entitlements_removed' | 'ramp_created' | 'ramp_deleted' | 'ramp_applied' | 'subscription_ramp_drafted' | 'subscription_ramp_updated' | 'price_variant_created' | 'price_variant_updated' | 'price_variant_deleted' | 'customer_entitlements_updated' | 'subscription_moved_in' | 'subscription_moved_out' | 'subscription_movement_failed' | 'plan_created' | 'plan_updated' | 'plan_deleted' | 'addon_created' | 'addon_updated' | 'addon_deleted'
48
48
  type ExportType = 'data' | 'import_friendly_data'
49
49
  type FreePeriodUnit = 'day' | 'week' | 'month' | 'year'
50
50
  type FriendOfferType = 'none' | 'coupon' | 'coupon_code'
package/types/index.d.ts CHANGED
@@ -15,6 +15,7 @@
15
15
  ///<reference path='./resources/CreditNoteEstimate.d.ts' />
16
16
  ///<reference path='./resources/Currency.d.ts' />
17
17
  ///<reference path='./resources/Customer.d.ts' />
18
+ ///<reference path='./resources/CustomerEntitlement.d.ts' />
18
19
  ///<reference path='./resources/DifferentialPrice.d.ts' />
19
20
  ///<reference path='./resources/Discount.d.ts' />
20
21
  ///<reference path='./resources/Download.d.ts' />
@@ -86,6 +87,7 @@ declare module 'chargebee' {
86
87
  static credit_note: CreditNote.CreditNoteResource;
87
88
  static currency: Currency.CurrencyResource;
88
89
  static customer: Customer.CustomerResource;
90
+ static customer_entitlement: CustomerEntitlement.CustomerEntitlementResource;
89
91
  static differential_price: DifferentialPrice.DifferentialPriceResource;
90
92
  static entitlement: Entitlement.EntitlementResource;
91
93
  static entitlement_override: EntitlementOverride.EntitlementOverrideResource;
@@ -1,4 +1,6 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface CreditNote {
4
6
 
@@ -240,7 +242,7 @@ Ireland** . The first two characters of the VAT number in such a case is &#x60;X
240
242
 
241
243
  */
242
244
 
243
- business_entity_id:string;
245
+ business_entity_id?:string;
244
246
 
245
247
  /**
246
248
  * @description An e-invoice or electronic invoice is a structured representation of an invoice that is interoperable between computerized invoicing systems. Depending on the country, e-invoicing can be necessary to meet financial/taxation authority regulations.
@@ -0,0 +1,47 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ declare module 'chargebee' {
4
+ export interface CustomerEntitlement {
5
+
6
+
7
+ customer_id:string;
8
+
9
+ subscription_id?:string;
10
+
11
+ feature_id?:string;
12
+
13
+ value?:string;
14
+
15
+ name?:string;
16
+
17
+ is_enabled:boolean;
18
+
19
+ }
20
+ export namespace CustomerEntitlement {
21
+ export class CustomerEntitlementResource {
22
+ entitlements_for_customer(customer_id:string, input?:EntitlementsForCustomerInputParam):ChargebeeRequest<EntitlementsForCustomerResponse>;
23
+ }
24
+ export interface EntitlementsForCustomerResponse {
25
+ list:{customer_entitlement:CustomerEntitlement}[];
26
+
27
+ next_offset?:string;
28
+ }
29
+ export interface EntitlementsForCustomerInputParam {
30
+ [key : string]: any;
31
+ /**
32
+ * @description The number of resources to be returned.
33
+
34
+ */
35
+
36
+ limit?:number;
37
+
38
+ /**
39
+ * @description Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set \&#x60;offset\&#x60; to the value of \&#x60;next_offset\&#x60; obtained in the previous iteration of the API call.
40
+
41
+ */
42
+
43
+ offset?:string;
44
+ }
45
+
46
+ }
47
+ }
@@ -316,6 +316,8 @@ declare module 'chargebee' {
316
316
  use_existing_balances?:boolean;
317
317
 
318
318
  invoice_immediately?:boolean;
319
+
320
+ invoice_usages?:boolean;
319
321
  }
320
322
  export interface RenewalEstimateResponse {
321
323
  estimate:Estimate;
@@ -1,4 +1,6 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface Quote {
4
6
 
@@ -76,7 +78,7 @@ declare module 'chargebee' {
76
78
 
77
79
  contract_term_termination_fee?:number;
78
80
 
79
- business_entity_id:string;
81
+ business_entity_id?:string;
80
82
  }
81
83
  export namespace Quote {
82
84
  export class QuoteResource {
@@ -179,6 +179,8 @@ By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descend
179
179
  */
180
180
 
181
181
  list(input:ListInputParam):ChargebeeRequest<ListResponse>;
182
+
183
+ update(ramp_id:string, input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
182
184
  }
183
185
  export interface CreateForSubscriptionResponse {
184
186
  ramp:Ramp;
@@ -285,7 +287,9 @@ Replaces the existing item_tiers for specific &#x60;item_price&#x60;s within the
285
287
  export interface RetrieveResponse {
286
288
  ramp:Ramp;
287
289
  }
288
-
290
+ export interface UpdateResponse {
291
+ ramp:Ramp;
292
+ }
289
293
  export interface DeleteResponse {
290
294
  ramp:Ramp;
291
295
  }
@@ -311,6 +315,28 @@ By default, the ramps are returned [sorted](ramps#list_ramps_sort_by) in descend
311
315
 
312
316
  next_offset?:string;
313
317
  }
318
+ export interface UpdateInputParam {
319
+
320
+ items_to_add:{billing_cycles?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
321
+
322
+ items_to_update:{billing_cycles?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
323
+
324
+ item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
325
+
326
+ coupons_to_add?:{apply_till?:number,coupon_id?:string}[];
327
+
328
+ discounts_to_add:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
329
+
330
+ effective_from:number;
331
+
332
+ description?:string;
333
+
334
+ coupons_to_remove?:string[];
335
+
336
+ discounts_to_remove?:string[];
337
+
338
+ items_to_remove?:string[];
339
+ }
314
340
  export interface ListInputParam {
315
341
  [key : string]: any;
316
342
  /**
@@ -442,6 +442,7 @@ Applicable only when [Metered Billing](https://www.chargebee.com/docs/metered_bi
442
442
  */
443
443
 
444
444
  discounts?:Subscription.Discount[];
445
+ arr?:number;
445
446
  }
446
447
  export namespace Subscription {
447
448
  export class SubscriptionResource {
@@ -2752,6 +2753,7 @@ Updates the specified subscription by setting the parameters passed. Any paramet
2752
2753
  */
2753
2754
 
2754
2755
  item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,item_price_id?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
2756
+ invoice_usages?:boolean;
2755
2757
  }
2756
2758
  export interface ChangeTermEndResponse {
2757
2759
  subscription:Subscription;
@@ -79,6 +79,7 @@ declare module 'chargebee' {
79
79
  */
80
80
 
81
81
  components?:SubscriptionEntitlement.Component;
82
+ feature_type?:string;
82
83
  }
83
84
  export namespace SubscriptionEntitlement {
84
85
  export class SubscriptionEntitlementResource {
@@ -371,6 +371,8 @@ declare module 'chargebee' {
371
371
  */
372
372
 
373
373
  delete_offline_transaction(transaction_id:string, input?:DeleteOfflineTransactionInputParam):ChargebeeRequest<DeleteOfflineTransactionResponse>;
374
+
375
+ reconcile(transaction_id:string, input?:ReconcileInputParam):ChargebeeRequest<ReconcileResponse>;
374
376
  }
375
377
  export interface CreateAuthorizationResponse {
376
378
  transaction:Transaction;
@@ -640,6 +642,17 @@ declare module 'chargebee' {
640
642
 
641
643
  next_offset?:string;
642
644
  }
645
+ export interface ReconcileResponse {
646
+ transaction:Transaction;
647
+ }
648
+ export interface ReconcileInputParam {
649
+
650
+ id_at_gateway?:string;
651
+
652
+ customer_id?:string;
653
+
654
+ status?:'success' | 'failure';
655
+ }
643
656
  export interface PaymentsForInvoiceInputParam {
644
657
  [key : string]: any;
645
658
  /**