chargebee 2.24.0 → 2.25.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 (65) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/lib/chargebee.js +1 -1
  3. package/package.json +2 -1
  4. package/types/core.d.ts +80 -0
  5. package/types/index.d.ts +92 -0
  6. package/types/resources/Address.d.ts +58 -0
  7. package/types/resources/AdvanceInvoiceSchedule.d.ts +26 -0
  8. package/types/resources/AttachedItem.d.ts +84 -0
  9. package/types/resources/Card.d.ts +88 -0
  10. package/types/resources/Comment.d.ts +52 -0
  11. package/types/resources/Contact.d.ts +15 -0
  12. package/types/resources/ContractTerm.d.ts +18 -0
  13. package/types/resources/Coupon.d.ts +150 -0
  14. package/types/resources/CouponCode.d.ts +25 -0
  15. package/types/resources/CouponSet.d.ts +75 -0
  16. package/types/resources/CreditNote.d.ts +337 -0
  17. package/types/resources/CreditNoteEstimate.d.ts +96 -0
  18. package/types/resources/Customer.d.ts +440 -0
  19. package/types/resources/DifferentialPrice.d.ts +88 -0
  20. package/types/resources/Discount.d.ts +23 -0
  21. package/types/resources/Download.d.ts +9 -0
  22. package/types/resources/EntitlementOverride.d.ts +37 -0
  23. package/types/resources/Estimate.d.ts +214 -0
  24. package/types/resources/Event.d.ts +42 -0
  25. package/types/resources/Export.d.ts +182 -0
  26. package/types/resources/Feature.d.ts +90 -0
  27. package/types/resources/Gift.d.ts +97 -0
  28. package/types/resources/Hierarchy.d.ts +11 -0
  29. package/types/resources/HostedPage.d.ts +242 -0
  30. package/types/resources/ImpactedItem.d.ts +17 -0
  31. package/types/resources/ImpactedSubscription.d.ts +17 -0
  32. package/types/resources/InAppSubscription.d.ts +52 -0
  33. package/types/resources/Invoice.d.ts +590 -0
  34. package/types/resources/InvoiceEstimate.d.ts +96 -0
  35. package/types/resources/Item.d.ts +118 -0
  36. package/types/resources/ItemEntitlement.d.ts +55 -0
  37. package/types/resources/ItemFamily.d.ts +59 -0
  38. package/types/resources/ItemPrice.d.ts +195 -0
  39. package/types/resources/Media.d.ts +10 -0
  40. package/types/resources/NonSubscription.d.ts +23 -0
  41. package/types/resources/Order.d.ts +305 -0
  42. package/types/resources/PaymentIntent.d.ts +71 -0
  43. package/types/resources/PaymentReferenceNumber.d.ts +10 -0
  44. package/types/resources/PaymentSource.d.ts +264 -0
  45. package/types/resources/PaymentVoucher.d.ts +74 -0
  46. package/types/resources/PortalSession.d.ts +57 -0
  47. package/types/resources/PromotionalCredit.d.ts +86 -0
  48. package/types/resources/Purchase.d.ts +46 -0
  49. package/types/resources/Quote.d.ts +388 -0
  50. package/types/resources/QuoteLineGroup.d.ts +83 -0
  51. package/types/resources/QuotedCharge.d.ts +57 -0
  52. package/types/resources/QuotedSubscription.d.ts +82 -0
  53. package/types/resources/ResourceMigration.d.ts +27 -0
  54. package/types/resources/SiteMigrationDetail.d.ts +31 -0
  55. package/types/resources/Subscription.d.ts +619 -0
  56. package/types/resources/SubscriptionEntitlement.d.ts +41 -0
  57. package/types/resources/SubscriptionEstimate.d.ts +49 -0
  58. package/types/resources/TaxWithheld.d.ts +13 -0
  59. package/types/resources/ThirdPartyPaymentMethod.d.ts +10 -0
  60. package/types/resources/TimeMachine.d.ts +38 -0
  61. package/types/resources/Token.d.ts +50 -0
  62. package/types/resources/Transaction.d.ts +170 -0
  63. package/types/resources/UnbilledCharge.d.ts +91 -0
  64. package/types/resources/Usage.d.ts +76 -0
  65. package/types/resources/VirtualBankAccount.d.ts +75 -0
