chargebee 2.24.0 → 2.25.1

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