chargebee 2.53.1 → 2.54.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 (34) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/lib/chargebee.js +2 -2
  3. package/lib/resources/api_endpoints.js +73 -0
  4. package/package.json +1 -1
  5. package/types/core.d.ts +4 -2
  6. package/types/index.d.ts +7 -0
  7. package/types/resources/Comment.d.ts +1 -1
  8. package/types/resources/CreditNote.d.ts +3 -5
  9. package/types/resources/CreditNoteEstimate.d.ts +40 -40
  10. package/types/resources/Currency.d.ts +23 -6
  11. package/types/resources/Customer.d.ts +2 -0
  12. package/types/resources/Estimate.d.ts +2 -2
  13. package/types/resources/Event.d.ts +1 -1
  14. package/types/resources/GatewayErrorDetail.d.ts +2 -0
  15. package/types/resources/HostedPage.d.ts +3 -3
  16. package/types/resources/Invoice.d.ts +5 -7
  17. package/types/resources/InvoiceEstimate.d.ts +52 -52
  18. package/types/resources/OfferEvent.d.ts +22 -0
  19. package/types/resources/OfferFulfillment.d.ts +68 -0
  20. package/types/resources/OmnichannelOneTimeOrder.d.ts +2 -22
  21. package/types/resources/OmnichannelSubscription.d.ts +9 -20
  22. package/types/resources/OmnichannelSubscriptionItem.d.ts +2 -0
  23. package/types/resources/OmnichannelSubscriptionItemOffer.d.ts +38 -0
  24. package/types/resources/OmnichannelTransaction.d.ts +14 -0
  25. package/types/resources/Order.d.ts +0 -2
  26. package/types/resources/PersonalizedOffer.d.ts +64 -0
  27. package/types/resources/Quote.d.ts +35 -37
  28. package/types/resources/QuoteLineGroup.d.ts +24 -24
  29. package/types/resources/Ramp.d.ts +32 -7
  30. package/types/resources/Subscription.d.ts +2 -2
  31. package/types/resources/SubscriptionEstimate.d.ts +0 -2
  32. package/types/resources/Transaction.d.ts +2 -0
  33. package/types/resources/UsageFile.d.ts +4 -0
  34. package/types/resources/WebhookEndpoint.d.ts +3 -3
