chargebee 2.41.0 → 3.0.0-beta.2

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 (118) hide show
  1. package/CHANGELOG.md +11 -15
  2. package/LICENSE +1 -1
  3. package/README.md +90 -170
  4. package/cjs/RequestWrapper.js +84 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +80 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +90 -55
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +24 -35
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +230 -747
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4336
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +276 -911
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2935
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,463 +1,136 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
2
4
  declare module 'chargebee' {
3
5
  export interface QuoteLineGroup {
4
-
5
- /**
6
- * @description Version of the quote line group.
7
-
8
- */
9
-
10
- version?:number;
11
-
12
- /**
13
- * @description Uniquely identifies a quote line group.
14
-
15
- */
16
-
17
- id?:string;
18
-
19
- /**
20
- * @description Subtotal in cents.
21
-
22
- */
23
-
24
- sub_total:number;
25
-
26
- /**
27
- * @description Total in cents.
28
-
29
- */
30
-
31
- total?:number;
32
-
33
- /**
34
- * @description Credits (in cents) applied to this quote line group.
35
-
36
- */
37
-
38
- credits_applied?:number;
39
-
40
- /**
41
- * @description Existing outstanding payments (in cents) if any, applied to this quote line group.
42
-
43
- */
44
-
45
- amount_paid?:number;
46
-
47
- /**
48
- * @description Amount due in cents
49
-
50
- */
51
-
52
- amount_due?:number;
53
-
54
- /**
55
- * @description Describes the time in the subscription lifecycle when the charge is to occur. \* subscription_creation - Subscription Creation \* trial_start - Trial Start \* subscription_renewal - Subscription Renewal \* subscription_change - Subscription Change \* subscription_cancel - Subscription Cancel \* immediate - Immediate
56
-
57
- */
58
-
59
- charge_event?:'subscription_cancel' | 'immediate' | 'subscription_creation' | 'trial_start' | 'subscription_renewal' | 'subscription_change';
60
-
61
- /**
62
- * @description The serial number of the billing cycle of which the quote line group is a part.
63
-
64
- */
65
-
66
- billing_cycle_number?:number;
67
-
68
- /**
69
- * @description The list of items in this quote line group.
70
-
71
- */
72
-
73
- line_items?:QuoteLineGroup.LineItem[];
74
-
75
- /**
76
- * @description The list of discounts applied to this quote line group.
77
-
78
- */
79
-
80
- discounts?:QuoteLineGroup.Discount[];
81
-
82
- /**
83
- * @description The list of discount(s) applied for line items in this quote line group.
84
-
85
- */
86
-
87
- line_item_discounts?:QuoteLineGroup.LineItemDiscount[];
88
-
89
- /**
90
- * @description The list of taxes applied to this quote line group.
91
-
92
- */
93
-
94
- taxes?:QuoteLineGroup.Tax[];
95
-
96
- /**
97
- * @description The list of taxes applied on line items in this quote line group.
98
-
99
- */
100
-
101
- line_item_taxes?:QuoteLineGroup.LineItemTax[];
6
+ version?: number;
7
+ id?: string;
8
+ sub_total: number;
9
+ total?: number;
10
+ credits_applied?: number;
11
+ amount_paid?: number;
12
+ amount_due?: number;
13
+ charge_event?:
14
+ | 'immediate'
15
+ | 'subscription_creation'
16
+ | 'trial_start'
17
+ | 'subscription_change'
18
+ | 'subscription_renewal'
19
+ | 'subscription_cancel';
20
+ billing_cycle_number?: number;
21
+ line_items?: QuoteLineGroup.LineItem[];
22
+ discounts?: QuoteLineGroup.Discount[];
23
+ line_item_discounts?: QuoteLineGroup.LineItemDiscount[];
24
+ taxes?: QuoteLineGroup.Tax[];
25
+ line_item_taxes?: QuoteLineGroup.LineItemTax[];
102
26
  }
103
- export namespace QuoteLineGroup {
104
-
105
-
106
- export interface LineItem {
107
- /**
108
- * @description Uniquely identifies a line_item
109
-
110
- */
111
-
112
- id?:string;
113
-
114
- /**
115
- * @description A unique identifier for the subscription this line item belongs to.
116
-
117
- */
118
-
119
- subscription_id?:string;
120
-
121
- /**
122
- * @description Start date of this line item.
123
-
124
- */
125
-
126
- date_from:number;
127
-
128
- /**
129
- * @description End date of this line item.
130
-
131
- */
132
-
133
- date_to:number;
134
-
135
- /**
136
- * @description Unit amount of the line item.
137
-
138
- */
139
-
140
- unit_amount:number;
141
-
142
- /**
143
- * @description [Quantity of the recurring item](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_line_items_quantity) which is represented by this line item. For &#x60;metered&#x60; line items, this value is updated from [usages](/docs/api/usages) once when the invoice is generated as &#x60;pending&#x60; and finally when the invoice is [closed](/docs/api/invoices#close_a_pending_invoice).
144
-
145
- */
146
-
147
- quantity?:number;
148
-
149
- /**
150
- * @description Total amount of this line item. Typically equals to unit amount x quantity
151
-
152
- */
153
-
154
- amount?:number;
155
-
156
- /**
157
- * @description The [pricing scheme](https://www.chargebee.com/docs/2.0/plans.html#pricing-models) for this item price. \* per_unit - A fixed price per unit quantity. \* stairstep - A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in. \* flat_fee - A fixed price that is not quantity-based. \* tiered - The per unit price is based on the tier that the total quantity falls in. \* volume - There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.
158
-
159
- */
160
-
161
- pricing_model?:'volume' | 'per_unit' | 'tiered' | 'flat_fee' | 'stairstep';
162
-
163
- /**
164
- * @description Specifies whether this line item is taxed or not
165
-
166
- */
167
-
168
- is_taxed:boolean;
169
-
170
- /**
171
- * @description The tax amount charged for this item
172
-
173
- */
174
-
175
- tax_amount?:number;
176
-
177
- /**
178
- * @description Rate of tax used to calculate tax for this lineitem
179
-
180
- */
181
-
182
- tax_rate?:number;
183
-
184
- /**
185
- * @description The decimal representation of the unit amount of the &#x60;line_item&#x60;. The value is in major units of the currency. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
186
-
187
- */
188
-
189
- unit_amount_in_decimal?:string;
190
-
191
- /**
192
- * @description The decimal representation of the quantity of this line_item. Returned when the &#x60;line_item&#x60; is quantity-based and [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
193
-
194
- */
195
-
196
- quantity_in_decimal?:string;
197
-
198
- /**
199
- * @description The decimal representation of the amount for the &#x60;line_item&#x60;, in major units of the currency. Typically equals to &#x60;unit_amount_in_decimal&#x60; x &#x60;quantity_in_decimal&#x60;. Returned when [multi-decimal pricing](https://apidocs.chargebee.com/docs/api#handling_currency_units ) is enabled.
200
-
201
- */
202
-
203
- amount_in_decimal?:string;
204
-
205
- /**
206
- * @description Total discounts for this line
207
-
208
- */
209
-
210
- discount_amount?:number;
211
-
212
- /**
213
- * @description Line Item-level discounts for this line.
214
-
215
- */
216
-
217
- item_level_discount_amount?:number;
218
-
219
- /**
220
- * @description Invoice Reference Line Item ID
221
-
222
- */
223
-
224
- reference_line_item_id?:string;
225
-
226
- /**
227
- * @description Detailed description about this line item.
228
27
 
229
- */
230
-
231
- description:string;
232
-
233
- /**
234
- * @description Detailed description about this item.
235
-
236
- */
237
-
238
- entity_description?:string;
239
-
240
- /**
241
- * @description Specifies the modelled entity this line item is based on. \* addon - Indicates that this lineitem is based on &#x27;Addon&#x27; entity. The &#x27;entity_id&#x27; attribute specifies the [addon](/docs/api/addons#addon_attributes) id \* plan_item_price - Indicates that this line item is based on plan Item Price \* addon_item_price - Indicates that this line item is based on addon Item Price \* charge_item_price - Indicates that this line item is based on charge Item Price \* adhoc - Indicates that this lineitem is not modelled. i.e created adhoc. So the &#x27;entity_id&#x27; attribute will be null in this case \* plan_setup - Indicates that this lineitem is based on &#x27;Plan Setup&#x27; charge. The &#x27;entity_id&#x27; attribute specifies the [plan](/docs/api/plans#plan_attributes) id \* plan - Indicates that this lineitem is based on &#x27;Plan&#x27; entity. The &#x27;entity_id&#x27; attribute specifies the [plan](/docs/api/plans#plan_attributes) id
242
-
243
- */
244
-
245
- entity_type:'addon_item_price' | 'plan_item_price' | 'charge_item_price' | 'adhoc';
246
-
247
- /**
248
- * @description The reason due to which the line item price/amount is exempted from tax. \* reverse_charge - If the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU only \* tax_not_configured - If tax is not enabled for the site \* high_value_physical_goods - If physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be applied \* product_exempt - If the Plan or Addon is marked as Tax exempt \* zero_rated - If the rate of tax is 0% and no Sales/ GST tax is collectable for that line item \* customer_exempt - If the Customer is marked as Tax exempt \* region_non_taxable - If the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdiction \* export - You are not registered for tax in the customer&#x27;s region. This is also the reason code when both &#x60;billing_address&#x60; and &#x60;shipping_address&#x60; have not been provided for the customer and subscription respectively
249
-
250
- */
251
-
252
- tax_exempt_reason?:'high_value_physical_goods' | 'tax_not_configured' | 'reverse_charge' | 'zero_rated' | 'tax_not_configured_external_provider' | 'customer_exempt' | 'region_non_taxable' | 'zero_value_item' | 'export' | 'product_exempt';
253
-
254
- /**
255
- * @description The identifier of the modelled entity this line item is based on. Will be null for &#x27;adhoc&#x27; entity type
256
-
257
- */
258
-
259
- entity_id?:string;
260
-
261
- /**
262
- * @description A unique identifier for the customer this line item belongs to
263
-
264
- */
265
-
266
- customer_id?:string;
28
+ export namespace QuoteLineGroup {
29
+ export interface LineItem {
30
+ id?: string;
31
+ subscription_id?: string;
32
+ date_from: number;
33
+ date_to: number;
34
+ unit_amount: number;
35
+ quantity?: number;
36
+ amount?: number;
37
+ pricing_model?:
38
+ | 'flat_fee'
39
+ | 'per_unit'
40
+ | 'tiered'
41
+ | 'volume'
42
+ | 'stairstep';
43
+ is_taxed: boolean;
44
+ tax_amount?: number;
45
+ tax_rate?: number;
46
+ unit_amount_in_decimal?: string;
47
+ quantity_in_decimal?: string;
48
+ amount_in_decimal?: string;
49
+ discount_amount?: number;
50
+ item_level_discount_amount?: number;
51
+ usage_percentage?: string;
52
+ reference_line_item_id?: string;
53
+ description: string;
54
+ entity_description?: string;
55
+ entity_type:
56
+ | 'adhoc'
57
+ | 'plan_item_price'
58
+ | 'addon_item_price'
59
+ | 'charge_item_price'
60
+ | 'plan_setup'
61
+ | 'plan'
62
+ | 'addon';
63
+ tax_exempt_reason?:
64
+ | 'tax_not_configured'
65
+ | 'region_non_taxable'
66
+ | 'export'
67
+ | 'customer_exempt'
68
+ | 'product_exempt'
69
+ | 'zero_rated'
70
+ | 'reverse_charge'
71
+ | 'high_value_physical_goods'
72
+ | 'zero_value_item'
73
+ | 'tax_not_configured_external_provider';
74
+ entity_id?: string;
75
+ customer_id?: string;
267
76
  }
268
- export interface Discount {
269
- /**
270
- * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api?prod_cat_ver&#x3D;2#currencies).
271
-
272
- */
273
-
274
- amount:number;
275
-
276
- /**
277
- * @description Description for this deduction.
278
-
279
- */
280
-
281
- description?:string;
282
-
283
- /**
284
- * @description The unique id of the line item that this deduction is for. Is required when &#x60;discounts[entity_type]&#x60; is &#x60;item_level_coupon&#x60; or &#x60;document_level_coupon&#x60;.
285
-
286
- */
287
-
288
- line_item_id?:string;
289
-
290
- /**
291
- * @description The type of deduction and the amount to which it is applied. \* document_level_coupon - The deduction is due to a coupon applied to the invoice &#x60;sub_total&#x60;. The coupon id is passed as &#x60;entity_id&#x60;. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_adjustment_credit_notes). \* item_level_coupon - The deduction is due to a coupon applied to line item. The coupon &#x60;id&#x60; is passed as &#x60;entity_id&#x60;. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to a line item of the invoice. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits?prod_cat_ver&#x3D;2) applied to the invoice. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to the invoice &#x60;sub_total&#x60;. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;.
292
-
293
- */
294
-
295
- entity_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
296
-
297
- /**
298
- * @description The type of discount that is applied to the line item. Relevant only when &#x60;discounts[entity_type]&#x60; is one of &#x60;item_level_discount&#x60; , &#x60;item_level_coupon&#x60;, &#x60;document_level_discount&#x60;, or &#x60;document_level_coupon&#x60; \* percentage - when percentage is applied as discount \* fixed_amount - when amount is applied as discount
299
-
300
- */
301
-
302
- discount_type?:'fixed_amount' | 'percentage';
303
-
304
- /**
305
- * @description When the deduction is due to a &#x60;coupon&#x60; or a [discount](discounts), then this is the &#x60;id&#x60; of the coupon or discount.
306
-
307
- */
308
-
309
- entity_id?:string;
310
-
311
- /**
312
- * @description The [coupon code](/docs/api/coupon_codes#coupon_code_code), if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons#coupon_id) is available in &#x60;entity_id&#x60;.
313
-
314
- */
315
-
316
- coupon_set_code?:string;
77
+ export interface Discount {
78
+ amount: number;
79
+ description?: string;
80
+ entity_type:
81
+ | 'item_level_coupon'
82
+ | 'document_level_coupon'
83
+ | 'promotional_credits'
84
+ | 'prorated_credits'
85
+ | 'item_level_discount'
86
+ | 'document_level_discount';
87
+ entity_id?: string;
88
+ coupon_set_code?: string;
317
89
  }
318
- export interface LineItemDiscount {
319
- /**
320
- * @description The unique id of the line item that this deduction is for.
321
-
322
- */
323
-
324
- line_item_id:string;
325
-
326
- /**
327
- * @description The type of deduction and the amount to which it is applied. \* item_level_coupon - The deduction is due to a coupon applied to a line item of the invoice. The coupon &#x60;id&#x60; is available as &#x60;entity_id&#x60;. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_adjustment_credit_notes). \* document_level_coupon - The deduction is due to a coupon applied to the invoice &#x60;sub_total&#x60;. The coupon &#x60;id&#x60; is available as &#x60;entity_id&#x60;. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to the invoice &#x60;sub_total&#x60;. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver&#x3D;2) applied to a line item of the invoice. The discount &#x60;id&#x60; is available as the &#x60;entity_id&#x60;. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice. The &#x60;entity_id&#x60; is &#x60;null&#x60; in this case.
328
-
329
- */
330
-
331
- discount_type:'item_level_coupon' | 'promotional_credits' | 'item_level_discount' | 'prorated_credits' | 'document_level_discount' | 'document_level_coupon';
332
-
333
- coupon_id?:string;
334
-
335
- /**
336
- * @description When the deduction is due to a &#x60;coupon&#x60; or a [discount](discounts), then this is the &#x60;id&#x60; of the coupon or discount.
337
-
338
- */
339
-
340
- entity_id?:string;
341
-
342
- /**
343
- * @description The amount deducted. The format of this value depends on the [kind of currency](/docs/api#currencies).
344
-
345
- */
346
-
347
- discount_amount:number;
90
+ export interface LineItemDiscount {
91
+ line_item_id: string;
92
+ discount_type:
93
+ | 'item_level_coupon'
94
+ | 'document_level_coupon'
95
+ | 'promotional_credits'
96
+ | 'prorated_credits'
97
+ | 'item_level_discount'
98
+ | 'document_level_discount';
99
+ coupon_id?: string;
100
+ entity_id?: string;
101
+ discount_amount: number;
348
102
  }
349
- export interface Tax {
350
- /**
351
- * @description The name of the tax applied. E.g. GST.
352
-
353
- */
354
-
355
- name:string;
356
-
357
- /**
358
- * @description The tax amount.
359
-
360
- */
361
-
362
- amount:number;
363
-
364
- /**
365
- * @description Description of the tax item.
366
-
367
- */
368
-
369
- description?:string;
103
+ export interface Tax {
104
+ name: string;
105
+ amount: number;
106
+ description?: string;
370
107
  }
371
- export interface LineItemTax {
372
- /**
373
- * @description The unique reference id of the line item for which the tax is applicable
374
-
375
- */
376
-
377
- line_item_id?:string;
378
-
379
- /**
380
- * @description The name of the tax applied
381
-
382
- */
383
-
384
- tax_name:string;
385
-
386
- /**
387
- * @description The rate of tax used to calculate tax amount
388
-
389
- */
390
-
391
- tax_rate:number;
392
-
393
- date_to?:number;
394
-
395
- date_from?:number;
396
-
397
- prorated_taxable_amount?:number;
398
-
399
- /**
400
- * @description Indicates if tax is applied only on a portion of the line item amount.
401
-
402
- */
403
-
404
- is_partial_tax_applied?:boolean;
405
-
406
- /**
407
- * @description Indicates the non-compliance tax that should not be reported to the jurisdiction.
408
-
409
- */
410
-
411
- is_non_compliance_tax?:boolean;
412
-
413
- /**
414
- * @description Indicates the actual portion of the line item amount that is taxable.
415
-
416
- */
417
-
418
- taxable_amount:number;
419
-
420
- /**
421
- * @description The tax amount
422
-
423
- */
424
-
425
- tax_amount:number;
426
-
427
- /**
428
- * @description The type of tax jurisdiction \* unincorporated - Combined tax of state and county. \* federal - The tax jurisdiction is a federal \* state - The tax jurisdiction is a state \* county - The tax jurisdiction is a county \* country - The tax jurisdiction is a country \* city - The tax jurisdiction is a city \* other - Jurisdictions other than the ones listed above. \* special - Special tax jurisdiction.
429
-
430
- */
431
-
432
- tax_juris_type?:'special' | 'country' | 'unincorporated' | 'other' | 'city' | 'federal' | 'county' | 'state';
433
-
434
- /**
435
- * @description The name of the tax jurisdiction
436
-
437
- */
438
-
439
- tax_juris_name?:string;
440
-
441
- /**
442
- * @description The tax jurisdiction code
443
-
444
- */
445
-
446
- tax_juris_code?:string;
447
-
448
- /**
449
- * @description Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
450
-
451
- */
452
-
453
- tax_amount_in_local_currency?:number;
454
-
455
- /**
456
- * @description The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API.
457
-
458
- */
459
-
460
- local_currency_code?:string;
108
+ export interface LineItemTax {
109
+ line_item_id?: string;
110
+ tax_name: string;
111
+ tax_rate: number;
112
+ date_to?: number;
113
+ date_from?: number;
114
+ prorated_taxable_amount?: number;
115
+ is_partial_tax_applied?: boolean;
116
+ is_non_compliance_tax?: boolean;
117
+ taxable_amount: number;
118
+ tax_amount: number;
119
+ tax_juris_type?:
120
+ | 'country'
121
+ | 'federal'
122
+ | 'state'
123
+ | 'county'
124
+ | 'city'
125
+ | 'special'
126
+ | 'unincorporated'
127
+ | 'other';
128
+ tax_juris_name?: string;
129
+ tax_juris_code?: string;
130
+ tax_amount_in_local_currency?: number;
131
+ local_currency_code?: string;
461
132
  }
133
+ // REQUEST PARAMS
134
+ //---------------
462
135
  }
463
- }
136
+ }