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