chargebee 2.23.1 → 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 (67) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +2 -2
  3. package/lib/chargebee.js +1 -1
  4. package/lib/resources/api_endpoints.js +15 -0
  5. package/package.json +2 -1
  6. package/types/core.d.ts +80 -0
  7. package/types/index.d.ts +92 -0
  8. package/types/resources/Address.d.ts +58 -0
  9. package/types/resources/AdvanceInvoiceSchedule.d.ts +26 -0
  10. package/types/resources/AttachedItem.d.ts +84 -0
  11. package/types/resources/Card.d.ts +88 -0
  12. package/types/resources/Comment.d.ts +52 -0
  13. package/types/resources/Contact.d.ts +15 -0
  14. package/types/resources/ContractTerm.d.ts +18 -0
  15. package/types/resources/Coupon.d.ts +150 -0
  16. package/types/resources/CouponCode.d.ts +25 -0
  17. package/types/resources/CouponSet.d.ts +75 -0
  18. package/types/resources/CreditNote.d.ts +337 -0
  19. package/types/resources/CreditNoteEstimate.d.ts +96 -0
  20. package/types/resources/Customer.d.ts +440 -0
  21. package/types/resources/DifferentialPrice.d.ts +88 -0
  22. package/types/resources/Discount.d.ts +23 -0
  23. package/types/resources/Download.d.ts +9 -0
  24. package/types/resources/EntitlementOverride.d.ts +37 -0
  25. package/types/resources/Estimate.d.ts +214 -0
  26. package/types/resources/Event.d.ts +42 -0
  27. package/types/resources/Export.d.ts +182 -0
  28. package/types/resources/Feature.d.ts +90 -0
  29. package/types/resources/Gift.d.ts +97 -0
  30. package/types/resources/Hierarchy.d.ts +11 -0
  31. package/types/resources/HostedPage.d.ts +242 -0
  32. package/types/resources/ImpactedItem.d.ts +17 -0
  33. package/types/resources/ImpactedSubscription.d.ts +17 -0
  34. package/types/resources/InAppSubscription.d.ts +52 -0
  35. package/types/resources/Invoice.d.ts +590 -0
  36. package/types/resources/InvoiceEstimate.d.ts +96 -0
  37. package/types/resources/Item.d.ts +118 -0
  38. package/types/resources/ItemEntitlement.d.ts +55 -0
  39. package/types/resources/ItemFamily.d.ts +59 -0
  40. package/types/resources/ItemPrice.d.ts +195 -0
  41. package/types/resources/Media.d.ts +10 -0
  42. package/types/resources/NonSubscription.d.ts +23 -0
  43. package/types/resources/Order.d.ts +305 -0
  44. package/types/resources/PaymentIntent.d.ts +71 -0
  45. package/types/resources/PaymentReferenceNumber.d.ts +10 -0
  46. package/types/resources/PaymentSource.d.ts +264 -0
  47. package/types/resources/PaymentVoucher.d.ts +74 -0
  48. package/types/resources/PortalSession.d.ts +57 -0
  49. package/types/resources/PromotionalCredit.d.ts +86 -0
  50. package/types/resources/Purchase.d.ts +46 -0
  51. package/types/resources/Quote.d.ts +388 -0
  52. package/types/resources/QuoteLineGroup.d.ts +83 -0
  53. package/types/resources/QuotedCharge.d.ts +57 -0
  54. package/types/resources/QuotedSubscription.d.ts +82 -0
  55. package/types/resources/ResourceMigration.d.ts +27 -0
  56. package/types/resources/SiteMigrationDetail.d.ts +31 -0
  57. package/types/resources/Subscription.d.ts +619 -0
  58. package/types/resources/SubscriptionEntitlement.d.ts +41 -0
  59. package/types/resources/SubscriptionEstimate.d.ts +49 -0
  60. package/types/resources/TaxWithheld.d.ts +13 -0
  61. package/types/resources/ThirdPartyPaymentMethod.d.ts +10 -0
  62. package/types/resources/TimeMachine.d.ts +38 -0
  63. package/types/resources/Token.d.ts +50 -0
  64. package/types/resources/Transaction.d.ts +170 -0
  65. package/types/resources/UnbilledCharge.d.ts +91 -0
  66. package/types/resources/Usage.d.ts +76 -0
  67. package/types/resources/VirtualBankAccount.d.ts +75 -0
