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.
- package/CHANGELOG.md +11 -15
- package/LICENSE +1 -1
- package/README.md +90 -170
- package/cjs/RequestWrapper.js +84 -0
- package/cjs/asyncApiSupport.js +39 -0
- package/cjs/chargebee.cjs.js +13 -0
- package/cjs/chargebee.cjs.worker.js +9 -0
- package/cjs/chargebeeError.js +17 -0
- package/cjs/coreCommon.js +72 -0
- package/cjs/createChargebee.js +92 -0
- package/cjs/environment.js +18 -0
- package/cjs/filter.js +1 -0
- package/cjs/net/ClientInterface.js +40 -0
- package/cjs/net/FetchClient.js +86 -0
- package/cjs/net/NodeClient.js +61 -0
- package/cjs/package.json +1 -0
- package/cjs/resources/api_endpoints.js +1086 -0
- package/cjs/util.js +218 -0
- package/esm/RequestWrapper.js +80 -0
- package/esm/asyncApiSupport.js +35 -0
- package/esm/chargebee.esm.js +9 -0
- package/esm/chargebee.esm.worker.js +5 -0
- package/esm/chargebeeError.js +13 -0
- package/esm/coreCommon.js +67 -0
- package/esm/createChargebee.js +88 -0
- package/esm/environment.js +15 -0
- package/esm/filter.js +1 -0
- package/esm/net/ClientInterface.js +35 -0
- package/esm/net/FetchClient.js +81 -0
- package/esm/net/NodeClient.js +56 -0
- package/esm/package.json +1 -0
- package/esm/resources/api_endpoints.js +1083 -0
- package/esm/util.js +202 -0
- package/package.json +69 -38
- package/types/core.d.ts +558 -89
- package/types/index.d.ts +90 -55
- package/types/resources/Address.d.ts +57 -272
- package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
- package/types/resources/AttachedItem.d.ts +91 -329
- package/types/resources/Attribute.d.ts +5 -5
- package/types/resources/BusinessEntity.d.ts +49 -69
- package/types/resources/BusinessEntityTransfer.d.ts +11 -17
- package/types/resources/Card.d.ts +146 -424
- package/types/resources/Comment.d.ts +72 -189
- package/types/resources/Contact.d.ts +12 -64
- package/types/resources/ContractTerm.d.ts +15 -96
- package/types/resources/Coupon.d.ts +282 -758
- package/types/resources/CouponCode.d.ts +56 -52
- package/types/resources/CouponSet.d.ts +92 -234
- package/types/resources/CreditNote.d.ts +588 -1758
- package/types/resources/CreditNoteEstimate.d.ts +131 -157
- package/types/resources/Currency.d.ts +75 -62
- package/types/resources/Customer.d.ts +892 -835
- package/types/resources/CustomerEntitlement.d.ts +24 -35
- package/types/resources/DifferentialPrice.d.ts +116 -314
- package/types/resources/Discount.d.ts +20 -125
- package/types/resources/Download.d.ts +6 -22
- package/types/resources/Entitlement.d.ts +51 -160
- package/types/resources/EntitlementOverride.d.ts +58 -139
- package/types/resources/Estimate.d.ts +1178 -527
- package/types/resources/Event.d.ts +67 -178
- package/types/resources/Export.d.ts +563 -723
- package/types/resources/Feature.d.ts +117 -433
- package/types/resources/GatewayErrorDetail.d.ts +16 -72
- package/types/resources/Gift.d.ts +265 -432
- package/types/resources/Hierarchy.d.ts +8 -36
- package/types/resources/HostedPage.d.ts +1017 -1153
- package/types/resources/ImpactedItem.d.ts +13 -50
- package/types/resources/ImpactedItemPrice.d.ts +13 -15
- package/types/resources/ImpactedSubscription.d.ts +13 -45
- package/types/resources/InAppSubscription.d.ts +93 -389
- package/types/resources/Installment.d.ts +35 -110
- package/types/resources/InstallmentConfig.d.ts +54 -155
- package/types/resources/InstallmentDetail.d.ts +19 -27
- package/types/resources/Invoice.d.ts +1574 -3157
- package/types/resources/InvoiceEstimate.d.ts +131 -161
- package/types/resources/Item.d.ts +133 -611
- package/types/resources/ItemEntitlement.d.ts +78 -215
- package/types/resources/ItemFamily.d.ts +69 -178
- package/types/resources/ItemPrice.d.ts +291 -1203
- package/types/resources/Metadata.d.ts +3 -5
- package/types/resources/Order.d.ts +538 -1471
- package/types/resources/PaymentIntent.d.ts +163 -347
- package/types/resources/PaymentReferenceNumber.d.ts +7 -29
- package/types/resources/PaymentSource.d.ts +476 -1272
- package/types/resources/PaymentVoucher.d.ts +87 -306
- package/types/resources/PortalSession.d.ts +71 -207
- package/types/resources/PriceVariant.d.ts +91 -279
- package/types/resources/PricingPageSession.d.ts +92 -41
- package/types/resources/PromotionalCredit.d.ts +90 -346
- package/types/resources/Purchase.d.ts +185 -315
- package/types/resources/Quote.d.ts +1406 -887
- package/types/resources/QuoteLineGroup.d.ts +125 -452
- package/types/resources/QuotedCharge.d.ts +45 -274
- package/types/resources/QuotedSubscription.d.ts +100 -488
- package/types/resources/Ramp.d.ts +230 -747
- package/types/resources/ResourceMigration.d.ts +25 -80
- package/types/resources/SiteMigrationDetail.d.ts +34 -112
- package/types/resources/Subscription.d.ts +2390 -4336
- package/types/resources/SubscriptionEntitlement.d.ts +59 -160
- package/types/resources/SubscriptionEstimate.d.ts +51 -75
- package/types/resources/TaxWithheld.d.ts +15 -40
- package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
- package/types/resources/TimeMachine.d.ts +43 -97
- package/types/resources/Token.d.ts +15 -85
- package/types/resources/Transaction.d.ts +276 -911
- package/types/resources/UnbilledCharge.d.ts +189 -164
- package/types/resources/Usage.d.ts +89 -279
- package/types/resources/VirtualBankAccount.d.ts +103 -255
- package/types/resources/filter.d.ts +52 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
- package/.github/ISSUE_TEMPLATE/config.yml +0 -6
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/lib/chargebee.js +0 -512
- package/lib/resources/api_endpoints.js +0 -2935
- package/types/resources/NonSubscription.d.ts +0 -30
- 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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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=2#invoice_line_items_quantity) which is represented by this line item. For `metered` line items, this value is updated from [usages](/docs/api/usages) once when the invoice is generated as `pending` 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 `line_item`. The value is in major units of the currency. Returned when the `line_item` 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 `line_item` 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 `line_item`, in major units of the currency. Typically equals to `unit_amount_in_decimal` x `quantity_in_decimal`. 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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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 `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon`.
|
|
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 `sub_total`. The coupon id is passed as `entity_id`. \* prorated_credits - The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by [adjustment_credit_notes](/docs/api/invoices?prod_cat_ver=2#invoice_adjustment_credit_notes). \* item_level_coupon - The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id`. \* item_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to a line item of the invoice. The discount `id` is available as the `entity_id`. \* promotional_credits - The deduction is due to a [promotional credit](/docs/api/promotional_credits?prod_cat_ver=2) applied to the invoice. \* document_level_discount - The deduction is due to a [discount](/docs/api/discounts?prod_cat_ver=2) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
|
|
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 `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon`, `document_level_discount`, or `document_level_coupon` \* 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 `coupon` or a [discount](discounts), then this is the `id` 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 `entity_id`.
|
|
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
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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 `coupon` or a [discount](discounts), then this is the `id` 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
|
-
|
|
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
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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
|
+
}
|