chargebee 2.24.0 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/lib/chargebee.js +1 -1
  3. package/package.json +2 -1
  4. package/types/core.d.ts +80 -0
  5. package/types/index.d.ts +92 -0
  6. package/types/resources/Address.d.ts +58 -0
  7. package/types/resources/AdvanceInvoiceSchedule.d.ts +26 -0
  8. package/types/resources/AttachedItem.d.ts +84 -0
  9. package/types/resources/Card.d.ts +88 -0
  10. package/types/resources/Comment.d.ts +52 -0
  11. package/types/resources/Contact.d.ts +15 -0
  12. package/types/resources/ContractTerm.d.ts +18 -0
  13. package/types/resources/Coupon.d.ts +150 -0
  14. package/types/resources/CouponCode.d.ts +25 -0
  15. package/types/resources/CouponSet.d.ts +75 -0
  16. package/types/resources/CreditNote.d.ts +337 -0
  17. package/types/resources/CreditNoteEstimate.d.ts +96 -0
  18. package/types/resources/Customer.d.ts +440 -0
  19. package/types/resources/DifferentialPrice.d.ts +88 -0
  20. package/types/resources/Discount.d.ts +23 -0
  21. package/types/resources/Download.d.ts +9 -0
  22. package/types/resources/EntitlementOverride.d.ts +37 -0
  23. package/types/resources/Estimate.d.ts +214 -0
  24. package/types/resources/Event.d.ts +42 -0
  25. package/types/resources/Export.d.ts +182 -0
  26. package/types/resources/Feature.d.ts +90 -0
  27. package/types/resources/Gift.d.ts +97 -0
  28. package/types/resources/Hierarchy.d.ts +11 -0
  29. package/types/resources/HostedPage.d.ts +242 -0
  30. package/types/resources/ImpactedItem.d.ts +17 -0
  31. package/types/resources/ImpactedSubscription.d.ts +17 -0
  32. package/types/resources/InAppSubscription.d.ts +52 -0
  33. package/types/resources/Invoice.d.ts +590 -0
  34. package/types/resources/InvoiceEstimate.d.ts +96 -0
  35. package/types/resources/Item.d.ts +118 -0
  36. package/types/resources/ItemEntitlement.d.ts +55 -0
  37. package/types/resources/ItemFamily.d.ts +59 -0
  38. package/types/resources/ItemPrice.d.ts +195 -0
  39. package/types/resources/Media.d.ts +10 -0
  40. package/types/resources/NonSubscription.d.ts +23 -0
  41. package/types/resources/Order.d.ts +305 -0
  42. package/types/resources/PaymentIntent.d.ts +71 -0
  43. package/types/resources/PaymentReferenceNumber.d.ts +10 -0
  44. package/types/resources/PaymentSource.d.ts +264 -0
  45. package/types/resources/PaymentVoucher.d.ts +74 -0
  46. package/types/resources/PortalSession.d.ts +57 -0
  47. package/types/resources/PromotionalCredit.d.ts +86 -0
  48. package/types/resources/Purchase.d.ts +46 -0
  49. package/types/resources/Quote.d.ts +388 -0
  50. package/types/resources/QuoteLineGroup.d.ts +83 -0
  51. package/types/resources/QuotedCharge.d.ts +57 -0
  52. package/types/resources/QuotedSubscription.d.ts +82 -0
  53. package/types/resources/ResourceMigration.d.ts +27 -0
  54. package/types/resources/SiteMigrationDetail.d.ts +31 -0
  55. package/types/resources/Subscription.d.ts +619 -0
  56. package/types/resources/SubscriptionEntitlement.d.ts +41 -0
  57. package/types/resources/SubscriptionEstimate.d.ts +49 -0
  58. package/types/resources/TaxWithheld.d.ts +13 -0
  59. package/types/resources/ThirdPartyPaymentMethod.d.ts +10 -0
  60. package/types/resources/TimeMachine.d.ts +38 -0
  61. package/types/resources/Token.d.ts +50 -0
  62. package/types/resources/Transaction.d.ts +170 -0
  63. package/types/resources/UnbilledCharge.d.ts +91 -0
  64. package/types/resources/Usage.d.ts +76 -0
  65. package/types/resources/VirtualBankAccount.d.ts +75 -0