@@ -0,0 +1,590 @@
1
+ declare module 'chargebee' {
2
+ export interface Invoice {
3
+
4
+ id:string;
5
+ po_number?:string;
6
+ customer_id:string;
7
+ subscription_id?:string;
8
+ recurring:boolean;
9
+ status:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
10
+ vat_number?:string;
11
+ price_type:PriceType;
12
+ date?:number;
13
+ due_date?:number;
14
+ net_term_days?:number;
15
+ exchange_rate?:number;
16
+ currency_code:string;
17
+ total?:number;
18
+ amount_paid?:number;
19
+ amount_adjusted?:number;
20
+ write_off_amount?:number;
21
+ credits_applied?:number;
22
+ amount_due?:number;
23
+ paid_at?:number;
24
+ dunning_status?:'in_progress' | 'stopped' | 'success' | 'exhausted';
25
+ next_retry_at?:number;
26
+ voided_at?:number;
27
+ resource_version?:number;
28
+ updated_at?:number;
29
+ sub_total:number;
30
+ sub_total_in_local_currency?:number;
31
+ total_in_local_currency?:number;
32
+ local_currency_code?:string;
33
+ tax:number;
34
+ local_currency_exchange_rate?:number;
35
+ first_invoice?:boolean;
36
+ new_sales_amount?:number;
37
+ has_advance_charges?:boolean;
38
+ term_finalized:boolean;
39
+ is_gifted:boolean;
40
+ generated_at?:number;
41
+ expected_payment_date?:number;
42
+ amount_to_collect?:number;
43
+ round_off_amount?:number;
44
+ payment_owner?:string;
45
+ void_reason_code?:string;
46
+ deleted:boolean;
47
+ tax_category?:string;
48
+ vat_number_prefix?:string;
49
+ channel?:Channel;
50
+ business_entity_id?:string;
51
+ line_items?:Invoice.LineItem[];
52
+ discounts?:Invoice.Discount[];
53
+ line_item_discounts?:Invoice.LineItemDiscount[];
54
+ taxes?:Invoice.Tax[];
55
+ line_item_taxes?:Invoice.LineItemTax[];
56
+ line_item_tiers?:Invoice.LineItemTier[];
57
+ linked_payments?:Invoice.InvoiceTransaction[];
58
+ dunning_attempts?:Invoice.DunningAttempt[];
59
+ applied_credits?:Invoice.AppliedCredit[];
60
+ adjustment_credit_notes?:Invoice.CreatedCreditNote[];
61
+ issued_credit_notes?:Invoice.CreatedCreditNote[];
62
+ linked_orders?:Invoice.LinkedOrder[];
63
+ notes?:Invoice.Note[];
64
+ shipping_address?:Invoice.ShippingAddress;
65
+ billing_address?:Invoice.BillingAddress;
66
+ einvoice?:Invoice.Einvoice;
67
+ linked_taxes_withheld?:Invoice.LinkedTaxWithheld[];
68
+ }
69
+ export namespace Invoice {
70
+ export class InvoiceResource {
71
+ delete_line_items(invoice_id:string, input?:DeleteLineItemsInputParam):ChargebeeRequest<DeleteLineItemsResponse>;
72
+ remove_credit_note(invoice_id:string, input?:RemoveCreditNoteInputParam):ChargebeeRequest<RemoveCreditNoteResponse>;
73
+ remove_payment(invoice_id:string, input?:RemovePaymentInputParam):ChargebeeRequest<RemovePaymentResponse>;
74
+ stop_dunning(invoice_id:string, input?:StopDunningInputParam):ChargebeeRequest<StopDunningResponse>;
75
+ apply_payments(invoice_id:string, input?:ApplyPaymentsInputParam):ChargebeeRequest<ApplyPaymentsResponse>;
76
+ void_invoice(invoice_id:string, input?:VoidInvoiceInputParam):ChargebeeRequest<VoidInvoiceResponse>;
77
+ add_charge(invoice_id:string, input:AddChargeInputParam):ChargebeeRequest<AddChargeResponse>;
78
+ send_einvoice(invoice_id:string):ChargebeeRequest<SendEinvoiceResponse>;
79
+ write_off(invoice_id:string, input?:WriteOffInputParam):ChargebeeRequest<WriteOffResponse>;
80
+ add_charge_item(invoice_id:string, input?:AddChargeItemInputParam):ChargebeeRequest<AddChargeItemResponse>;
81
+ list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
82
+ close(invoice_id:string, input?:CloseInputParam):ChargebeeRequest<CloseResponse>;
83
+ apply_credits(invoice_id:string, input?:ApplyCreditsInputParam):ChargebeeRequest<ApplyCreditsResponse>;
84
+ retrieve(invoice_id:string):ChargebeeRequest<RetrieveResponse>;
85
+ create_for_charge_items_and_charges(input?:CreateForChargeItemsAndChargesInputParam):ChargebeeRequest<CreateForChargeItemsAndChargesResponse>;
86
+ update_details(invoice_id:string, input?:UpdateDetailsInputParam):ChargebeeRequest<UpdateDetailsResponse>;
87
+ record_payment(invoice_id:string, input?:RecordPaymentInputParam):ChargebeeRequest<RecordPaymentResponse>;
88
+ delete(invoice_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
89
+ import_invoice(input:ImportInvoiceInputParam):ChargebeeRequest<ImportInvoiceResponse>;
90
+ record_tax_withheld(invoice_id:string, input?:RecordTaxWithheldInputParam):ChargebeeRequest<RecordTaxWithheldResponse>;
91
+ resend_einvoice(invoice_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
92
+ remove_tax_withheld(invoice_id:string, input?:RemoveTaxWithheldInputParam):ChargebeeRequest<RemoveTaxWithheldResponse>;
93
+ list_payment_reference_numbers(input?:ListPaymentReferenceNumbersInputParam):ChargebeeRequest<ListPaymentReferenceNumbersResponse>;
94
+ collect_payment(invoice_id:string, input?:CollectPaymentInputParam):ChargebeeRequest<CollectPaymentResponse>;
95
+ sync_usages(invoice_id:string):ChargebeeRequest<SyncUsagesResponse>;
96
+ refund(invoice_id:string, input?:RefundInputParam):ChargebeeRequest<RefundResponse>;
97
+ record_refund(invoice_id:string, input?:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
98
+ pdf(invoice_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
99
+ download_einvoice(invoice_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
100
+ }
101
+ export interface DeleteLineItemsResponse {
102
+ invoice:Invoice;
103
+ }
104
+ export interface DeleteLineItemsInputParam {
105
+
106
+ line_items?:{id?:string}[];
107
+ }
108
+ export interface RemoveCreditNoteResponse {
109
+ invoice:Invoice;
110
+ credit_note:CreditNote;
111
+ }
112
+ export interface RemoveCreditNoteInputParam {
113
+
114
+ credit_note?:{id:string};
115
+ }
116
+ export interface RemovePaymentResponse {
117
+ invoice:Invoice;
118
+ transaction:Transaction;
119
+ }
120
+ export interface RemovePaymentInputParam {
121
+
122
+ transaction?:{id:string};
123
+ }
124
+ export interface StopDunningResponse {
125
+ invoice:Invoice;
126
+ }
127
+ export interface StopDunningInputParam {
128
+
129
+ comment?:string;
130
+ }
131
+ export interface ApplyPaymentsResponse {
132
+ invoice:Invoice;
133
+ }
134
+ export interface ApplyPaymentsInputParam {
135
+
136
+ comment?:string;
137
+ transactions?:{id?:string}[];
138
+ }
139
+ export interface VoidInvoiceResponse {
140
+ invoice:Invoice;
141
+ credit_note?:CreditNote;
142
+ }
143
+ export interface VoidInvoiceInputParam {
144
+
145
+ comment?:string;
146
+ void_reason_code?:string;
147
+ }
148
+ export interface AddChargeResponse {
149
+ invoice:Invoice;
150
+ }
151
+ export interface AddChargeInputParam {
152
+
153
+ amount:number;
154
+ description:string;
155
+ avalara_sale_type?:AvalaraSaleType;
156
+ avalara_transaction_type?:number;
157
+ avalara_service_type?:number;
158
+ comment?:string;
159
+ subscription_id?:string;
160
+ line_item?:{date_from?:number,date_to?:number};
161
+ }
162
+ export interface SendEinvoiceResponse {
163
+ invoice:Invoice;
164
+ }
165
+
166
+ export interface WriteOffResponse {
167
+ invoice:Invoice;
168
+ credit_note:CreditNote;
169
+ }
170
+ export interface WriteOffInputParam {
171
+
172
+ comment?:string;
173
+ }
174
+ export interface AddChargeItemResponse {
175
+ invoice:Invoice;
176
+ }
177
+ export interface AddChargeItemInputParam {
178
+
179
+ comment?:string;
180
+ subscription_id?:string;
181
+ item_price?:{date_from?:number,date_to?:number,item_price_id:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string};
182
+ item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,price?:number,price_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string}[];
183
+ }
184
+ export interface ListResponse {
185
+ list:{invoice:Invoice}[];
186
+ next_offset?:string;
187
+ }
188
+ export interface ListInputParam {
189
+ [key: string]: string | number | object | boolean;
190
+ limit?:number;
191
+ offset?:string;
192
+ include_deleted?:boolean;
193
+ id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
194
+ subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
195
+ customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
196
+ recurring?:{is?:'true' | 'false'};
197
+ status?:{in?:string,is?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due',is_not?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due',not_in?:string};
198
+ price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
199
+ date?:{after?:string,before?:string,between?:string,on?:string};
200
+ paid_at?:{after?:string,before?:string,between?:string,on?:string};
201
+ total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
202
+ amount_paid?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
203
+ amount_adjusted?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
204
+ credits_applied?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
205
+ amount_due?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
206
+ dunning_status?:{in?:string,is?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_not?:'in_progress' | 'stopped' | 'success' | 'exhausted',is_present?:'true' | 'false',not_in?:string};
207
+ payment_owner?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
208
+ updated_at?:{after?:string,before?:string,between?:string,on?:string};
209
+ channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
210
+ voided_at?:{after?:string,before?:string,between?:string,on?:string};
211
+ void_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
212
+ sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
213
+ einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
214
+ }
215
+ export interface CloseResponse {
216
+ invoice:Invoice;
217
+ }
218
+ export interface CloseInputParam {
219
+
220
+ comment?:string;
221
+ invoice_note?:string;
222
+ remove_general_note?:boolean;
223
+ invoice_date?:number;
224
+ notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
225
+ }
226
+ export interface ApplyCreditsResponse {
227
+ invoice:Invoice;
228
+ }
229
+ export interface ApplyCreditsInputParam {
230
+
231
+ comment?:string;
232
+ credit_notes?:{id?:string}[];
233
+ }
234
+ export interface RetrieveResponse {
235
+ invoice:Invoice;
236
+ }
237
+
238
+ export interface CreateForChargeItemsAndChargesResponse {
239
+ invoice:Invoice;
240
+ }
241
+ export interface CreateForChargeItemsAndChargesInputParam {
242
+
243
+ customer_id?:string;
244
+ subscription_id?:string;
245
+ currency_code?:string;
246
+ invoice_note?:string;
247
+ remove_general_note?:boolean;
248
+ po_number?:string;
249
+ coupon_ids?:string[];
250
+ authorization_transaction_id?:string;
251
+ payment_source_id?:string;
252
+ auto_collection?:AutoCollection;
253
+ invoice_date?:number;
254
+ token_id?:string;
255
+ replace_primary_payment_source?:boolean;
256
+ retain_payment_source?:boolean;
257
+ 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};
258
+ 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};
259
+ bank_account?:{account_holder_type?:AccountHolderType,account_number?:string,account_type?:AccountType,bank_code?:string,bank_name?:string,billing_address?:object,company?:string,echeck_type?:EcheckType,email?:string,first_name?:string,gateway_account_id?:string,iban?:string,issuing_country?:string,last_name?:string,phone?:string,routing_number?:string,swedish_identity_number?:string};
260
+ payment_method?:{additional_information?:object,gateway_account_id?:string,issuing_country?:string,reference_id?:string,tmp_token?:string,type?:Type};
261
+ 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};
262
+ item_prices?:{date_from?:number,date_to?:number,item_price_id?:string,quantity?:number,quantity_in_decimal?:string,unit_price?:number,unit_price_in_decimal?:string}[];
263
+ 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}[];
264
+ charges?:{amount?:number,amount_in_decimal?:string,avalara_sale_type?:AvalaraSaleType,avalara_service_type?:number,avalara_tax_code?:string,avalara_transaction_type?:number,date_from?:number,date_to?:number,description?:string,hsn_code?:string,tax_profile_id?:string,taxable?:boolean,taxjar_product_code?:string}[];
265
+ notes_to_remove?:{entity_id?:string,entity_type?:EntityType}[];
266
+ discounts?:{amount?:number,apply_on:ApplyOn,item_price_id?:string,percentage?:number}[];
267
+ }
268
+ export interface UpdateDetailsResponse {
269
+ invoice:Invoice;
270
+ }
271
+ export interface UpdateDetailsInputParam {
272
+
273
+ vat_number?:string;
274
+ vat_number_prefix?:string;
275
+ po_number?:string;
276
+ comment?:string;
277
+ 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};
278
+ 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};
279
+ }
280
+ export interface RecordPaymentResponse {
281
+ invoice:Invoice;
282
+ transaction:Transaction;
283
+ }
284
+ export interface RecordPaymentInputParam {
285
+
286
+ comment?:string;
287
+ transaction?:{amount?:number,date?:number,error_code?:string,error_text?:string,id_at_gateway?:string,payment_method:PaymentMethod,reference_number?:string,status?:'success' | 'failure'};
288
+ }
289
+ export interface DeleteResponse {
290
+ invoice:Invoice;
291
+ }
292
+ export interface DeleteInputParam {
293
+
294
+ comment?:string;
295
+ claim_credits?:boolean;
296
+ }
297
+ export interface ImportInvoiceResponse {
298
+ invoice:Invoice;
299
+ credit_note?:CreditNote;
300
+ }
301
+ export interface ImportInvoiceInputParam {
302
+
303
+ id:string;
304
+ currency_code?:string;
305
+ customer_id?:string;
306
+ subscription_id?:string;
307
+ po_number?:string;
308
+ price_type?:PriceType;
309
+ tax_override_reason?:TaxOverrideReason;
310
+ vat_number?:string;
311
+ vat_number_prefix?:string;
312
+ date:number;
313
+ total:number;
314
+ round_off?:number;
315
+ status?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
316
+ voided_at?:number;
317
+ void_reason_code?:string;
318
+ is_written_off?:boolean;
319
+ write_off_amount?:number;
320
+ write_off_date?:number;
321
+ due_date?:number;
322
+ net_term_days?:number;
323
+ has_advance_charges?:boolean;
324
+ use_for_proration?:boolean;
325
+ credit_note?:{id?:string};
326
+ 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};
327
+ 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};
328
+ line_items?:{amount?:number,amount_in_decimal?:string,date_from?:number,date_to?:number,description:string,entity_id?:string,entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc',id?:string,item_level_discount1_amount?:number,item_level_discount1_entity_id?:string,item_level_discount2_amount?:number,item_level_discount2_entity_id?:string,quantity?:number,quantity_in_decimal?:string,subscription_id?:string,tax10_amount?:number,tax10_name?:string,tax1_amount?:number,tax1_name?:string,tax2_amount?:number,tax2_name?:string,tax3_amount?:number,tax3_name?:string,tax4_amount?:number,tax4_name?:string,tax5_amount?:number,tax5_name?:string,tax6_amount?:number,tax6_name?:string,tax7_amount?:number,tax7_name?:string,tax8_amount?:number,tax8_name?:string,tax9_amount?:number,tax9_name?:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
329
+ payment_reference_numbers?:{id?:string,number:string,type:'frn' | 'kid' | 'fik' | 'ocr'}[];
330
+ line_item_tiers?:{ending_unit?:number,ending_unit_in_decimal?:string,line_item_id:string,quantity_used?:number,quantity_used_in_decimal?:string,starting_unit?:number,starting_unit_in_decimal?:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
331
+ discounts?:{amount:number,description?:string,entity_id?:string,entity_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'document_level_discount' | 'document_level_coupon',line_item_id?:string}[];
332
+ taxes?:{amount?:number,description?:string,juris_code?:string,juris_name?:string,juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state',name:string,rate:number}[];
333
+ payments?:{amount:number,date?:number,payment_method:PaymentMethod,reference_number?:string}[];
334
+ notes?:{entity_id?:string,entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price',note?:string}[];
335
+ }
336
+ export interface RecordTaxWithheldResponse {
337
+ invoice:Invoice;
338
+ }
339
+ export interface RecordTaxWithheldInputParam {
340
+
341
+ tax_withheld?:{amount:number,date?:number,description?:string,reference_number?:string};
342
+ }
343
+ export interface ResendEinvoiceResponse {
344
+ invoice:Invoice;
345
+ }
346
+
347
+ export interface RemoveTaxWithheldResponse {
348
+ invoice:Invoice;
349
+ }
350
+ export interface RemoveTaxWithheldInputParam {
351
+
352
+ tax_withheld?:{id:string};
353
+ }
354
+ export interface ListPaymentReferenceNumbersResponse {
355
+ list:{payment_reference_number:PaymentReferenceNumber}[];
356
+ next_offset?:string;
357
+ }
358
+ export interface ListPaymentReferenceNumbersInputParam {
359
+ [key: string]: string | number | object | boolean;
360
+ limit?:number;
361
+ offset?:string;
362
+ id?:{in?:string,is?:string};
363
+ payment_reference_number?:{number?:{in?:string,is?:string}};
364
+ }
365
+ export interface CollectPaymentResponse {
366
+ invoice:Invoice;
367
+ transaction:Transaction;
368
+ }
369
+ export interface CollectPaymentInputParam {
370
+
371
+ amount?:number;
372
+ authorization_transaction_id?:string;
373
+ payment_source_id?:string;
374
+ comment?:string;
375
+ payment_initiator?:'merchant' | 'customer';
376
+ }
377
+ export interface SyncUsagesResponse {
378
+ invoice:Invoice;
379
+ }
380
+
381
+ export interface RefundResponse {
382
+ invoice:Invoice;
383
+ transaction:Transaction;
384
+ credit_note?:CreditNote;
385
+ }
386
+ export interface RefundInputParam {
387
+
388
+ refund_amount?:number;
389
+ comment?:string;
390
+ customer_notes?:string;
391
+ credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver'};
392
+ }
393
+ export interface RecordRefundResponse {
394
+ invoice:Invoice;
395
+ transaction?:Transaction;
396
+ credit_note?:CreditNote;
397
+ }
398
+ export interface RecordRefundInputParam {
399
+
400
+ comment?:string;
401
+ customer_notes?:string;
402
+ transaction?:{amount?:number,date:number,payment_method:PaymentMethod,reference_number?:string};
403
+ credit_note?:{create_reason_code?:string,reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'chargeback' | 'order_change' | 'waiver'};
404
+ }
405
+ export interface PdfResponse {
406
+ download:Download;
407
+ }
408
+ export interface PdfInputParam {
409
+
410
+ disposition_type?:DispositionType;
411
+ }
412
+ export interface DownloadEinvoiceResponse {
413
+ downloads:Download[];
414
+ }
415
+
416
+ export interface LineItem {
417
+ id?:string;
418
+ subscription_id?:string;
419
+ date_from?:number;
420
+ date_to?:number;
421
+ unit_amount?:number;
422
+ quantity?:number;
423
+ amount?:number;
424
+ pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
425
+ is_taxed?:boolean;
426
+ tax_amount?:number;
427
+ tax_rate?:number;
428
+ unit_amount_in_decimal?:string;
429
+ quantity_in_decimal?:string;
430
+ amount_in_decimal?:string;
431
+ discount_amount?:number;
432
+ item_level_discount_amount?:number;
433
+ reference_line_item_id?:string;
434
+ description?:string;
435
+ entity_description?:string;
436
+ entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
437
+ tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
438
+ entity_id?:string;
439
+ customer_id?:string;
440
+ }
441
+ export interface Discount {
442
+ amount?:number;
443
+ description?:string;
444
+ line_item_id?:string;
445
+ entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
446
+ discount_type?:'fixed_amount' | 'percentage';
447
+ entity_id?:string;
448
+ coupon_set_code?:string;
449
+ }
450
+ export interface LineItemDiscount {
451
+ line_item_id?:string;
452
+ discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
453
+ coupon_id?:string;
454
+ entity_id?:string;
455
+ discount_amount?:number;
456
+ }
457
+ export interface Tax {
458
+ name?:string;
459
+ amount?:number;
460
+ description?:string;
461
+ }
462
+ export interface LineItemTax {
463
+ line_item_id?:string;
464
+ tax_name?:string;
465
+ tax_rate?:number;
466
+ is_partial_tax_applied?:boolean;
467
+ is_non_compliance_tax?:boolean;
468
+ taxable_amount?:number;
469
+ tax_amount?:number;
470
+ tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
471
+ tax_juris_name?:string;
472
+ tax_juris_code?:string;
473
+ tax_amount_in_local_currency?:number;
474
+ local_currency_code?:string;
475
+ }
476
+ export interface LineItemTier {
477
+ line_item_id?:string;
478
+ starting_unit?:number;
479
+ ending_unit?:number;
480
+ quantity_used?:number;
481
+ unit_amount?:number;
482
+ starting_unit_in_decimal?:string;
483
+ ending_unit_in_decimal?:string;
484
+ quantity_used_in_decimal?:string;
485
+ unit_amount_in_decimal?:string;
486
+ }
487
+ export interface InvoiceTransaction {
488
+ txn_id?:string;
489
+ applied_amount?:number;
490
+ applied_at?:number;
491
+ txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
492
+ txn_date?:number;
493
+ txn_amount?:number;
494
+ }
495
+ export interface DunningAttempt {
496
+ attempt?:number;
497
+ transaction_id?:string;
498
+ dunning_type?:'offline' | 'auto_collect' | 'direct_debit';
499
+ created_at?:number;
500
+ txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
501
+ txn_amount?:number;
502
+ }
503
+ export interface AppliedCredit {
504
+ cn_id?:string;
505
+ applied_amount?:number;
506
+ applied_at?:number;
507
+ cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
508
+ cn_create_reason_code?:string;
509
+ cn_date?:number;
510
+ cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
511
+ }
512
+ export interface CreatedCreditNote {
513
+ cn_id?:string;
514
+ cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
515
+ cn_create_reason_code?:string;
516
+ cn_date?:number;
517
+ cn_total?:number;
518
+ cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
519
+ }
520
+ export interface CreatedCreditNote {
521
+ cn_id?:string;
522
+ cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
523
+ cn_create_reason_code?:string;
524
+ cn_date?:number;
525
+ cn_total?:number;
526
+ cn_status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
527
+ }
528
+ export interface LinkedOrder {
529
+ id?:string;
530
+ document_number?:string;
531
+ status?:'new' | 'partially_delivered' | 'queued' | 'delivered' | 'on_hold' | 'shipped' | 'processing' | 'cancelled' | 'voided' | 'complete' | 'awaiting_shipment' | 'returned';
532
+ order_type?:'system_generated' | 'manual';
533
+ reference_id?:string;
534
+ fulfillment_status?:string;
535
+ batch_id?:string;
536
+ created_at?:number;
537
+ }
538
+ export interface Note {
539
+ entity_type?:'addon_item_price' | 'coupon' | 'plan_item_price' | 'charge_item_price' | 'tax' | 'subscription' | 'customer';
540
+ note?:string;
541
+ entity_id?:string;
542
+ }
543
+ export interface ShippingAddress {
544
+ first_name?:string;
545
+ last_name?:string;
546
+ email?:string;
547
+ company?:string;
548
+ phone?:string;
549
+ line1?:string;
550
+ line2?:string;
551
+ line3?:string;
552
+ city?:string;
553
+ state_code?:string;
554
+ state?:string;
555
+ country?:string;
556
+ zip?:string;
557
+ validation_status?:ValidationStatus;
558
+ index?:number;
559
+ }
560
+ export interface BillingAddress {
561
+ first_name?:string;
562
+ last_name?:string;
563
+ email?:string;
564
+ company?:string;
565
+ phone?:string;
566
+ line1?:string;
567
+ line2?:string;
568
+ line3?:string;
569
+ city?:string;
570
+ state_code?:string;
571
+ state?:string;
572
+ country?:string;
573
+ zip?:string;
574
+ validation_status?:ValidationStatus;
575
+ }
576
+ export interface Einvoice {
577
+ id?:string;
578
+ reference_number?:string;
579
+ status?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
580
+ message?:string;
581
+ }
582
+ export interface LinkedTaxWithheld {
583
+ id?:string;
584
+ amount?:number;
585
+ description?:string;
586
+ date?:number;
587
+ reference_number?:string;
588
+ }
589
+ }
590
+ }
@@ -0,0 +1,96 @@
1
+ declare module 'chargebee' {
2
+ export interface InvoiceEstimate {
3
+
4
+ recurring:boolean;
5
+ price_type:PriceType;
6
+ currency_code:string;
7
+ sub_total:number;
8
+ total?:number;
9
+ credits_applied?:number;
10
+ amount_paid?:number;
11
+ amount_due?:number;
12
+ round_off_amount?:number;
13
+ customer_id?:string;
14
+ line_items?:InvoiceEstimate.LineItem[];
15
+ discounts?:InvoiceEstimate.Discount[];
16
+ taxes?:InvoiceEstimate.Tax[];
17
+ line_item_taxes?:InvoiceEstimate.LineItemTax[];
18
+ line_item_tiers?:InvoiceEstimate.LineItemTier[];
19
+ line_item_discounts?:InvoiceEstimate.LineItemDiscount[];
20
+ }
21
+ export namespace InvoiceEstimate {
22
+
23
+
24
+ export interface LineItem {
25
+ id?:string;
26
+ subscription_id?:string;
27
+ date_from?:number;
28
+ date_to?:number;
29
+ unit_amount?:number;
30
+ quantity?:number;
31
+ amount?:number;
32
+ pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
33
+ is_taxed?:boolean;
34
+ tax_amount?:number;
35
+ tax_rate?:number;
36
+ unit_amount_in_decimal?:string;
37
+ quantity_in_decimal?:string;
38
+ amount_in_decimal?:string;
39
+ discount_amount?:number;
40
+ item_level_discount_amount?:number;
41
+ reference_line_item_id?:string;
42
+ description?:string;
43
+ entity_description?:string;
44
+ entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
45
+ tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
46
+ entity_id?:string;
47
+ customer_id?:string;
48
+ }
49
+ export interface Discount {
50
+ amount?:number;
51
+ description?:string;
52
+ line_item_id?:string;
53
+ entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
54
+ discount_type?:'fixed_amount' | 'percentage';
55
+ entity_id?:string;
56
+ coupon_set_code?:string;
57
+ }
58
+ export interface Tax {
59
+ name?:string;
60
+ amount?:number;
61
+ description?:string;
62
+ }
63
+ export interface LineItemTax {
64
+ line_item_id?:string;
65
+ tax_name?:string;
66
+ tax_rate?:number;
67
+ is_partial_tax_applied?:boolean;
68
+ is_non_compliance_tax?:boolean;
69
+ taxable_amount?:number;
70
+ tax_amount?:number;
71
+ tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
72
+ tax_juris_name?:string;
73
+ tax_juris_code?:string;
74
+ tax_amount_in_local_currency?:number;
75
+ local_currency_code?:string;
76
+ }
77
+ export interface LineItemTier {
78
+ line_item_id?:string;
79
+ starting_unit?:number;
80
+ ending_unit?:number;
81
+ quantity_used?:number;
82
+ unit_amount?:number;
83
+ starting_unit_in_decimal?:string;
84
+ ending_unit_in_decimal?:string;
85
+ quantity_used_in_decimal?:string;
86
+ unit_amount_in_decimal?:string;
87
+ }
88
+ export interface LineItemDiscount {
89
+ line_item_id?:string;
90
+ discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
91
+ coupon_id?:string;
92
+ entity_id?:string;
93
+ discount_amount?:number;
94
+ }
95
+ }
96
+ }