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