@@ -0,0 +1,619 @@
1
+ declare module 'chargebee' {
2
+ export interface Subscription {
3
+ [key : string] : any;
4
+ id:string;
5
+ currency_code:string;
6
+ start_date?:number;
7
+ trial_end?:number;
8
+ remaining_billing_cycles?:number;
9
+ po_number?:string;
10
+ plan_quantity_in_decimal?:string;
11
+ plan_unit_price_in_decimal?:string;
12
+ customer_id:string;
13
+ status:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing';
14
+ trial_start?:number;
15
+ trial_end_action?:TrialEndAction;
16
+ current_term_start?:number;
17
+ current_term_end?:number;
18
+ next_billing_at?:number;
19
+ created_at?:number;
20
+ started_at?:number;
21
+ activated_at?:number;
22
+ contract_term_billing_cycle_on_renewal?:number;
23
+ override_relationship?:boolean;
24
+ pause_date?:number;
25
+ resume_date?:number;
26
+ cancelled_at?:number;
27
+ cancel_reason?:'tax_calculation_failed' | 'fraud_review_failed' | 'currency_incompatible_with_gateway' | 'non_compliant_eu_customer' | 'non_compliant_customer' | 'not_paid' | 'no_card';
28
+ created_from_ip?:string;
29
+ resource_version?:number;
30
+ updated_at?:number;
31
+ has_scheduled_advance_invoices:boolean;
32
+ has_scheduled_changes:boolean;
33
+ payment_source_id?:string;
34
+ plan_free_quantity_in_decimal?:string;
35
+ plan_amount_in_decimal?:string;
36
+ cancel_schedule_created_at?:number;
37
+ channel?:Channel;
38
+ net_term_days?:number;
39
+ due_invoices_count?:number;
40
+ due_since?:number;
41
+ total_dues?:number;
42
+ mrr?:number;
43
+ exchange_rate?:number;
44
+ base_currency_code?:string;
45
+ invoice_notes?:string;
46
+ metadata?:object;
47
+ deleted:boolean;
48
+ changes_scheduled_at?:number;
49
+ cancel_reason_code?:string;
50
+ free_period?:number;
51
+ free_period_unit?:FreePeriodUnit;
52
+ create_pending_invoices?:boolean;
53
+ auto_close_invoices?:boolean;
54
+ business_entity_id?:string;
55
+ subscription_items?:Subscription.SubscriptionItem[];
56
+ item_tiers?:Subscription.ItemTier[];
57
+ charged_items?:Subscription.ChargedItem[];
58
+ coupons?:Subscription.Coupon[];
59
+ shipping_address?:Subscription.ShippingAddress;
60
+ referral_info?:Subscription.ReferralInfo;
61
+ contract_term?:Subscription.ContractTerm;
62
+ discounts?:Subscription.Discount[];
63
+ }
64
+ export namespace Subscription {
65
+ export class SubscriptionResource {
66
+ remove_advance_invoice_schedule(subscription_id:string, input?:RemoveAdvanceInvoiceScheduleInputParam):ChargebeeRequest<RemoveAdvanceInvoiceScheduleResponse>;
67
+ update_for_items(subscription_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
68
+ remove_coupons(subscription_id:string, input?:RemoveCouponsInputParam):ChargebeeRequest<RemoveCouponsResponse>;
69
+ resume(subscription_id:string, input?:ResumeInputParam):ChargebeeRequest<ResumeResponse>;
70
+ cancel_for_items(subscription_id:string, input?:CancelForItemsInputParam):ChargebeeRequest<CancelForItemsResponse>;
71
+ regenerate_invoice(subscription_id:string, input?:RegenerateInvoiceInputParam):ChargebeeRequest<RegenerateInvoiceResponse>;
72
+ list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
73
+ import_for_items(customer_id:string, input:ImportForItemsInputParam):ChargebeeRequest<ImportForItemsResponse>;
74
+ retrieve_advance_invoice_schedule(subscription_id:string):ChargebeeRequest<RetrieveAdvanceInvoiceScheduleResponse>;
75
+ remove_scheduled_cancellation(subscription_id:string, input?:RemoveScheduledCancellationInputParam):ChargebeeRequest<RemoveScheduledCancellationResponse>;
76
+ retrieve_with_scheduled_changes(subscription_id:string):ChargebeeRequest<RetrieveWithScheduledChangesResponse>;
77
+ reactivate(subscription_id:string, input?:ReactivateInputParam):ChargebeeRequest<ReactivateResponse>;
78
+ charge_future_renewals(subscription_id:string, input?:ChargeFutureRenewalsInputParam):ChargebeeRequest<ChargeFutureRenewalsResponse>;
79
+ add_charge_at_term_end(subscription_id:string, input:AddChargeAtTermEndInputParam):ChargebeeRequest<AddChargeAtTermEndResponse>;
80
+ remove_scheduled_changes(subscription_id:string):ChargebeeRequest<RemoveScheduledChangesResponse>;
81
+ change_term_end(subscription_id:string, input:ChangeTermEndInputParam):ChargebeeRequest<ChangeTermEndResponse>;
82
+ delete(subscription_id:string):ChargebeeRequest<DeleteResponse>;
83
+ create_with_items(customer_id:string, input?:CreateWithItemsInputParam):ChargebeeRequest<CreateWithItemsResponse>;
84
+ import_unbilled_charges(subscription_id:string, input?:ImportUnbilledChargesInputParam):ChargebeeRequest<ImportUnbilledChargesResponse>;
85
+ remove_scheduled_resumption(subscription_id:string):ChargebeeRequest<RemoveScheduledResumptionResponse>;
86
+ retrieve(subscription_id:string):ChargebeeRequest<RetrieveResponse>;
87
+ import_contract_term(subscription_id:string, input?:ImportContractTermInputParam):ChargebeeRequest<ImportContractTermResponse>;
88
+ override_billing_profile(subscription_id:string, input?:OverrideBillingProfileInputParam):ChargebeeRequest<OverrideBillingProfileResponse>;
89
+ remove_scheduled_pause(subscription_id:string):ChargebeeRequest<RemoveScheduledPauseResponse>;
90
+ edit_advance_invoice_schedule(subscription_id:string, input?:EditAdvanceInvoiceScheduleInputParam):ChargebeeRequest<EditAdvanceInvoiceScheduleResponse>;
91
+ list_discounts(subscription_id:string, input?:ListDiscountsInputParam):ChargebeeRequest<ListDiscountsResponse>;
92
+ contract_terms_for_subscription(subscription_id:string, input?:ContractTermsForSubscriptionInputParam):ChargebeeRequest<ContractTermsForSubscriptionResponse>;
93
+ pause(subscription_id:string, input?:PauseInputParam):ChargebeeRequest<PauseResponse>;
94
+ }
95
+ export interface RemoveAdvanceInvoiceScheduleResponse {
96
+ subscription:Subscription;
97
+ advance_invoice_schedules?:AdvanceInvoiceSchedule[];
98
+ }
99
+ export interface RemoveAdvanceInvoiceScheduleInputParam {
100
+
101
+ specific_dates_schedule?:{id?:string}[];
102
+ }
103
+ export interface UpdateForItemsResponse {
104
+ subscription:Subscription;
105
+ customer:Customer;
106
+ card?:Card;
107
+ invoice?:Invoice;
108
+ unbilled_charges?:UnbilledCharge[];
109
+ credit_notes?:CreditNote[];
110
+ }
111
+ export interface UpdateForItemsInputParam {
112
+ [key : string] : any;
113
+ mandatory_items_to_remove?:string[];
114
+ replace_items_list?:boolean;
115
+ net_term_days?:number;
116
+ invoice_date?:number;
117
+ start_date?:number;
118
+ trial_end?:number;
119
+ billing_cycles?:number;
120
+ terms_to_charge?:number;
121
+ reactivate_from?:number;
122
+ billing_alignment_mode?:BillingAlignmentMode;
123
+ auto_collection?:AutoCollection;
124
+ offline_payment_method?:OfflinePaymentMethod;
125
+ po_number?:string;
126
+ coupon_ids?:string[];
127
+ replace_coupon_list?:boolean;
128
+ prorate?:boolean;
129
+ end_of_term?:boolean;
130
+ force_term_reset?:boolean;
131
+ reactivate?:boolean;
132
+ token_id?:string;
133
+ invoice_notes?:string;
134
+ meta_data?:object;
135
+ invoice_immediately?:boolean;
136
+ override_relationship?:boolean;
137
+ changes_scheduled_at?:number;
138
+ change_option?:ChangeOption;
139
+ contract_term_billing_cycle_on_renewal?:number;
140
+ free_period?:number;
141
+ free_period_unit?:FreePeriodUnit;
142
+ create_pending_invoices?:boolean;
143
+ auto_close_invoices?:boolean;
144
+ trial_end_action?:TrialEndAction;
145
+ payment_initiator?:'merchant' | 'customer';
146
+ card?:{additional_information?:object,billing_addr1?:string,billing_addr2?:string,billing_city?:string,billing_country?:string,billing_state?:string,billing_state_code?:string,billing_zip?:string,cvv?:string,expiry_month?:number,expiry_year?:number,first_name?:string,gateway_account_id?:string,last_name?:string,number?:string};
147
+ payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
148
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'sofort' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'card',reference_id?:string};
149
+ 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};
150
+ 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};
151
+ customer?:{business_customer_without_vat_number?:boolean,einvoicing_method?:EinvoicingMethod,entity_identifier_scheme?:string,entity_identifier_standard?:string,is_einvoice_enabled?:boolean,registered_for_gst?:boolean,vat_number?:string,vat_number_prefix?:string};
152
+ contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
153
+ subscription_items?:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
154
+ discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,id?:string,included_in_mrr?:boolean,item_price_id?:string,operation_type:OperationType,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
155
+ 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}[];
156
+ }
157
+ export interface RemoveCouponsResponse {
158
+ subscription:Subscription;
159
+ customer:Customer;
160
+ card?:Card;
161
+ }
162
+ export interface RemoveCouponsInputParam {
163
+
164
+ coupon_ids?:string[];
165
+ }
166
+ export interface ResumeResponse {
167
+ subscription:Subscription;
168
+ customer:Customer;
169
+ card?:Card;
170
+ invoice?:Invoice;
171
+ unbilled_charges?:UnbilledCharge[];
172
+ }
173
+ export interface ResumeInputParam {
174
+
175
+ resume_option?:ResumeOption;
176
+ resume_date?:number;
177
+ charges_handling?:ChargesHandling;
178
+ unpaid_invoices_handling?:UnpaidInvoicesHandling;
179
+ payment_initiator?:'merchant' | 'customer';
180
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'sofort' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'card',reference_id?:string};
181
+ }
182
+ export interface CancelForItemsResponse {
183
+ subscription:Subscription;
184
+ customer:Customer;
185
+ card?:Card;
186
+ invoice?:Invoice;
187
+ unbilled_charges?:UnbilledCharge[];
188
+ credit_notes?:CreditNote[];
189
+ }
190
+ export interface CancelForItemsInputParam {
191
+
192
+ end_of_term?:boolean;
193
+ cancel_at?:number;
194
+ credit_option_for_current_term_charges?:CreditOptionForCurrentTermCharges;
195
+ unbilled_charges_option?:UnbilledChargesOption;
196
+ account_receivables_handling?:AccountReceivablesHandling;
197
+ refundable_credits_handling?:RefundableCreditsHandling;
198
+ contract_term_cancel_option?:ContractTermCancelOption;
199
+ invoice_date?:number;
200
+ cancel_reason_code?:string;
201
+ subscription_items?:{item_price_id?:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,unit_price?:number,unit_price_in_decimal?:string}[];
202
+ }
203
+ export interface RegenerateInvoiceResponse {
204
+ invoice?:Invoice;
205
+ unbilled_charges?:UnbilledCharge[];
206
+ }
207
+ export interface RegenerateInvoiceInputParam {
208
+
209
+ date_from?:number;
210
+ date_to?:number;
211
+ prorate?:boolean;
212
+ invoice_immediately?:boolean;
213
+ }
214
+ export interface ListResponse {
215
+ list:{subscription:Subscription,customer:Customer,card?:Card}[];
216
+ next_offset?:string;
217
+ }
218
+ export interface ListInputParam {
219
+ [key: string]: string | number | object | boolean;
220
+ limit?:number;
221
+ offset?:string;
222
+ include_deleted?:boolean;
223
+ id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
224
+ customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
225
+ plan_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
226
+ item_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
227
+ item_price_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
228
+ status?:{in?:string,is?:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing',is_not?:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing',not_in?:string};
229
+ cancel_reason?:{in?:string,is?:'tax_calculation_failed' | 'fraud_review_failed' | 'currency_incompatible_with_gateway' | 'non_compliant_eu_customer' | 'non_compliant_customer' | 'not_paid' | 'no_card',is_not?:'tax_calculation_failed' | 'fraud_review_failed' | 'currency_incompatible_with_gateway' | 'non_compliant_eu_customer' | 'non_compliant_customer' | 'not_paid' | 'no_card',is_present?:'true' | 'false',not_in?:string};
230
+ cancel_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
231
+ remaining_billing_cycles?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,is_present?:'true' | 'false',lt?:string,lte?:string};
232
+ created_at?:{after?:string,before?:string,between?:string,on?:string};
233
+ activated_at?:{after?:string,before?:string,between?:string,is_present?:'true' | 'false',on?:string};
234
+ next_billing_at?:{after?:string,before?:string,between?:string,on?:string};
235
+ cancelled_at?:{after?:string,before?:string,between?:string,on?:string};
236
+ has_scheduled_changes?:{is?:'true' | 'false'};
237
+ updated_at?:{after?:string,before?:string,between?:string,on?:string};
238
+ offline_payment_method?:{in?:string,is?:'bank_transfer' | 'no_preference' | 'ach_credit' | 'boleto' | 'check' | 'sepa_credit' | 'cash',is_not?:'bank_transfer' | 'no_preference' | 'ach_credit' | 'boleto' | 'check' | 'sepa_credit' | 'cash',not_in?:string};
239
+ auto_close_invoices?:{is?:'true' | 'false'};
240
+ override_relationship?:{is?:'true' | 'false'};
241
+ sort_by?:{asc?:'updated_at' | 'created_at',desc?:'updated_at' | 'created_at'};
242
+ business_entity_id?:{is?:string,is_not?:string,starts_with?:string};
243
+ channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
244
+ }
245
+ export interface ImportForItemsResponse {
246
+ subscription:Subscription;
247
+ customer:Customer;
248
+ card?:Card;
249
+ invoice?:Invoice;
250
+ }
251
+ export interface ImportForItemsInputParam {
252
+ [key : string] : any;
253
+ id?:string;
254
+ trial_end?:number;
255
+ billing_cycles?:number;
256
+ net_term_days?:number;
257
+ start_date?:number;
258
+ auto_collection?:AutoCollection;
259
+ po_number?:string;
260
+ coupon_ids?:string[];
261
+ payment_source_id?:string;
262
+ status:'in_trial' | 'paused' | 'future' | 'active' | 'cancelled' | 'non_renewing';
263
+ current_term_end?:number;
264
+ current_term_start?:number;
265
+ trial_start?:number;
266
+ cancelled_at?:number;
267
+ started_at?:number;
268
+ activated_at?:number;
269
+ pause_date?:number;
270
+ resume_date?:number;
271
+ contract_term_billing_cycle_on_renewal?:number;
272
+ create_current_term_invoice?:boolean;
273
+ invoice_notes?:string;
274
+ meta_data?:object;
275
+ cancel_reason_code?:string;
276
+ create_pending_invoices?:boolean;
277
+ auto_close_invoices?:boolean;
278
+ contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',billing_cycle?:number,cancellation_cutoff_period?:number,contract_start?:number,created_at?:number,id?:string,total_amount_raised?:number,total_amount_raised_before_tax?:number};
279
+ transaction?:{amount?:number,date?:number,payment_method?:PaymentMethod,reference_number?:string};
280
+ 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};
281
+ subscription_items?:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
282
+ discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
283
+ charged_items?:{item_price_id?:string,last_charged_at?:number}[];
284
+ 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}[];
285
+ }
286
+ export interface RetrieveAdvanceInvoiceScheduleResponse {
287
+ advance_invoice_schedules:AdvanceInvoiceSchedule[];
288
+ }
289
+
290
+ export interface RemoveScheduledCancellationResponse {
291
+ subscription:Subscription;
292
+ customer:Customer;
293
+ card?:Card;
294
+ }
295
+ export interface RemoveScheduledCancellationInputParam {
296
+
297
+ billing_cycles?:number;
298
+ }
299
+ export interface RetrieveWithScheduledChangesResponse {
300
+ subscription:Subscription;
301
+ customer:Customer;
302
+ card?:Card;
303
+ }
304
+
305
+ export interface ReactivateResponse {
306
+ subscription:Subscription;
307
+ customer:Customer;
308
+ card?:Card;
309
+ invoice?:Invoice;
310
+ unbilled_charges?:UnbilledCharge[];
311
+ }
312
+ export interface ReactivateInputParam {
313
+
314
+ trial_end?:number;
315
+ billing_cycles?:number;
316
+ reactivate_from?:number;
317
+ invoice_immediately?:boolean;
318
+ billing_alignment_mode?:BillingAlignmentMode;
319
+ terms_to_charge?:number;
320
+ invoice_date?:number;
321
+ contract_term_billing_cycle_on_renewal?:number;
322
+ payment_initiator?:'merchant' | 'customer';
323
+ contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
324
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'sofort' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'card',reference_id?:string};
325
+ }
326
+ export interface ChargeFutureRenewalsResponse {
327
+ subscription:Subscription;
328
+ customer:Customer;
329
+ card?:Card;
330
+ invoice?:Invoice;
331
+ advance_invoice_schedules?:AdvanceInvoiceSchedule[];
332
+ }
333
+ export interface ChargeFutureRenewalsInputParam {
334
+
335
+ terms_to_charge?:number;
336
+ invoice_immediately?:boolean;
337
+ schedule_type?:ScheduleType;
338
+ fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
339
+ specific_dates_schedule?:{date?:number,terms_to_charge?:number}[];
340
+ }
341
+ export interface AddChargeAtTermEndResponse {
342
+ estimate:Estimate;
343
+ }
344
+ export interface AddChargeAtTermEndInputParam {
345
+
346
+ amount?:number;
347
+ description:string;
348
+ amount_in_decimal?:string;
349
+ avalara_sale_type?:AvalaraSaleType;
350
+ avalara_transaction_type?:number;
351
+ avalara_service_type?:number;
352
+ date_from?:number;
353
+ date_to?:number;
354
+ }
355
+ export interface RemoveScheduledChangesResponse {
356
+ subscription:Subscription;
357
+ customer:Customer;
358
+ card?:Card;
359
+ credit_notes?:CreditNote[];
360
+ }
361
+
362
+ export interface ChangeTermEndResponse {
363
+ subscription:Subscription;
364
+ customer:Customer;
365
+ card?:Card;
366
+ invoice?:Invoice;
367
+ unbilled_charges?:UnbilledCharge[];
368
+ credit_notes?:CreditNote[];
369
+ }
370
+ export interface ChangeTermEndInputParam {
371
+
372
+ term_ends_at:number;
373
+ prorate?:boolean;
374
+ invoice_immediately?:boolean;
375
+ }
376
+ export interface DeleteResponse {
377
+ subscription:Subscription;
378
+ customer:Customer;
379
+ card?:Card;
380
+ }
381
+
382
+ export interface CreateWithItemsResponse {
383
+ subscription:Subscription;
384
+ customer:Customer;
385
+ card?:Card;
386
+ invoice?:Invoice;
387
+ unbilled_charges?:UnbilledCharge[];
388
+ }
389
+ export interface CreateWithItemsInputParam {
390
+ [key : string] : any;
391
+ id?:string;
392
+ business_entity_id?:string;
393
+ trial_end?:number;
394
+ billing_cycles?:number;
395
+ mandatory_items_to_remove?:string[];
396
+ net_term_days?:number;
397
+ start_date?:number;
398
+ auto_collection?:AutoCollection;
399
+ terms_to_charge?:number;
400
+ billing_alignment_mode?:BillingAlignmentMode;
401
+ po_number?:string;
402
+ coupon_ids?:string[];
403
+ payment_source_id?:string;
404
+ override_relationship?:boolean;
405
+ invoice_notes?:string;
406
+ invoice_date?:number;
407
+ meta_data?:object;
408
+ invoice_immediately?:boolean;
409
+ replace_primary_payment_source?:boolean;
410
+ free_period?:number;
411
+ free_period_unit?:FreePeriodUnit;
412
+ contract_term_billing_cycle_on_renewal?:number;
413
+ create_pending_invoices?:boolean;
414
+ auto_close_invoices?:boolean;
415
+ first_invoice_pending?:boolean;
416
+ trial_end_action?:TrialEndAction;
417
+ payment_initiator?:'merchant' | 'customer';
418
+ 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};
419
+ payment_intent?:{additional_information?:object,gateway_account_id?:string,gw_token?:string,id?:string,payment_method_type?:'giropay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'boleto' | 'direct_debit' | 'sofort' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'card',reference_id?:string};
420
+ contract_term?:{action_at_term_end?:'cancel' | 'renew' | 'evergreen',cancellation_cutoff_period?:number};
421
+ subscription_items?:{billing_cycles?:number,charge_on_event?:ChargeOnEvent,charge_on_option?:ChargeOnOption,charge_once?:boolean,item_price_id:string,quantity?:number,quantity_in_decimal?:string,service_period_days?:number,trial_end?:number,unit_price?:number,unit_price_in_decimal?:string}[];
422
+ discounts?:{amount?:number,apply_on:ApplyOn,duration_type:DurationType,included_in_mrr?:boolean,item_price_id?:string,percentage?:number,period?:number,period_unit?:PeriodUnit}[];
423
+ 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}[];
424
+ }
425
+ export interface ImportUnbilledChargesResponse {
426
+ unbilled_charges:UnbilledCharge[];
427
+ }
428
+ export interface ImportUnbilledChargesInputParam {
429
+
430
+ unbilled_charges?:{amount?:number,amount_in_decimal?:string,date_from:number,date_to:number,description?:string,discount_amount?:number,entity_id?:string,entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc',id?:string,is_advance_charge?:boolean,quantity?:number,quantity_in_decimal?:string,unit_amount?:number,unit_amount_in_decimal?:string,use_for_proration?:boolean}[];
431
+ discounts?:{amount:number,description?:string,entity_id?:string,entity_type?:'item_level_coupon' | 'item_level_discount' | 'document_level_discount' | 'document_level_coupon',unbilled_charge_id?:string}[];
432
+ tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,quantity_used?:number,quantity_used_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string,unbilled_charge_id:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
433
+ }
434
+ export interface RemoveScheduledResumptionResponse {
435
+ subscription:Subscription;
436
+ customer:Customer;
437
+ card?:Card;
438
+ }
439
+
440
+ export interface RetrieveResponse {
441
+ subscription:Subscription;
442
+ customer:Customer;
443
+ card?:Card;
444
+ }
445
+
446
+ export interface ImportContractTermResponse {
447
+ contract_term:ContractTerm;
448
+ }
449
+ export interface ImportContractTermInputParam {
450
+
451
+ contract_term_billing_cycle_on_renewal?:number;
452
+ contract_term?:{action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen',billing_cycle?:number,cancellation_cutoff_period?:number,contract_end?:number,contract_start?:number,created_at?:number,id?:string,status?:'active' | 'cancelled' | 'completed' | 'terminated',total_amount_raised?:number,total_amount_raised_before_tax?:number,total_contract_value?:number,total_contract_value_before_tax?:number};
453
+ }
454
+ export interface OverrideBillingProfileResponse {
455
+ subscription:Subscription;
456
+ payment_source?:PaymentSource;
457
+ }
458
+ export interface OverrideBillingProfileInputParam {
459
+
460
+ payment_source_id?:string;
461
+ auto_collection?:AutoCollection;
462
+ }
463
+ export interface RemoveScheduledPauseResponse {
464
+ subscription:Subscription;
465
+ customer:Customer;
466
+ card?:Card;
467
+ }
468
+
469
+ export interface EditAdvanceInvoiceScheduleResponse {
470
+ advance_invoice_schedules:AdvanceInvoiceSchedule[];
471
+ }
472
+ export interface EditAdvanceInvoiceScheduleInputParam {
473
+
474
+ terms_to_charge?:number;
475
+ schedule_type?:ScheduleType;
476
+ fixed_interval_schedule?:{days_before_renewal?:number,end_date?:number,end_schedule_on?:EndScheduleOn,number_of_occurrences?:number};
477
+ specific_dates_schedule?:{date?:number,id?:string,terms_to_charge?:number}[];
478
+ }
479
+ export interface ListDiscountsResponse {
480
+ list:{discount:Discount}[];
481
+ next_offset?:string;
482
+ }
483
+ export interface ListDiscountsInputParam {
484
+ [key: string]: string | number | object | boolean;
485
+ limit?:number;
486
+ offset?:string;
487
+ }
488
+ export interface ContractTermsForSubscriptionResponse {
489
+ list:{contract_term:ContractTerm}[];
490
+ next_offset?:string;
491
+ }
492
+ export interface ContractTermsForSubscriptionInputParam {
493
+ [key: string]: string | number | object | boolean;
494
+ limit?:number;
495
+ offset?:string;
496
+ }
497
+ export interface PauseResponse {
498
+ subscription:Subscription;
499
+ customer:Customer;
500
+ card?:Card;
501
+ invoice?:Invoice;
502
+ unbilled_charges?:UnbilledCharge[];
503
+ credit_notes?:CreditNote[];
504
+ }
505
+ export interface PauseInputParam {
506
+
507
+ pause_option?:PauseOption;
508
+ pause_date?:number;
509
+ unbilled_charges_handling?:UnbilledChargesHandling;
510
+ invoice_dunning_handling?:InvoiceDunningHandling;
511
+ skip_billing_cycles?:number;
512
+ resume_date?:number;
513
+ }
514
+ export interface SubscriptionItem {
515
+ item_price_id?:string;
516
+ item_type?:'charge' | 'addon' | 'plan';
517
+ quantity?:number;
518
+ quantity_in_decimal?:string;
519
+ unit_price?:number;
520
+ unit_price_in_decimal?:string;
521
+ amount?:number;
522
+ amount_in_decimal?:string;
523
+ free_quantity?:number;
524
+ free_quantity_in_decimal?:string;
525
+ trial_end?:number;
526
+ billing_cycles?:number;
527
+ service_period_days?:number;
528
+ charge_on_event?:'subscription_creation' | 'subscription_activation' | 'subscription_trial_start' | 'contract_termination' | 'plan_activation';
529
+ charge_once?:boolean;
530
+ charge_on_option?:'on_event' | 'immediately';
531
+ }
532
+ export interface ItemTier {
533
+ item_price_id?:string;
534
+ starting_unit?:number;
535
+ ending_unit?:number;
536
+ price?:number;
537
+ starting_unit_in_decimal?:string;
538
+ ending_unit_in_decimal?:string;
539
+ price_in_decimal?:string;
540
+ index?:number;
541
+ }
542
+ export interface ChargedItem {
543
+ item_price_id?:string;
544
+ last_charged_at?:number;
545
+ }
546
+ export interface Coupon {
547
+ coupon_id?:string;
548
+ apply_till?:number;
549
+ applied_count?:number;
550
+ coupon_code?:string;
551
+ }
552
+ export interface ShippingAddress {
553
+ first_name?:string;
554
+ last_name?:string;
555
+ email?:string;
556
+ company?:string;
557
+ phone?:string;
558
+ line1?:string;
559
+ line2?:string;
560
+ line3?:string;
561
+ city?:string;
562
+ state_code?:string;
563
+ state?:string;
564
+ country?:string;
565
+ zip?:string;
566
+ validation_status?:ValidationStatus;
567
+ index?:number;
568
+ }
569
+ export interface ReferralInfo {
570
+ referral_code?:string;
571
+ coupon_code?:string;
572
+ referrer_id?:string;
573
+ external_reference_id?:string;
574
+ reward_status?:'pending' | 'paid' | 'invalid';
575
+ referral_system?:ReferralSystem;
576
+ account_id?:string;
577
+ campaign_id?:string;
578
+ external_campaign_id?:string;
579
+ friend_offer_type?:FriendOfferType;
580
+ referrer_reward_type?:ReferrerRewardType;
581
+ notify_referral_system?:NotifyReferralSystem;
582
+ destination_url?:string;
583
+ post_purchase_widget_enabled?:boolean;
584
+ }
585
+ export interface ContractTerm {
586
+ id?:string;
587
+ status?:'active' | 'cancelled' | 'completed' | 'terminated';
588
+ contract_start?:number;
589
+ contract_end?:number;
590
+ billing_cycle?:number;
591
+ action_at_term_end?:'cancel' | 'renew_once' | 'renew' | 'evergreen';
592
+ total_contract_value?:number;
593
+ total_contract_value_before_tax?:number;
594
+ cancellation_cutoff_period?:number;
595
+ created_at?:number;
596
+ subscription_id?:string;
597
+ remaining_billing_cycles?:number;
598
+ }
599
+ export interface Discount {
600
+ id?:string;
601
+ invoice_name?:string;
602
+ type?:'fixed_amount' | 'percentage';
603
+ percentage?:number;
604
+ amount?:number;
605
+ currency_code?:string;
606
+ duration_type?:'limited_period' | 'one_time' | 'forever';
607
+ period?:number;
608
+ period_unit?:'week' | 'month' | 'year' | 'day';
609
+ included_in_mrr?:boolean;
610
+ apply_on?:'specific_item_price' | 'invoice_amount';
611
+ item_price_id?:string;
612
+ created_at?:number;
613
+ apply_till?:number;
614
+ applied_count?:number;
615
+ coupon_id?:string;
616
+ index?:number;
617
+ }
618
+ }
619
+ }
@@ -0,0 +1,41 @@
1
+ declare module 'chargebee' {
2
+ export interface SubscriptionEntitlement {
3
+
4
+ subscription_id:string;
5
+ feature_id?:string;
6
+ feature_name?:string;
7
+ feature_unit?:string;
8
+ value?:string;
9
+ name?:string;
10
+ is_overridden:boolean;
11
+ is_enabled:boolean;
12
+ expires_at?:number;
13
+ components?:SubscriptionEntitlement.Component;
14
+ }
15
+ export namespace SubscriptionEntitlement {
16
+ export class SubscriptionEntitlementResource {
17
+ set_subscription_entitlement_availability(subscription_id:string, input:SetSubscriptionEntitlementAvailabilityInputParam):ChargebeeRequest<SetSubscriptionEntitlementAvailabilityResponse>;
18
+ subscription_entitlements_for_subscription(subscription_id:string, input?:SubscriptionEntitlementsForSubscriptionInputParam):ChargebeeRequest<SubscriptionEntitlementsForSubscriptionResponse>;
19
+ }
20
+ export interface SetSubscriptionEntitlementAvailabilityResponse {
21
+ subscription_entitlement:SubscriptionEntitlement;
22
+ }
23
+ export interface SetSubscriptionEntitlementAvailabilityInputParam {
24
+
25
+ is_enabled:boolean;
26
+ subscription_entitlements?:{feature_id:string}[];
27
+ }
28
+ export interface SubscriptionEntitlementsForSubscriptionResponse {
29
+ list:{subscription_entitlement:SubscriptionEntitlement}[];
30
+ next_offset?:string;
31
+ }
32
+ export interface SubscriptionEntitlementsForSubscriptionInputParam {
33
+ [key: string]: string | number | object | boolean;
34
+ limit?:number;
35
+ offset?:string;
36
+ }
37
+ export interface Component {
38
+ entitlement_overrides?:EntitlementOverride;
39
+ }
40
+ }
41
+ }