@wix/auto_sdk_ecom_tax-calculation 1.0.2 → 1.0.4

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 (130) hide show
  1. package/build/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.d.mts +419 -0
  2. package/build/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.d.ts +419 -0
  3. package/build/{internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → index.d.mts} +13 -10
  4. package/build/{es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → index.d.ts} +13 -10
  5. package/build/index.js +211 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +185 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.d.mts +419 -0
  10. package/build/internal/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ps-Yz0Nn.d.ts +419 -0
  11. package/build/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → internal/index.d.mts} +13 -10
  12. package/build/internal/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → index.d.ts} +13 -10
  13. package/build/internal/index.js +211 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +185 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → internal/meta.d.mts} +34 -79
  18. package/build/{es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → internal/meta.d.ts} +34 -79
  19. package/build/internal/meta.js +138 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +110 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/{internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → meta.d.mts} +34 -79
  24. package/build/{internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → meta.d.ts} +34 -79
  25. package/build/meta.js +138 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +110 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  40. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -10
  41. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  42. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  43. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -93
  44. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  45. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  46. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -66
  47. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  48. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -20
  49. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  50. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -14
  51. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  52. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -535
  53. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -165
  54. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/package.json +0 -3
  65. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  66. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -6
  67. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  68. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  69. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -88
  70. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  71. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  72. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -38
  73. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  74. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -14
  75. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  76. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -11
  77. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  78. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -535
  79. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -137
  80. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  81. package/build/internal/cjs/index.d.ts +0 -1
  82. package/build/internal/cjs/index.js +0 -18
  83. package/build/internal/cjs/index.js.map +0 -1
  84. package/build/internal/cjs/index.typings.d.ts +0 -1
  85. package/build/internal/cjs/index.typings.js +0 -18
  86. package/build/internal/cjs/index.typings.js.map +0 -1
  87. package/build/internal/cjs/meta.d.ts +0 -1
  88. package/build/internal/cjs/meta.js +0 -18
  89. package/build/internal/cjs/meta.js.map +0 -1
  90. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  91. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -10
  92. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  93. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  94. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -93
  95. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  96. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  97. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -66
  98. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  99. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -20
  100. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  101. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -14
  102. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  103. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -535
  104. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -165
  105. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  106. package/build/internal/es/index.d.ts +0 -1
  107. package/build/internal/es/index.js +0 -2
  108. package/build/internal/es/index.js.map +0 -1
  109. package/build/internal/es/index.typings.d.ts +0 -1
  110. package/build/internal/es/index.typings.js +0 -2
  111. package/build/internal/es/index.typings.js.map +0 -1
  112. package/build/internal/es/meta.d.ts +0 -1
  113. package/build/internal/es/meta.js +0 -2
  114. package/build/internal/es/meta.js.map +0 -1
  115. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  116. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -6
  117. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  118. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  119. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -88
  120. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  121. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  122. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -38
  123. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  124. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -14
  125. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  126. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -11
  127. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  128. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -535
  129. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -137
  130. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