@@ -0,0 +1,150 @@
1
+ declare module 'chargebee' {
2
+ export interface Coupon {
3
+
4
+ id:string;
5
+ name:string;
6
+ invoice_name?:string;
7
+ discount_type:'fixed_amount' | 'percentage';
8
+ discount_percentage?:number;
9
+ discount_amount?:number;
10
+ currency_code?:string;
11
+ duration_type:'limited_period' | 'one_time' | 'forever';
12
+ valid_till?:number;
13
+ max_redemptions?:number;
14
+ status?:'archived' | 'expired' | 'deleted' | 'active';
15
+ apply_on:'invoice_amount' | 'each_specified_item';
16
+ created_at:number;
17
+ archived_at?:number;
18
+ resource_version?:number;
19
+ updated_at?:number;
20
+ period?:number;
21
+ period_unit?:PeriodUnit;
22
+ redemptions?:number;
23
+ invoice_notes?:string;
24
+ item_constraints?:Coupon.ItemConstraint[];
25
+ item_constraint_criteria?:Coupon.ItemConstraintCriteria[];
26
+ coupon_constraints?:Coupon.CouponConstraint[];
27
+ }
28
+ export namespace Coupon {
29
+ export class CouponResource {
30
+ list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
31
+ update_for_items(coupon_id:string, input?:UpdateForItemsInputParam):ChargebeeRequest<UpdateForItemsResponse>;
32
+ unarchive(coupon_id:string):ChargebeeRequest<UnarchiveResponse>;
33
+ delete(coupon_id:string):ChargebeeRequest<DeleteResponse>;
34
+ copy(input:CopyInputParam):ChargebeeRequest<CopyResponse>;
35
+ retrieve(coupon_id:string):ChargebeeRequest<RetrieveResponse>;
36
+ create_for_items(input:CreateForItemsInputParam):ChargebeeRequest<CreateForItemsResponse>;
37
+ }
38
+ export interface ListResponse {
39
+ list:{coupon:Coupon}[];
40
+ next_offset?:string;
41
+ }
42
+ export interface ListInputParam {
43
+ [key: string]: string | number | object | boolean;
44
+ limit?:number;
45
+ offset?:string;
46
+ id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
47
+ name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
48
+ discount_type?:{in?:string,is?:'fixed_amount' | 'percentage',is_not?:'fixed_amount' | 'percentage',not_in?:string};
49
+ duration_type?:{in?:string,is?:'limited_period' | 'one_time' | 'forever',is_not?:'limited_period' | 'one_time' | 'forever',not_in?:string};
50
+ status?:{in?:string,is?:'archived' | 'expired' | 'deleted' | 'active',is_not?:'archived' | 'expired' | 'deleted' | 'active',not_in?:string};
51
+ apply_on?:{in?:string,is?:'invoice_amount' | 'each_specified_item',is_not?:'invoice_amount' | 'each_specified_item',not_in?:string};
52
+ created_at?:{after?:string,before?:string,between?:string,on?:string};
53
+ updated_at?:{after?:string,before?:string,between?:string,on?:string};
54
+ sort_by?:{asc?:'created_at',desc?:'created_at'};
55
+ currency_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
56
+ addon?:{};
57
+ plan?:{};
58
+ }
59
+ export interface UpdateForItemsResponse {
60
+ coupon:Coupon;
61
+ }
62
+ export interface UpdateForItemsInputParam {
63
+
64
+ name?:string;
65
+ invoice_name?:string;
66
+ discount_type?:'fixed_amount' | 'percentage';
67
+ discount_amount?:number;
68
+ currency_code?:string;
69
+ discount_percentage?:number;
70
+ apply_on?:'invoice_amount' | 'each_specified_item';
71
+ duration_type?:'limited_period' | 'one_time' | 'forever';
72
+ duration_month?:number;
73
+ valid_till?:number;
74
+ max_redemptions?:number;
75
+ invoice_notes?:string;
76
+ meta_data?:object;
77
+ included_in_mrr?:boolean;
78
+ period?:number;
79
+ period_unit?:PeriodUnit;
80
+ item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
81
+ item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
82
+ coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
83
+ }
84
+ export interface UnarchiveResponse {
85
+ coupon:Coupon;
86
+ }
87
+
88
+ export interface DeleteResponse {
89
+ coupon:Coupon;
90
+ }
91
+
92
+ export interface CopyResponse {
93
+ coupon:Coupon;
94
+ }
95
+ export interface CopyInputParam {
96
+
97
+ from_site:string;
98
+ id_at_from_site:string;
99
+ id?:string;
100
+ for_site_merging?:boolean;
101
+ }
102
+ export interface RetrieveResponse {
103
+ coupon:Coupon;
104
+ }
105
+
106
+ export interface CreateForItemsResponse {
107
+ coupon:Coupon;
108
+ }
109
+ export interface CreateForItemsInputParam {
110
+
111
+ id:string;
112
+ name:string;
113
+ invoice_name?:string;
114
+ discount_type:'fixed_amount' | 'percentage';
115
+ discount_amount?:number;
116
+ currency_code?:string;
117
+ discount_percentage?:number;
118
+ apply_on:'invoice_amount' | 'each_specified_item';
119
+ duration_type:'limited_period' | 'one_time' | 'forever';
120
+ duration_month?:number;
121
+ valid_till?:number;
122
+ max_redemptions?:number;
123
+ invoice_notes?:string;
124
+ meta_data?:object;
125
+ included_in_mrr?:boolean;
126
+ period?:number;
127
+ period_unit?:PeriodUnit;
128
+ status?:'archived' | 'active';
129
+ item_constraints?:{constraint:'all' | 'criteria' | 'none' | 'specific',item_price_ids?:any[],item_type:'charge' | 'addon' | 'plan'}[];
130
+ item_constraint_criteria?:{currencies?:any[],item_family_ids?:any[],item_price_periods?:any[],item_type?:'charge' | 'addon' | 'plan'}[];
131
+ coupon_constraints?:{entity_type:'customer',type:'max_redemptions' | 'unique_by',value?:string}[];
132
+ }
133
+ export interface ItemConstraint {
134
+ item_type?:'charge' | 'addon' | 'plan';
135
+ constraint?:'all' | 'criteria' | 'none' | 'specific';
136
+ item_price_ids?:any[];
137
+ }
138
+ export interface ItemConstraintCriteria {
139
+ item_type?:'charge' | 'addon' | 'plan';
140
+ currencies?:any[];
141
+ item_family_ids?:any[];
142
+ item_price_periods?:any[];
143
+ }
144
+ export interface CouponConstraint {
145
+ entity_type?:'customer';
146
+ type?:'max_redemptions' | 'unique_by';
147
+ value?:string;
148
+ }
149
+ }
150
+ }
@@ -0,0 +1,25 @@
1
+ declare module 'chargebee' {
2
+ export interface CouponCode {
3
+
4
+ code:string;
5
+ status:'archived' | 'redeemed' | 'not_redeemed';
6
+ coupon_id:string;
7
+ coupon_set_id:string;
8
+ coupon_set_name:string;
9
+ }
10
+ export namespace CouponCode {
11
+ export class CouponCodeResource {
12
+ retrieve(coupon_code_code:string):ChargebeeRequest<RetrieveResponse>;
13
+ archive(coupon_code_code:string):ChargebeeRequest<ArchiveResponse>;
14
+ }
15
+ export interface RetrieveResponse {
16
+ coupon_code:CouponCode;
17
+ }
18
+
19
+ export interface ArchiveResponse {
20
+ coupon_code:CouponCode;
21
+ }
22
+
23
+
24
+ }
25
+ }
@@ -0,0 +1,75 @@
1
+ declare module 'chargebee' {
2
+ export interface CouponSet {
3
+
4
+ id:string;
5
+ coupon_id:string;
6
+ name:string;
7
+ total_count?:number;
8
+ redeemed_count?:number;
9
+ archived_count?:number;
10
+ }
11
+ export namespace CouponSet {
12
+ export class CouponSetResource {
13
+ list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
14
+ create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
15
+ update(coupon_set_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
16
+ retrieve(coupon_set_id:string):ChargebeeRequest<RetrieveResponse>;
17
+ add_coupon_codes(coupon_set_id:string, input?:AddCouponCodesInputParam):ChargebeeRequest<AddCouponCodesResponse>;
18
+ delete_unused_coupon_codes(coupon_set_id:string):ChargebeeRequest<DeleteUnusedCouponCodesResponse>;
19
+ delete(coupon_set_id:string):ChargebeeRequest<DeleteResponse>;
20
+ }
21
+ export interface ListResponse {
22
+ list:{coupon_set:CouponSet}[];
23
+ next_offset?:string;
24
+ }
25
+ export interface ListInputParam {
26
+ [key: string]: string | number | object | boolean;
27
+ limit?:number;
28
+ offset?:string;
29
+ id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
30
+ name?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
31
+ coupon_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
32
+ total_count?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
33
+ redeemed_count?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
34
+ archived_count?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
35
+ }
36
+ export interface CreateResponse {
37
+ coupon_set:CouponSet;
38
+ }
39
+ export interface CreateInputParam {
40
+
41
+ coupon_id:string;
42
+ name:string;
43
+ id:string;
44
+ meta_data?:object;
45
+ }
46
+ export interface UpdateResponse {
47
+ coupon_set:CouponSet;
48
+ }
49
+ export interface UpdateInputParam {
50
+
51
+ name?:string;
52
+ meta_data?:object;
53
+ }
54
+ export interface RetrieveResponse {
55
+ coupon_set:CouponSet;
56
+ }
57
+
58
+ export interface AddCouponCodesResponse {
59
+ coupon_set:CouponSet;
60
+ }
61
+ export interface AddCouponCodesInputParam {
62
+
63
+ code?:string[];
64
+ }
65
+ export interface DeleteUnusedCouponCodesResponse {
66
+ coupon_set:CouponSet;
67
+ }
68
+
69
+ export interface DeleteResponse {
70
+ coupon_set:CouponSet;
71
+ }
72
+
73
+
74
+ }
75
+ }
@@ -0,0 +1,337 @@
1
+ declare module 'chargebee' {
2
+ export interface CreditNote {
3
+
4
+ id:string;
5
+ customer_id:string;
6
+ subscription_id?:string;
7
+ reference_invoice_id:string;
8
+ type:'adjustment' | 'refundable';
9
+ reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
10
+ status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
11
+ vat_number?:string;
12
+ date?:number;
13
+ price_type:PriceType;
14
+ currency_code:string;
15
+ total?:number;
16
+ amount_allocated?:number;
17
+ amount_refunded?:number;
18
+ amount_available?:number;
19
+ refunded_at?:number;
20
+ voided_at?:number;
21
+ generated_at?:number;
22
+ resource_version?:number;
23
+ updated_at?:number;
24
+ channel?:Channel;
25
+ sub_total:number;
26
+ sub_total_in_local_currency?:number;
27
+ total_in_local_currency?:number;
28
+ local_currency_code?:string;
29
+ round_off_amount?:number;
30
+ fractional_correction?:number;
31
+ deleted:boolean;
32
+ tax_category?:string;
33
+ local_currency_exchange_rate?:number;
34
+ create_reason_code?:string;
35
+ vat_number_prefix?:string;
36
+ business_entity_id:string;
37
+ einvoice?:CreditNote.Einvoice;
38
+ line_items?:CreditNote.LineItem[];
39
+ discounts?:CreditNote.Discount[];
40
+ line_item_discounts?:CreditNote.LineItemDiscount[];
41
+ line_item_tiers?:CreditNote.LineItemTier[];
42
+ taxes?:CreditNote.Tax[];
43
+ line_item_taxes?:CreditNote.LineItemTax[];
44
+ linked_refunds?:CreditNote.CreditNoteTransaction[];
45
+ linked_tax_withheld_refunds?:CreditNote.LinkedTaxWithheldRefund[];
46
+ allocations?:CreditNote.AppliedCredit[];
47
+ shipping_address?:CreditNote.ShippingAddress;
48
+ billing_address?:CreditNote.BillingAddress;
49
+ }
50
+ export namespace CreditNote {
51
+ export class CreditNoteResource {
52
+ void_credit_note(credit_note_id:string, input?:VoidCreditNoteInputParam):ChargebeeRequest<VoidCreditNoteResponse>;
53
+ refund(credit_note_id:string, input?:RefundInputParam):ChargebeeRequest<RefundResponse>;
54
+ list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
55
+ create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
56
+ record_refund(credit_note_id:string, input?:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
57
+ import_credit_note(input:ImportCreditNoteInputParam):ChargebeeRequest<ImportCreditNoteResponse>;
58
+ delete(credit_note_id:string, input?:DeleteInputParam):ChargebeeRequest<DeleteResponse>;
59
+ download_einvoice(credit_note_id:string):ChargebeeRequest<DownloadEinvoiceResponse>;
60
+ pdf(credit_note_id:string, input?:PdfInputParam):ChargebeeRequest<PdfResponse>;
61
+ resend_einvoice(credit_note_id:string):ChargebeeRequest<ResendEinvoiceResponse>;
62
+ remove_tax_withheld_refund(credit_note_id:string, input?:RemoveTaxWithheldRefundInputParam):ChargebeeRequest<RemoveTaxWithheldRefundResponse>;
63
+ retrieve(credit_note_id:string):ChargebeeRequest<RetrieveResponse>;
64
+ send_einvoice(credit_note_id:string):ChargebeeRequest<SendEinvoiceResponse>;
65
+ }
66
+ export interface VoidCreditNoteResponse {
67
+ credit_note:CreditNote;
68
+ }
69
+ export interface VoidCreditNoteInputParam {
70
+
71
+ comment?:string;
72
+ }
73
+ export interface RefundResponse {
74
+ credit_note:CreditNote;
75
+ transaction:Transaction;
76
+ }
77
+ export interface RefundInputParam {
78
+
79
+ refund_amount?:number;
80
+ customer_notes?:string;
81
+ refund_reason_code?:string;
82
+ }
83
+ export interface ListResponse {
84
+ list:{credit_note:CreditNote}[];
85
+ next_offset?:string;
86
+ }
87
+ export interface ListInputParam {
88
+ [key: string]: string | number | object | boolean;
89
+ limit?:number;
90
+ offset?:string;
91
+ include_deleted?:boolean;
92
+ id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
93
+ customer_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
94
+ subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
95
+ reference_invoice_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
96
+ type?:{in?:string,is?:'adjustment' | 'refundable',is_not?:'adjustment' | 'refundable',not_in?:string};
97
+ reason_code?:{in?:string,is?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent',is_not?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent',not_in?:string};
98
+ create_reason_code?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
99
+ status?:{in?:string,is?:'refund_due' | 'adjusted' | 'refunded' | 'voided',is_not?:'refund_due' | 'adjusted' | 'refunded' | 'voided',not_in?:string};
100
+ date?:{after?:string,before?:string,between?:string,on?:string};
101
+ total?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
102
+ price_type?:{in?:string,is?:'tax_exclusive' | 'tax_inclusive',is_not?:'tax_exclusive' | 'tax_inclusive',not_in?:string};
103
+ amount_allocated?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
104
+ amount_refunded?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
105
+ amount_available?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
106
+ voided_at?:{after?:string,before?:string,between?:string,on?:string};
107
+ updated_at?:{after?:string,before?:string,between?:string,on?:string};
108
+ sort_by?:{asc?:'date',desc?:'date'};
109
+ channel?:{in?:string,is?:'app_store' | 'web' | 'play_store',is_not?:'app_store' | 'web' | 'play_store',not_in?:string};
110
+ einvoice?:{status?:{in?:string,is?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',is_not?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped',not_in?:string}};
111
+ }
112
+ export interface CreateResponse {
113
+ credit_note:CreditNote;
114
+ invoice:Invoice;
115
+ }
116
+ export interface CreateInputParam {
117
+
118
+ reference_invoice_id:string;
119
+ total?:number;
120
+ type:'adjustment' | 'refundable';
121
+ reason_code?:'order_cancellation' | 'service_unsatisfactory' | 'other' | 'product_unsatisfactory' | 'order_change' | 'waiver';
122
+ create_reason_code?:string;
123
+ date?:number;
124
+ customer_notes?:string;
125
+ comment?:string;
126
+ line_items?:{amount?:number,date_from?:number,date_to?:number,description?:string,quantity?:number,quantity_in_decimal?:string,reference_line_item_id:string,unit_amount?:number,unit_amount_in_decimal?:string}[];
127
+ }
128
+ export interface RecordRefundResponse {
129
+ credit_note:CreditNote;
130
+ transaction?:Transaction;
131
+ }
132
+ export interface RecordRefundInputParam {
133
+
134
+ refund_reason_code?:string;
135
+ comment?:string;
136
+ transaction?:{amount?:number,date:number,payment_method:PaymentMethod,reference_number?:string};
137
+ }
138
+ export interface ImportCreditNoteResponse {
139
+ credit_note:CreditNote;
140
+ }
141
+ export interface ImportCreditNoteInputParam {
142
+
143
+ id:string;
144
+ customer_id?:string;
145
+ subscription_id?:string;
146
+ reference_invoice_id:string;
147
+ type:'adjustment' | 'refundable';
148
+ currency_code?:string;
149
+ create_reason_code:string;
150
+ date:number;
151
+ status?:'refund_due' | 'adjusted' | 'refunded' | 'voided';
152
+ total?:number;
153
+ refunded_at?:number;
154
+ voided_at?:number;
155
+ sub_total?:number;
156
+ round_off_amount?:number;
157
+ fractional_correction?:number;
158
+ vat_number_prefix?:string;
159
+ 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,reference_line_item_id?: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}[];
160
+ 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}[];
161
+ 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}[];
162
+ 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}[];
163
+ allocations?:{allocated_amount:number,allocated_at:number,invoice_id:string}[];
164
+ linked_refunds?:{amount:number,date:number,payment_method:PaymentMethod,reference_number?:string}[];
165
+ }
166
+ export interface DeleteResponse {
167
+ credit_note:CreditNote;
168
+ }
169
+ export interface DeleteInputParam {
170
+
171
+ comment?:string;
172
+ }
173
+ export interface DownloadEinvoiceResponse {
174
+ downloads:Download[];
175
+ }
176
+
177
+ export interface PdfResponse {
178
+ download:Download;
179
+ }
180
+ export interface PdfInputParam {
181
+
182
+ disposition_type?:DispositionType;
183
+ }
184
+ export interface ResendEinvoiceResponse {
185
+ credit_note:CreditNote;
186
+ }
187
+
188
+ export interface RemoveTaxWithheldRefundResponse {
189
+ credit_note:CreditNote;
190
+ }
191
+ export interface RemoveTaxWithheldRefundInputParam {
192
+
193
+ tax_withheld?:{id:string};
194
+ }
195
+ export interface RetrieveResponse {
196
+ credit_note:CreditNote;
197
+ }
198
+
199
+ export interface SendEinvoiceResponse {
200
+ credit_note:CreditNote;
201
+ }
202
+
203
+ export interface Einvoice {
204
+ id?:string;
205
+ reference_number?:string;
206
+ status?:'in_progress' | 'scheduled' | 'success' | 'registered' | 'failed' | 'skipped';
207
+ message?:string;
208
+ }
209
+ export interface LineItem {
210
+ id?:string;
211
+ subscription_id?:string;
212
+ date_from?:number;
213
+ date_to?:number;
214
+ unit_amount?:number;
215
+ quantity?:number;
216
+ amount?:number;
217
+ pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
218
+ is_taxed?:boolean;
219
+ tax_amount?:number;
220
+ tax_rate?:number;
221
+ unit_amount_in_decimal?:string;
222
+ quantity_in_decimal?:string;
223
+ amount_in_decimal?:string;
224
+ discount_amount?:number;
225
+ item_level_discount_amount?:number;
226
+ reference_line_item_id?:string;
227
+ description?:string;
228
+ entity_description?:string;
229
+ entity_type?:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
230
+ 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';
231
+ entity_id?:string;
232
+ customer_id?:string;
233
+ }
234
+ export interface Discount {
235
+ amount?:number;
236
+ description?:string;
237
+ line_item_id?:string;
238
+ entity_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
239
+ discount_type?:'fixed_amount' | 'percentage';
240
+ entity_id?:string;
241
+ coupon_set_code?:string;
242
+ }
243
+ export interface LineItemDiscount {
244
+ line_item_id?:string;
245
+ discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
246
+ coupon_id?:string;
247
+ entity_id?:string;
248
+ discount_amount?:number;
249
+ }
250
+ export interface LineItemTier {
251
+ line_item_id?:string;
252
+ starting_unit?:number;
253
+ ending_unit?:number;
254
+ quantity_used?:number;
255
+ unit_amount?:number;
256
+ starting_unit_in_decimal?:string;
257
+ ending_unit_in_decimal?:string;
258
+ quantity_used_in_decimal?:string;
259
+ unit_amount_in_decimal?:string;
260
+ }
261
+ export interface Tax {
262
+ name?:string;
263
+ amount?:number;
264
+ description?:string;
265
+ }
266
+ export interface LineItemTax {
267
+ line_item_id?:string;
268
+ tax_name?:string;
269
+ tax_rate?:number;
270
+ is_partial_tax_applied?:boolean;
271
+ is_non_compliance_tax?:boolean;
272
+ taxable_amount?:number;
273
+ tax_amount?:number;
274
+ tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
275
+ tax_juris_name?:string;
276
+ tax_juris_code?:string;
277
+ tax_amount_in_local_currency?:number;
278
+ local_currency_code?:string;
279
+ }
280
+ export interface CreditNoteTransaction {
281
+ txn_id?:string;
282
+ applied_amount?:number;
283
+ applied_at?:number;
284
+ txn_status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
285
+ txn_date?:number;
286
+ txn_amount?:number;
287
+ refund_reason_code?:string;
288
+ }
289
+ export interface LinkedTaxWithheldRefund {
290
+ id?:string;
291
+ amount?:number;
292
+ description?:string;
293
+ date?:number;
294
+ reference_number?:string;
295
+ }
296
+ export interface AppliedCredit {
297
+ invoice_id?:string;
298
+ allocated_amount?:number;
299
+ allocated_at?:number;
300
+ invoice_date?:number;
301
+ invoice_status?:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
302
+ }
303
+ export interface ShippingAddress {
304
+ first_name?:string;
305
+ last_name?:string;
306
+ email?:string;
307
+ company?:string;
308
+ phone?:string;
309
+ line1?:string;
310
+ line2?:string;
311
+ line3?:string;
312
+ city?:string;
313
+ state_code?:string;
314
+ state?:string;
315
+ country?:string;
316
+ zip?:string;
317
+ validation_status?:ValidationStatus;
318
+ index?:number;
319
+ }
320
+ export interface BillingAddress {
321
+ first_name?:string;
322
+ last_name?:string;
323
+ email?:string;
324
+ company?:string;
325
+ phone?:string;
326
+ line1?:string;
327
+ line2?:string;
328
+ line3?:string;
329
+ city?:string;
330
+ state_code?:string;
331
+ state?:string;
332
+ country?:string;
333
+ zip?:string;
334
+ validation_status?:ValidationStatus;
335
+ }
336
+ }
337
+ }
@@ -0,0 +1,96 @@
1
+ declare module 'chargebee' {
2
+ export interface CreditNoteEstimate {
3
+
4
+ reference_invoice_id:string;
5
+ type:'adjustment' | 'refundable';
6
+ price_type:PriceType;
7
+ currency_code:string;
8
+ sub_total:number;
9
+ total:number;
10
+ amount_allocated:number;
11
+ amount_available:number;
12
+ round_off_amount?:number;
13
+ customer_id?:string;
14
+ line_items?:CreditNoteEstimate.LineItem[];
15
+ discounts?:CreditNoteEstimate.Discount[];
16
+ taxes?:CreditNoteEstimate.Tax[];
17
+ line_item_taxes?:CreditNoteEstimate.LineItemTax[];
18
+ line_item_discounts?:CreditNoteEstimate.LineItemDiscount[];
19
+ line_item_tiers?:CreditNoteEstimate.LineItemTier[];
20
+ }
21
+ export namespace CreditNoteEstimate {
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 LineItemDiscount {
78
+ line_item_id?:string;
79
+ discount_type?:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
80
+ coupon_id?:string;
81
+ entity_id?:string;
82
+ discount_amount?:number;
83
+ }
84
+ export interface LineItemTier {
85
+ line_item_id?:string;
86
+ starting_unit?:number;
87
+ ending_unit?:number;
88
+ quantity_used?:number;
89
+ unit_amount?:number;
90
+ starting_unit_in_decimal?:string;
91
+ ending_unit_in_decimal?:string;
92
+ quantity_used_in_decimal?:string;
93
+ unit_amount_in_decimal?:string;
94
+ }
95
+ }
96
+ }