@@ -6,7 +6,7 @@ declare module 'chargebee' {
6
6
 
7
7
  id?:string;
8
8
 
9
- type?:'checkout_new' | 'checkout_existing' | 'update_payment_method' | 'manage_payment_sources' | 'collect_now' | 'extend_subscription' | 'checkout_one_time' | 'pre_cancel' | 'view_voucher' | 'checkout_gift' | 'claim_gift';
9
+ type?:'checkout_new' | 'checkout_existing' | 'update_payment_method' | 'manage_payment_sources' | 'collect_now' | 'extend_subscription' | 'checkout_one_time' | 'pre_cancel' | 'view_voucher' | 'accept_quote' | 'checkout_gift' | 'claim_gift';
10
10
 
11
11
  url?:string;
12
12
 
@@ -205,7 +205,7 @@ declare module 'chargebee' {
205
205
  }
206
206
  export interface CheckoutNewForItemsInputParam {
207
207
 
208
- subscription?:{auto_collection?:AutoCollection,contract_term_billing_cycle_on_renewal?:number,coupon?:string,id?:string,invoice_notes?:string,po_number?:string,setup_fee?:number,start_date?:number,trial_end?:number};
208
+ subscription?:{auto_collection?:AutoCollection,contract_term_billing_cycle_on_renewal?:number,coupon?:string,id?:string,invoice_notes?:string,offline_payment_method?:OfflinePaymentMethod,po_number?:string,setup_fee?:number,start_date?:number,trial_end?:number};
209
209
 
210
210
  customer?:{company?:string,einvoicing_method?:EinvoicingMethod,email?:string,entity_identifier_scheme?:string,entity_identifier_standard?:string,first_name?:string,id?:string,is_einvoice_enabled?:boolean,last_name?:string,locale?:string,phone?:string,taxability?:Taxability,vat_number?:string,vat_number_prefix?:string};
211
211
 
@@ -528,7 +528,7 @@ declare module 'chargebee' {
528
528
 
529
529
  */
530
530
 
531
- type?:{in?:string,is?:'checkout_new' | 'checkout_existing' | 'update_payment_method' | 'manage_payment_sources' | 'collect_now' | 'extend_subscription' | 'checkout_one_time' | 'pre_cancel' | 'view_voucher',is_not?:'checkout_new' | 'checkout_existing' | 'update_payment_method' | 'manage_payment_sources' | 'collect_now' | 'extend_subscription' | 'checkout_one_time' | 'pre_cancel' | 'view_voucher',not_in?:string};
531
+ type?:{in?:string,is?:'checkout_new' | 'checkout_existing' | 'update_payment_method' | 'manage_payment_sources' | 'collect_now' | 'extend_subscription' | 'checkout_one_time' | 'pre_cancel' | 'view_voucher' | 'accept_quote',is_not?:'checkout_new' | 'checkout_existing' | 'update_payment_method' | 'manage_payment_sources' | 'collect_now' | 'extend_subscription' | 'checkout_one_time' | 'pre_cancel' | 'view_voucher' | 'accept_quote',not_in?:string};
532
532
 
533
533
  /**
534
534
  * @description Indicating the current state of the hosted page resource.
@@ -2,7 +2,7 @@
2
2
  ///<reference path='./../index.d.ts'/>
3
3
  declare module 'chargebee' {
4
4
  export interface Invoice {
5
-
5
+ [key : string] : any;
6
6
 
7
7
  id:string;
8
8
 
@@ -284,7 +284,7 @@ declare module 'chargebee' {
284
284
  invoice:Invoice;
285
285
  }
286
286
  export interface CreateForChargeItemsAndChargesInputParam {
287
-
287
+ [key : string] : any;
288
288
  shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
289
289
 
290
290
  statement_descriptor?:{descriptor?:string};
@@ -469,7 +469,7 @@ declare module 'chargebee' {
469
469
  credit_note?:CreditNote;
470
470
  }
471
471
  export interface ImportInvoiceInputParam {
472
-
472
+ [key : string] : any;
473
473
  credit_note?:{id?:string};
474
474
 
475
475
  billing_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
@@ -899,7 +899,7 @@ NOTE: Not to be used if *consolidated invoicing* is enabled.
899
899
  invoice:Invoice;
900
900
  }
901
901
  export interface CloseInputParam {
902
-
902
+ [key : string] : any;
903
903
  notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
904
904
 
905
905
  comment?:string;
@@ -1035,7 +1035,7 @@ NOTE: Not to be used if *consolidated invoicing* is enabled.
1035
1035
  invoice:Invoice;
1036
1036
  }
1037
1037
  export interface UpdateDetailsInputParam {
1038
-
1038
+ [key : string] : any;
1039
1039
  billing_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
1040
1040
 
1041
1041
  shipping_address?:{city?:string,company?:string,country?:string,email?:string,first_name?:string,last_name?:string,line1?:string,line2?:string,line3?:string,phone?:string,state?:string,state_code?:string,validation_status?:ValidationStatus,zip?:string};
@@ -1371,8 +1371,6 @@ NOTE: Not to be used if *consolidated invoicing* is enabled.
1371
1371
  zip?:string;
1372
1372
 
1373
1373
  validation_status?:ValidationStatus;
1374
-
1375
- index:number;
1376
1374
  }
1377
1375
  export interface BillingAddress {
1378
1376
  first_name?:string;
@@ -22,24 +22,24 @@ declare module 'chargebee' {
22
22
 
23
23
  line_items?:InvoiceEstimate.LineItem[];
24
24
 
25
- discounts?:InvoiceEstimate.Discount[];
25
+ line_item_tiers?:InvoiceEstimate.LineItemTier[];
26
26
 
27
- taxes?:InvoiceEstimate.Tax[];
27
+ line_item_discounts?:InvoiceEstimate.LineItemDiscount[];
28
28
 
29
29
  line_item_taxes?:InvoiceEstimate.LineItemTax[];
30
30
 
31
- line_item_tiers?:InvoiceEstimate.LineItemTier[];
32
-
33
31
  line_item_credits?:InvoiceEstimate.LineItemCredit[];
34
32
 
35
- line_item_discounts?:InvoiceEstimate.LineItemDiscount[];
33
+ line_item_addresses?:InvoiceEstimate.LineItemAddress[];
34
+
35
+ discounts?:InvoiceEstimate.Discount[];
36
+
37
+ taxes?:InvoiceEstimate.Tax[];
36
38
 
37
39
  round_off_amount?:number;
38
40
 
39
41
  customer_id?:string;
40
42
 
41
- line_item_addresses?:InvoiceEstimate.LineItemAddress[];
42
-
43
43
  }
44
44
  export namespace InvoiceEstimate {
45
45
 
@@ -95,25 +95,39 @@ declare module 'chargebee' {
95
95
 
96
96
  customer_id?:string;
97
97
  }
98
- export interface Discount {
99
- amount:number;
98
+ export interface LineItemTier {
99
+ line_item_id?:string;
100
100
 
101
- description?:string;
101
+ starting_unit:number;
102
102
 
103
- entity_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
103
+ ending_unit?:number;
104
104
 
105
- discount_type?:'fixed_amount' | 'percentage';
105
+ quantity_used:number;
106
106
 
107
- entity_id?:string;
107
+ unit_amount:number;
108
108
 
109
- coupon_set_code?:string;
109
+ starting_unit_in_decimal?:string;
110
+
111
+ ending_unit_in_decimal?:string;
112
+
113
+ quantity_used_in_decimal?:string;
114
+
115
+ unit_amount_in_decimal?:string;
116
+
117
+ pricing_type?:'per_unit' | 'flat_fee' | 'package';
118
+
119
+ package_size?:number;
110
120
  }
111
- export interface Tax {
112
- name:string;
121
+ export interface LineItemDiscount {
122
+ line_item_id:string;
113
123
 
114
- amount:number;
124
+ discount_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
115
125
 
116
- description?:string;
126
+ coupon_id?:string;
127
+
128
+ entity_id?:string;
129
+
130
+ discount_amount:number;
117
131
  }
118
132
  export interface LineItemTax {
119
133
  line_item_id?:string;
@@ -146,29 +160,6 @@ declare module 'chargebee' {
146
160
 
147
161
  local_currency_code?:string;
148
162
  }
149
- export interface LineItemTier {
150
- line_item_id?:string;
151
-
152
- starting_unit:number;
153
-
154
- ending_unit?:number;
155
-
156
- quantity_used:number;
157
-
158
- unit_amount:number;
159
-
160
- starting_unit_in_decimal?:string;
161
-
162
- ending_unit_in_decimal?:string;
163
-
164
- quantity_used_in_decimal?:string;
165
-
166
- unit_amount_in_decimal?:string;
167
-
168
- pricing_type?:'per_unit' | 'flat_fee' | 'package';
169
-
170
- package_size?:number;
171
- }
172
163
  export interface LineItemCredit {
173
164
  cn_id:string;
174
165
 
@@ -176,17 +167,6 @@ declare module 'chargebee' {
176
167
 
177
168
  line_item_id?:string;
178
169
  }
179
- export interface LineItemDiscount {
180
- line_item_id:string;
181
-
182
- discount_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
183
-
184
- coupon_id?:string;
185
-
186
- entity_id?:string;
187
-
188
- discount_amount:number;
189
- }
190
170
  export interface LineItemAddress {
191
171
  line_item_id?:string;
192
172
 
@@ -218,5 +198,25 @@ declare module 'chargebee' {
218
198
 
219
199
  validation_status?:'not_validated' | 'valid' | 'partially_valid' | 'invalid';
220
200
  }
201
+ export interface Discount {
202
+ amount:number;
203
+
204
+ description?:string;
205
+
206
+ entity_type:'item_level_coupon' | 'document_level_coupon' | 'promotional_credits' | 'prorated_credits' | 'item_level_discount' | 'document_level_discount';
207
+
208
+ discount_type?:'fixed_amount' | 'percentage';
209
+
210
+ entity_id?:string;
211
+
212
+ coupon_set_code?:string;
213
+ }
214
+ export interface Tax {
215
+ name:string;
216
+
217
+ amount:number;
218
+
219
+ description?:string;
220
+ }
221
221
  }
222
222
  }
@@ -0,0 +1,22 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ declare module 'chargebee' {
4
+ export interface OfferEvent {
5
+
6
+
7
+ }
8
+ export namespace OfferEvent {
9
+ export class OfferEventResource {
10
+ offer_events(input:OfferEventsInputParam):ChargebeeRequest<OfferEventsResponse>;
11
+ }
12
+ export interface OfferEventsResponse {
13
+ }
14
+ export interface OfferEventsInputParam {
15
+
16
+ personalized_offer_id:string;
17
+
18
+ type:'viewed' | 'dismissed';
19
+ }
20
+
21
+ }
22
+ }
@@ -0,0 +1,68 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ declare module 'chargebee' {
4
+ export interface OfferFulfillment {
5
+
6
+
7
+ id:string;
8
+
9
+ personalized_offer_id:string;
10
+
11
+ option_id:string;
12
+
13
+ processing_type:'billing_update' | 'checkout' | 'url_redirect' | 'webhook' | 'email';
14
+
15
+ status:'in_progress' | 'completed' | 'failed';
16
+
17
+ redirect_url?:string;
18
+
19
+ failed_at?:number;
20
+
21
+ created_at:number;
22
+
23
+ completed_at?:number;
24
+
25
+ error?:OfferFulfillment.Error;
26
+
27
+ }
28
+ export namespace OfferFulfillment {
29
+ export class OfferFulfillmentResource {
30
+ offer_fulfillments(input:OfferFulfillmentsInputParam):ChargebeeRequest<OfferFulfillmentsResponse>;
31
+
32
+ offer_fulfillments_get(offer_fulfillment_id:string):ChargebeeRequest<OfferFulfillmentsGetResponse>;
33
+
34
+ offer_fulfillments_update(offer_fulfillment_id:string, input:OfferFulfillmentsUpdateInputParam):ChargebeeRequest<OfferFulfillmentsUpdateResponse>;
35
+ }
36
+ export interface OfferFulfillmentsResponse {
37
+ offer_fulfillment:OfferFulfillment;
38
+
39
+ hosted_page?:HostedPage;
40
+ }
41
+ export interface OfferFulfillmentsInputParam {
42
+
43
+ personalized_offer_id:string;
44
+
45
+ option_id:string;
46
+ }
47
+ export interface OfferFulfillmentsGetResponse {
48
+ offer_fulfillment:OfferFulfillment;
49
+ }
50
+
51
+ export interface OfferFulfillmentsUpdateResponse {
52
+ offer_fulfillment:OfferFulfillment;
53
+ }
54
+ export interface OfferFulfillmentsUpdateInputParam {
55
+
56
+ id:string;
57
+
58
+ status:'completed' | 'failed';
59
+
60
+ failure_reason?:string;
61
+ }
62
+ export interface Error {
63
+ code:'billing_update_failed' | 'checkout_abandoned' | 'external_fulfillment_failed' | 'internal_error' | 'fulfillment_expired';
64
+
65
+ message:string;
66
+ }
67
+ }
68
+ }
@@ -22,7 +22,7 @@ declare module 'chargebee' {
22
22
 
23
23
  omnichannel_one_time_order_items:OmnichannelOneTimeOrderItem[];
24
24
 
25
- purchase_transaction?:OmnichannelOneTimeOrder.OmnichannelTransaction;
25
+ purchase_transaction?:OmnichannelTransaction;
26
26
 
27
27
  }
28
28
  export namespace OmnichannelOneTimeOrder {
@@ -65,26 +65,6 @@ declare module 'chargebee' {
65
65
 
66
66
  customer_id?:{is?:string,is_not?:string,starts_with?:string};
67
67
  }
68
- export interface OmnichannelTransaction {
69
- id:string;
70
-
71
- id_at_source:string;
72
-
73
- app_id:string;
74
-
75
- price_currency?:string;
76
-
77
- price_units?:number;
78
-
79
- price_nanos?:number;
80
-
81
- type:'purchase' | 'renewal';
82
-
83
- transacted_at?:number;
84
-
85
- created_at:number;
86
-
87
- resource_version?:number;
88
- }
68
+
89
69
  }
90
70
  }
@@ -20,7 +20,7 @@ declare module 'chargebee' {
20
20
 
21
21
  omnichannel_subscription_items:OmnichannelSubscriptionItem[];
22
22
 
23
- initial_purchase_transaction?:OmnichannelSubscription.OmnichannelTransaction;
23
+ initial_purchase_transaction?:OmnichannelTransaction;
24
24
 
25
25
  }
26
26
  export namespace OmnichannelSubscription {
@@ -30,6 +30,8 @@ declare module 'chargebee' {
30
30
  list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
31
31
 
32
32
  omnichannel_transactions_for_omnichannel_subscription(omnichannel_subscription_id:string, input?:Omnichannel_transactionsForOmnichannelSubscriptionInputParam):ChargebeeRequest<OmnichannelTransactionsForOmnichannelSubscriptionResponse>;
33
+
34
+ move(omnichannel_subscription_id:string, input:MoveInputParam):ChargebeeRequest<MoveResponse>;
33
35
  }
34
36
  export interface RetrieveResponse {
35
37
  omnichannel_subscription:OmnichannelSubscription;
@@ -86,26 +88,13 @@ declare module 'chargebee' {
86
88
 
87
89
  offset?:string;
88
90
  }
89
- export interface OmnichannelTransaction {
90
- id:string;
91
-
92
- id_at_source:string;
93
-
94
- app_id:string;
95
-
96
- price_currency?:string;
97
-
98
- price_units?:number;
99
-
100
- price_nanos?:number;
101
-
102
- type:'purchase' | 'renewal';
103
-
104
- transacted_at?:number;
105
-
106
- created_at:number;
91
+ export interface MoveResponse {
92
+ omnichannel_subscription:OmnichannelSubscription;
93
+ }
94
+ export interface MoveInputParam {
107
95
 
108
- resource_version?:number;
96
+ to_customer_id:string;
109
97
  }
98
+
110
99
  }
111
100
  }
@@ -34,6 +34,8 @@ declare module 'chargebee' {
34
34
 
35
35
  resource_version?:number;
36
36
 
37
+ omnichannel_subscription_item_offers:OmnichannelSubscriptionItemOffer[];
38
+
37
39
  upcoming_renewal?:OmnichannelSubscriptionItem.UpcomingRenewal;
38
40
 
39
41
  linked_item?:OmnichannelSubscriptionItem.LinkedItem;
@@ -0,0 +1,38 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ declare module 'chargebee' {
4
+ export interface OmnichannelSubscriptionItemOffer {
5
+
6
+
7
+ id:string;
8
+
9
+ offer_id_at_source?:string;
10
+
11
+ category:Category;
12
+
13
+ category_at_source?:string;
14
+
15
+ type:Type;
16
+
17
+ type_at_source?:string;
18
+
19
+ discount_type?:DiscountType;
20
+
21
+ duration:string;
22
+
23
+ percentage?:number;
24
+
25
+ price_currency?:string;
26
+
27
+ price_units?:number;
28
+
29
+ price_nanos?:number;
30
+
31
+ offer_term_start?:number;
32
+
33
+ offer_term_end?:number;
34
+
35
+ resource_version?:number;
36
+
37
+ }
38
+ }
@@ -24,5 +24,19 @@ declare module 'chargebee' {
24
24
 
25
25
  resource_version?:number;
26
26
 
27
+ linked_omnichannel_subscriptions?:OmnichannelTransaction.LinkedOmnichannelSubscription[];
28
+
29
+ linked_omnichannel_one_time_orders?:OmnichannelTransaction.LinkedOmnichannelOneTimeOrder[];
30
+
31
+ }
32
+ export namespace OmnichannelTransaction {
33
+
34
+
35
+ export interface LinkedOmnichannelSubscription {
36
+ omnichannel_subscription_id?:string;
37
+ }
38
+ export interface LinkedOmnichannelOneTimeOrder {
39
+ omnichannel_one_time_order_id?:string;
40
+ }
27
41
  }
28
42
  }
@@ -532,8 +532,6 @@ declare module 'chargebee' {
532
532
  zip?:string;
533
533
 
534
534
  validation_status?:ValidationStatus;
535
-
536
- index:number;
537
535
  }
538
536
  export interface BillingAddress {
539
537
  first_name?:string;
@@ -0,0 +1,64 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ declare module 'chargebee' {
4
+ export interface PersonalizedOffer {
5
+
6
+
7
+ id:string;
8
+
9
+ offer_id:string;
10
+
11
+ content:PersonalizedOffer.Content;
12
+
13
+ options:PersonalizedOffer.Option[];
14
+
15
+ }
16
+ export namespace PersonalizedOffer {
17
+ export class PersonalizedOfferResource {
18
+ personalized_offers(input:PersonalizedOffersInputParam):ChargebeeRequest<PersonalizedOffersResponse>;
19
+ }
20
+ export interface PersonalizedOffersResponse {
21
+ personalized_offers:PersonalizedOffer[];
22
+
23
+ brand?:Brand;
24
+
25
+ expires_at:number;
26
+ }
27
+ export interface PersonalizedOffersInputParam {
28
+
29
+ request_context?:{locale?:string,referrer_url?:string,timezone?:string,url?:string,user_agent?:string};
30
+
31
+ first_name?:string;
32
+
33
+ last_name?:string;
34
+
35
+ email?:string;
36
+
37
+ roles?:string[];
38
+
39
+ external_user_id?:string;
40
+
41
+ subscription_id?:string;
42
+
43
+ customer_id:string;
44
+
45
+ custom?:object;
46
+ }
47
+ export interface Content {
48
+ title:string;
49
+
50
+ description:string;
51
+ }
52
+ export interface Option {
53
+ id:string;
54
+
55
+ label:string;
56
+
57
+ processing_type:'billing_update' | 'checkout' | 'url_redirect' | 'webhook' | 'email';
58
+
59
+ processing_layout:'in_app' | 'full_page';
60
+
61
+ redirect_url:string;
62
+ }
63
+ }
64
+ }