@@ -1,535 +0,0 @@
1
- export interface TaxCalculationGateway {
2
- /** @format GUID */
3
- _id?: string | null;
4
- }
5
- export interface CalculateTaxRequest {
6
- /**
7
- * Optional ID of the entity that tax is being calculated for. For example, a cart ID.
8
- * @format GUID
9
- * @immutable
10
- */
11
- externalId?: string | null;
12
- /**
13
- * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
14
- * @format CURRENCY
15
- */
16
- currency?: string;
17
- /**
18
- * Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
19
- * @minSize 1
20
- * @maxSize 3
21
- */
22
- addresses: Address[];
23
- /**
24
- * Line items to calculate tax for.
25
- * @minSize 1
26
- * @maxSize 300
27
- */
28
- lineItems: LineItem[];
29
- }
30
- /** Wix common address format for physical address to use if you plan to store addresses in your service. */
31
- export interface Address {
32
- /**
33
- * 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.
34
- * @format COUNTRY
35
- */
36
- country?: string | null;
37
- /**
38
- * Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
39
- * @maxLength 50
40
- */
41
- subdivision?: string | null;
42
- /**
43
- * City name.
44
- * @maxLength 100
45
- */
46
- city?: string | null;
47
- /**
48
- * Postal or zip code.
49
- * @maxLength 50
50
- */
51
- postalCode?: string | null;
52
- /**
53
- * Main address line, usually street and number as free text.
54
- * @maxLength 200
55
- */
56
- addressLine1?: string | null;
57
- /**
58
- * Free text providing more detailed address information, such as apartment, suite, or floor.
59
- * @maxLength 200
60
- */
61
- addressLine2?: string | null;
62
- }
63
- /** Line items to calculate tax for. */
64
- export interface LineItem {
65
- /**
66
- * Line item ID.
67
- * @minLength 1
68
- * @maxLength 100
69
- */
70
- _id?: string;
71
- /**
72
- * Line item name to display.
73
- * @maxLength 250
74
- */
75
- itemName?: string | null;
76
- /**
77
- * Line item quantity.
78
- * @min 1
79
- * @max 100000
80
- */
81
- quantity?: number;
82
- /**
83
- * Line item price.
84
- * @format DECIMAL_VALUE
85
- * @decimalValue options { lte:1000000000000000 }
86
- */
87
- price?: string;
88
- /**
89
- * Stock keeping unit for this line item. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).
90
- * @maxLength 40
91
- */
92
- itemCode?: string | null;
93
- /**
94
- * Tax group ID for this line item. If not provided, the default tax group applies.
95
- * @format GUID
96
- */
97
- taxGroupId?: string | null;
98
- /**
99
- * ID of the app providing the catalog for this line item.
100
- *
101
- * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
102
- *
103
- * For items from Wix catalogs, the following values always apply:
104
- * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
105
- * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
106
- * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
107
- * @format GUID
108
- */
109
- appId?: string | null;
110
- /** Whether tax is included in the price. */
111
- taxIncludedInPrice?: boolean | null;
112
- /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
113
- addressIndex?: AddressIndex;
114
- }
115
- /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
116
- export interface AddressIndex extends AddressIndexAddressIndexOptionsOneOf {
117
- /** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */
118
- singleAddress?: number;
119
- /**
120
- * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from,
121
- * as well as the address the item is shipped to.
122
- */
123
- multipleAddresses?: MultipleAddresses;
124
- }
125
- /** @oneof */
126
- export interface AddressIndexAddressIndexOptionsOneOf {
127
- /** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */
128
- singleAddress?: number;
129
- /**
130
- * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from,
131
- * as well as the address the item is shipped to.
132
- */
133
- multipleAddresses?: MultipleAddresses;
134
- }
135
- /**
136
- * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item
137
- * is shipped from, as well as the address the item is shipped to.
138
- */
139
- export interface MultipleAddresses {
140
- /** Index of the origin address. */
141
- origin?: number;
142
- /** Index of the destination address. */
143
- destination?: number;
144
- }
145
- export interface CalculateTaxResponse {
146
- /**
147
- * Optional ID of the entity that tax is being calculated for. For example, a cart ID.
148
- * @format GUID
149
- * @immutable
150
- */
151
- externalId?: string | null;
152
- /**
153
- * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
154
- * @format CURRENCY
155
- */
156
- currency?: string;
157
- /**
158
- * Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
159
- * @minSize 1
160
- * @maxSize 3
161
- */
162
- addresses?: Address[];
163
- /** Summary of the tax calculated. */
164
- taxSummary?: TaxSummary;
165
- /**
166
- * Details of each tax applied to each line item.
167
- * @minSize 1
168
- * @maxSize 300
169
- */
170
- lineItemTaxDetails?: LineItemTaxDetails[];
171
- /**
172
- * Errors that occurred during the tax calculation.
173
- * @maxSize 100
174
- */
175
- errors?: ApplicationError[];
176
- }
177
- export interface TaxSummary {
178
- /**
179
- * Total price for all line items.
180
- * @format DECIMAL_VALUE
181
- * @decimalValue options { maxScale:4 }
182
- */
183
- totalAmount?: string;
184
- /**
185
- * Total amount of tax calculated for all line items.
186
- * Note that due to rounding, `totalTax` may not equal the sum of `lineItemTaxDetails.taxSummary.taxAmount`.
187
- * @format DECIMAL_VALUE
188
- * @decimalValue options { maxScale:4 }
189
- */
190
- totalTax?: string;
191
- /**
192
- * Total taxable amount for all line items.
193
- * @format DECIMAL_VALUE
194
- * @decimalValue options { maxScale:4 }
195
- */
196
- totalTaxableAmount?: string;
197
- /**
198
- * Total amount of `totalTax` that is included in price. Applies to line items with `taxIncludedInPrice` set to `true`.
199
- * @format DECIMAL_VALUE
200
- * @decimalValue options { maxScale:4 }
201
- */
202
- totalTaxIncludedInPrice?: string;
203
- /**
204
- * Array of each tax applied, grouped by `"jurisdiction"`, `"jurisdictionType"`, `"taxType"`, `"taxName"` and `"rate"`.
205
- * @maxSize 50
206
- */
207
- aggregatedTaxBreakdown?: AggregatedTaxBreakdown[];
208
- }
209
- /**
210
- * The summary of the tax breakdown for all the line items. It will hold for each tax name, the aggregated tax amount paid for it and the tax rate.
211
- * Tax breakdown is the tax amount split to the tax authorities that applied on the line item.
212
- *
213
- * Note: Because that the tax is calculated only on the taxable amount, the tax amount may be looks strange.
214
- * e.g. if you pay 100$ and the tax applies only on 50$ from it with tax rate of 10%,
215
- * then the tax rate will be remain 10% but tax amount in the breakdown will be 5$ instead of 10$.
216
- */
217
- export interface AggregatedTaxBreakdown {
218
- /**
219
- * Name of the tax that was calculated.
220
- * @maxLength 200
221
- */
222
- taxName?: string;
223
- /**
224
- * Type of tax that was calculated.
225
- * @maxLength 200
226
- */
227
- taxType?: string;
228
- /**
229
- * Jurisdiction that taxes were calculated for.
230
- * @maxLength 200
231
- */
232
- jurisdiction?: string;
233
- /** Type of jurisdiction that taxes were calculated for. */
234
- jurisdictionType?: JurisdictionType;
235
- /**
236
- * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
237
- * @decimalValue options { gte:0, maxScale:6 }
238
- */
239
- rate?: string;
240
- /**
241
- * Total amount of this tax for this jurisdiction.
242
- * @format DECIMAL_VALUE
243
- * @decimalValue options { maxScale:4 }
244
- */
245
- aggregatedTaxAmount?: string;
246
- }
247
- /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"County"`, `"City"`, `"Special"`, etc. */
248
- export declare enum JurisdictionType {
249
- UNDEFINED = "UNDEFINED",
250
- COUNTRY = "COUNTRY",
251
- STATE = "STATE",
252
- COUNTY = "COUNTY",
253
- CITY = "CITY",
254
- SPECIAL = "SPECIAL"
255
- }
256
- /** Tax details for a specific line item. */
257
- export interface LineItemTaxDetails {
258
- /**
259
- * Line item ID.
260
- * @minLength 1
261
- * @maxLength 100
262
- */
263
- _id?: string;
264
- /**
265
- * Line item name to display.
266
- * @maxLength 250
267
- */
268
- itemName?: string | null;
269
- /**
270
- * Line item quantity.
271
- * @min 1
272
- * @max 100000
273
- */
274
- quantity?: number;
275
- /**
276
- * Array of each tax applied, grouped by `jurisdiction`.
277
- * @maxSize 7
278
- */
279
- taxBreakdown?: TaxBreakdown[];
280
- /** Summary of this line item's total price and tax. */
281
- taxSummary?: LineItemTaxSummary;
282
- /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
283
- addressIndex?: AddressIndex;
284
- /** Whether tax is included in the price. */
285
- taxIncludedInPrice?: boolean;
286
- }
287
- /** A detailed description of all the tax authorities applied on this item. */
288
- export interface TaxBreakdown {
289
- /**
290
- * Jurisdiction that taxes were calculated for.
291
- * @maxLength 200
292
- */
293
- jurisdiction?: string | null;
294
- /**
295
- * Non-taxable amount of the price.
296
- * @format DECIMAL_VALUE
297
- * @decimalValue options { maxScale:4, gte:0 }
298
- */
299
- nonTaxableAmount?: string | null;
300
- /**
301
- * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
302
- * @format DECIMAL_VALUE
303
- * @decimalValue options { maxScale:6, gte:0 }
304
- */
305
- rate?: string | null;
306
- /**
307
- * Amount of this tax calculated for this jurisdiction.
308
- * @format DECIMAL_VALUE
309
- * @decimalValue options { maxScale:4 }
310
- */
311
- taxAmount?: string | null;
312
- /**
313
- * Taxable amount of the price.
314
- * @format DECIMAL_VALUE
315
- * @decimalValue options { maxScale:4, gte:0 }
316
- */
317
- taxableAmount?: string | null;
318
- /**
319
- * Type of tax that was calculated. For example, `"Sales Tax"`, `"Income Tax"`, `"Value Added Tax"`, etc.
320
- * @maxLength 200
321
- */
322
- taxType?: string | null;
323
- /**
324
- * Name of the tax that was calculated. For example, `"NY State Sales Tax"`, `"Quebec GST"`, etc.
325
- * @maxLength 200
326
- */
327
- taxName?: string | null;
328
- /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"Çounty"`, `"City"`, `"Special"`, etc. */
329
- jurisdictionType?: JurisdictionType;
330
- }
331
- export interface LineItemTaxSummary {
332
- /**
333
- * Total price for this line item.
334
- * To determine the price for each individual unit of this line item, divide by `quantity`.
335
- * @format DECIMAL_VALUE
336
- * @decimalValue options { lte:1000000000000000 }
337
- */
338
- fullPrice?: string | null;
339
- /**
340
- * Total amount of tax calculated for this line item.
341
- * @format DECIMAL_VALUE
342
- * @decimalValue options { maxScale:4 }
343
- */
344
- taxAmount?: string;
345
- /**
346
- * Total taxable amount for this line item.
347
- * @format DECIMAL_VALUE
348
- * @decimalValue options { maxScale:4 }
349
- */
350
- taxableAmount?: string;
351
- /**
352
- * ID of the calculator app that calculated tax for this line item.
353
- * @maxLength 50
354
- */
355
- appId?: string | null;
356
- }
357
- export interface ApplicationError {
358
- /** Error code. */
359
- code?: string;
360
- /** Description of the error. */
361
- description?: string;
362
- /** Data related to the error. */
363
- data?: Record<string, any> | null;
364
- }
365
- export interface ListTaxCalculatorsRequest {
366
- }
367
- export interface ListTaxCalculatorsResponse {
368
- /**
369
- * Retrieved tax calculators.
370
- * @maxSize 10
371
- */
372
- taxCalculatorDetails?: TaxCalculatorDetails[];
373
- }
374
- export interface TaxCalculatorDetails {
375
- /**
376
- * ID of the tax calculator.
377
- * @format GUID
378
- */
379
- appId?: string;
380
- /**
381
- * Display name of the tax calculator.
382
- * @minLength 1
383
- * @maxLength 200
384
- */
385
- displayName?: string;
386
- /**
387
- * List of countries, in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format, that the calculator does not support.
388
- * @format COUNTRY
389
- * @maxSize 195
390
- */
391
- unsupportedCountries?: string[];
392
- }
393
- interface AggregatedTaxBreakdownNonNullableFields {
394
- taxName: string;
395
- taxType: string;
396
- jurisdiction: string;
397
- jurisdictionType: JurisdictionType;
398
- rate: string;
399
- aggregatedTaxAmount: string;
400
- aggregatedTaxableAmount: string;
401
- }
402
- interface TaxSummaryNonNullableFields {
403
- totalAmount: string;
404
- totalTax: string;
405
- totalTaxableAmount: string;
406
- totalTaxIncludedInPrice: string;
407
- aggregatedTaxBreakdown: AggregatedTaxBreakdownNonNullableFields[];
408
- }
409
- interface TaxBreakdownNonNullableFields {
410
- jurisdictionType: JurisdictionType;
411
- }
412
- interface LineItemTaxSummaryNonNullableFields {
413
- taxAmount: string;
414
- taxableAmount: string;
415
- }
416
- interface MultipleAddressesNonNullableFields {
417
- origin: number;
418
- destination: number;
419
- }
420
- interface AddressIndexNonNullableFields {
421
- singleAddress: number;
422
- multipleAddresses?: MultipleAddressesNonNullableFields;
423
- }
424
- interface LineItemTaxDetailsNonNullableFields {
425
- _id: string;
426
- quantity: number;
427
- taxBreakdown: TaxBreakdownNonNullableFields[];
428
- taxSummary?: LineItemTaxSummaryNonNullableFields;
429
- addressIndex?: AddressIndexNonNullableFields;
430
- taxIncludedInPrice: boolean;
431
- }
432
- interface ApplicationErrorNonNullableFields {
433
- code: string;
434
- description: string;
435
- }
436
- export interface CalculateTaxResponseNonNullableFields {
437
- currency: string;
438
- taxSummary?: TaxSummaryNonNullableFields;
439
- lineItemTaxDetails: LineItemTaxDetailsNonNullableFields[];
440
- errors: ApplicationErrorNonNullableFields[];
441
- }
442
- interface TaxCalculatorDetailsNonNullableFields {
443
- appId: string;
444
- displayName: string;
445
- unsupportedCountries: string[];
446
- }
447
- export interface ListTaxCalculatorsResponseNonNullableFields {
448
- taxCalculatorDetails: TaxCalculatorDetailsNonNullableFields[];
449
- }
450
- /**
451
- * Calculates tax for the provided line items.
452
- *
453
- * Tax is calculated for each line item based on the tax region
454
- * that corresponds to the address provided in `lineItems.addressIndex` and the tax group in `taxGroupId`. If no tax region is found for
455
- * the line item's address then no tax will be calculated for this line item. If no tax group with that `taxGroupId` is found then the
456
- * default tax group is used to calculate tax. Call List Default Tax Groups to retrieve a site's default tax groups.
457
- *
458
- * The tax is calculated by a tax calculator app installed on the site.
459
- * Call List Tax Calculators to see which tax calculators are available.
460
- * To provide your own tax calculations, use the Tax Calculation service plugin.
461
- *
462
- * The breakdown of calculated tax returned, includes:
463
- * + `taxSummary`: The overall total tax calculated.
464
- * + `taxSummary.aggregatedTaxBreakdown`: The total tax calculated for each jurisdiction.
465
- * + `lineItemTaxDetails.taxSummary`: The total tax calculated for each line item.
466
- * + `lineItemTaxDetails.taxBreakdown`: The tax calculated for each line item in each jurisdiction.
467
- * @public
468
- * @documentationMaturity preview
469
- * @requiredField options.addresses
470
- * @requiredField options.lineItems
471
- * @requiredField options.lineItems._id
472
- * @requiredField options.lineItems.addressIndex
473
- * @requiredField options.lineItems.price
474
- * @param options - Calculate tax options.
475
- * @permissionId BILLING.CALCULATE_TAX
476
- * @permissionScope Manage Stores - all permissions
477
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
478
- * @permissionScope Manage Restaurants - all permissions
479
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
480
- * @permissionScope Manage eCommerce - all permissions
481
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
482
- * @permissionScope Picasso private app mega scope
483
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
484
- * @permissionScope Manage Orders
485
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
486
- * @applicableIdentity APP
487
- * @applicableIdentity VISITOR
488
- * @fqn wix.billing.v1.TaxCalculation.CalculateTax
489
- */
490
- export declare function calculateTax(options?: CalculateTaxOptions): Promise<CalculateTaxResponse & CalculateTaxResponseNonNullableFields>;
491
- export interface CalculateTaxOptions {
492
- /**
493
- * Optional ID of the entity that tax is being calculated for. For example, a cart ID.
494
- * @format GUID
495
- * @immutable
496
- */
497
- externalId?: string | null;
498
- /**
499
- * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
500
- * @format CURRENCY
501
- */
502
- currency?: string;
503
- /**
504
- * Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
505
- * @minSize 1
506
- * @maxSize 3
507
- */
508
- addresses: Address[];
509
- /**
510
- * Line items to calculate tax for.
511
- * @minSize 1
512
- * @maxSize 300
513
- */
514
- lineItems: LineItem[];
515
- }
516
- /**
517
- * Retrieves a list of installed tax calculators.
518
- *
519
- * Wix uses these calculators to calculate tax.
520
- * @public
521
- * @documentationMaturity preview
522
- * @permissionId BILLING.TAX_CALCULATORS_READ
523
- * @permissionScope Manage Stores - all permissions
524
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
525
- * @permissionScope Manage Restaurants - all permissions
526
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
527
- * @permissionScope Picasso private app mega scope
528
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
529
- * @permissionScope Manage Orders
530
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
531
- * @applicableIdentity APP
532
- * @fqn wix.billing.v1.TaxCalculation.ListTaxCalculators
533
- */
534
- export declare function listTaxCalculators(): Promise<ListTaxCalculatorsResponse & ListTaxCalculatorsResponseNonNullableFields>;
535
- export {};
@@ -1,137 +0,0 @@
1
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
- import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
- import * as ambassadorWixGatewaysBillingV1TaxCalculationGateway from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js';
4
- import { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';
5
- import { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';
6
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
7
- /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"County"`, `"City"`, `"Special"`, etc. */
8
- export var JurisdictionType;
9
- (function (JurisdictionType) {
10
- JurisdictionType["UNDEFINED"] = "UNDEFINED";
11
- JurisdictionType["COUNTRY"] = "COUNTRY";
12
- JurisdictionType["STATE"] = "STATE";
13
- JurisdictionType["COUNTY"] = "COUNTY";
14
- JurisdictionType["CITY"] = "CITY";
15
- JurisdictionType["SPECIAL"] = "SPECIAL";
16
- })(JurisdictionType || (JurisdictionType = {}));
17
- /**
18
- * Calculates tax for the provided line items.
19
- *
20
- * Tax is calculated for each line item based on the tax region
21
- * that corresponds to the address provided in `lineItems.addressIndex` and the tax group in `taxGroupId`. If no tax region is found for
22
- * the line item's address then no tax will be calculated for this line item. If no tax group with that `taxGroupId` is found then the
23
- * default tax group is used to calculate tax. Call List Default Tax Groups to retrieve a site's default tax groups.
24
- *
25
- * The tax is calculated by a tax calculator app installed on the site.
26
- * Call List Tax Calculators to see which tax calculators are available.
27
- * To provide your own tax calculations, use the Tax Calculation service plugin.
28
- *
29
- * The breakdown of calculated tax returned, includes:
30
- * + `taxSummary`: The overall total tax calculated.
31
- * + `taxSummary.aggregatedTaxBreakdown`: The total tax calculated for each jurisdiction.
32
- * + `lineItemTaxDetails.taxSummary`: The total tax calculated for each line item.
33
- * + `lineItemTaxDetails.taxBreakdown`: The tax calculated for each line item in each jurisdiction.
34
- * @public
35
- * @documentationMaturity preview
36
- * @requiredField options.addresses
37
- * @requiredField options.lineItems
38
- * @requiredField options.lineItems._id
39
- * @requiredField options.lineItems.addressIndex
40
- * @requiredField options.lineItems.price
41
- * @param options - Calculate tax options.
42
- * @permissionId BILLING.CALCULATE_TAX
43
- * @permissionScope Manage Stores - all permissions
44
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
45
- * @permissionScope Manage Restaurants - all permissions
46
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
47
- * @permissionScope Manage eCommerce - all permissions
48
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
49
- * @permissionScope Picasso private app mega scope
50
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
51
- * @permissionScope Manage Orders
52
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
53
- * @applicableIdentity APP
54
- * @applicableIdentity VISITOR
55
- * @fqn wix.billing.v1.TaxCalculation.CalculateTax
56
- */
57
- export async function calculateTax(options) {
58
- // @ts-ignore
59
- const { httpClient, sideEffects } = arguments[1];
60
- const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
61
- externalId: options?.externalId,
62
- currency: options?.currency,
63
- addresses: options?.addresses,
64
- lineItems: options?.lineItems,
65
- }), [
66
- {
67
- transformFn: transformSDKAddressToRESTAddress,
68
- paths: [{ path: 'addresses', isRepeated: true }],
69
- },
70
- ]);
71
- const reqOpts = ambassadorWixGatewaysBillingV1TaxCalculationGateway.calculateTax(payload);
72
- sideEffects?.onSiteCall?.();
73
- try {
74
- const result = await httpClient.request(reqOpts);
75
- sideEffects?.onSuccess?.(result);
76
- return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
77
- {
78
- transformFn: transformRESTAddressToSDKAddress,
79
- paths: [{ path: 'addresses', isRepeated: true }],
80
- },
81
- ]));
82
- }
83
- catch (err) {
84
- const transformedError = sdkTransformError(err, {
85
- spreadPathsToArguments: {},
86
- explicitPathsToArguments: {
87
- externalId: '$[0].externalId',
88
- currency: '$[0].currency',
89
- addresses: '$[0].addresses',
90
- lineItems: '$[0].lineItems',
91
- },
92
- singleArgumentUnchanged: false,
93
- }, ['options']);
94
- sideEffects?.onError?.(err);
95
- throw transformedError;
96
- }
97
- }
98
- /**
99
- * Retrieves a list of installed tax calculators.
100
- *
101
- * Wix uses these calculators to calculate tax.
102
- * @public
103
- * @documentationMaturity preview
104
- * @permissionId BILLING.TAX_CALCULATORS_READ
105
- * @permissionScope Manage Stores - all permissions
106
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
107
- * @permissionScope Manage Restaurants - all permissions
108
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
109
- * @permissionScope Picasso private app mega scope
110
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
111
- * @permissionScope Manage Orders
112
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
113
- * @applicableIdentity APP
114
- * @fqn wix.billing.v1.TaxCalculation.ListTaxCalculators
115
- */
116
- export async function listTaxCalculators() {
117
- // @ts-ignore
118
- const { httpClient, sideEffects } = arguments[0];
119
- const payload = renameKeysFromSDKRequestToRESTRequest({});
120
- const reqOpts = ambassadorWixGatewaysBillingV1TaxCalculationGateway.listTaxCalculators(payload);
121
- sideEffects?.onSiteCall?.();
122
- try {
123
- const result = await httpClient.request(reqOpts);
124
- sideEffects?.onSuccess?.(result);
125
- return renameKeysFromRESTResponseToSDKResponse(result.data);
126
- }
127
- catch (err) {
128
- const transformedError = sdkTransformError(err, {
129
- spreadPathsToArguments: {},
130
- explicitPathsToArguments: {},
131
- singleArgumentUnchanged: false,
132
- }, []);
133
- sideEffects?.onError?.(err);
134
- throw transformedError;
135
- }
136
- }
137
- //# sourceMappingURL=gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js","sourceRoot":"","sources":["../../../src/gateways-billing-v1-tax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