@wix/auto_sdk_billing_tax-calculation 1.0.10 → 1.0.12

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 (119) hide show
  1. package/build/{internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → cjs/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.d.ts} +50 -23
  2. package/build/cjs/index.d.ts +41 -1
  3. package/build/cjs/index.js +208 -15
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/meta.d.ts +407 -1
  6. package/build/cjs/meta.js +135 -15
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/es/{src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.d.mts} +50 -23
  9. package/build/{internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → es/index.d.mts} +11 -8
  10. package/build/es/index.mjs +185 -0
  11. package/build/es/index.mjs.map +1 -0
  12. package/build/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → es/meta.d.mts} +35 -22
  13. package/build/es/meta.mjs +110 -0
  14. package/build/es/meta.mjs.map +1 -0
  15. package/build/internal/cjs/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.d.ts +421 -0
  16. package/build/internal/cjs/index.d.ts +41 -1
  17. package/build/internal/cjs/index.js +208 -15
  18. package/build/internal/cjs/index.js.map +1 -1
  19. package/build/internal/cjs/meta.d.ts +407 -1
  20. package/build/internal/cjs/meta.js +135 -15
  21. package/build/internal/cjs/meta.js.map +1 -1
  22. package/build/internal/es/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.d.mts +421 -0
  23. package/build/internal/es/{src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts → index.d.mts} +11 -8
  24. package/build/internal/es/index.mjs +185 -0
  25. package/build/internal/es/index.mjs.map +1 -0
  26. package/build/internal/{cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.d.ts → es/meta.d.mts} +35 -22
  27. package/build/internal/es/meta.mjs +110 -0
  28. package/build/internal/es/meta.mjs.map +1 -0
  29. package/package.json +10 -9
  30. package/build/cjs/index.typings.d.ts +0 -1
  31. package/build/cjs/index.typings.js +0 -18
  32. package/build/cjs/index.typings.js.map +0 -1
  33. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  34. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -10
  35. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  36. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  37. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -93
  38. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  39. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  40. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -66
  41. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  42. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts +0 -38
  43. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -20
  44. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  45. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -14
  46. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  47. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -480
  48. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -165
  49. package/build/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  50. package/build/es/index.d.ts +0 -1
  51. package/build/es/index.js +0 -2
  52. package/build/es/index.js.map +0 -1
  53. package/build/es/index.typings.d.ts +0 -1
  54. package/build/es/index.typings.js +0 -2
  55. package/build/es/index.typings.js.map +0 -1
  56. package/build/es/meta.d.ts +0 -1
  57. package/build/es/meta.js +0 -2
  58. package/build/es/meta.js.map +0 -1
  59. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  60. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -6
  61. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  62. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  63. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -88
  64. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  65. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  66. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -38
  67. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  68. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.d.ts +0 -38
  69. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -14
  70. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  71. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -11
  72. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  73. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -480
  74. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -137
  75. package/build/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  76. package/build/internal/cjs/index.typings.d.ts +0 -1
  77. package/build/internal/cjs/index.typings.js +0 -18
  78. package/build/internal/cjs/index.typings.js.map +0 -1
  79. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  80. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -10
  81. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  82. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  83. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -93
  84. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  85. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  86. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -66
  87. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  88. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -20
  89. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  90. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -14
  91. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  92. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -480
  93. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -165
  94. package/build/internal/cjs/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
  95. package/build/internal/es/index.d.ts +0 -1
  96. package/build/internal/es/index.js +0 -2
  97. package/build/internal/es/index.js.map +0 -1
  98. package/build/internal/es/index.typings.d.ts +0 -1
  99. package/build/internal/es/index.typings.js +0 -2
  100. package/build/internal/es/index.typings.js.map +0 -1
  101. package/build/internal/es/meta.d.ts +0 -1
  102. package/build/internal/es/meta.js +0 -2
  103. package/build/internal/es/meta.js.map +0 -1
  104. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.d.ts +0 -6
  105. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js +0 -6
  106. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.js.map +0 -1
  107. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.d.ts +0 -26
  108. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js +0 -88
  109. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.js.map +0 -1
  110. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.d.ts +0 -14
  111. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js +0 -38
  112. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.meta.js.map +0 -1
  113. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js +0 -14
  114. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.js.map +0 -1
  115. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js +0 -11
  116. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.types.js.map +0 -1
  117. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.d.ts +0 -480
  118. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js +0 -137
  119. package/build/internal/es/src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js.map +0 -1
@@ -0,0 +1,421 @@
1
+ interface TaxCalculationGateway {
2
+ /** @format GUID */
3
+ _id?: string | null;
4
+ }
5
+ 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
+ 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
+ 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
+ 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
+ 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
+ interface MultipleAddresses {
140
+ /** Index of the origin address. */
141
+ origin?: number;
142
+ /** Index of the destination address. */
143
+ destination?: number;
144
+ }
145
+ 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
+ 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
+ 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?: JurisdictionTypeWithLiterals;
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
+ declare enum JurisdictionType {
249
+ UNDEFINED = "UNDEFINED",
250
+ COUNTRY = "COUNTRY",
251
+ STATE = "STATE",
252
+ COUNTY = "COUNTY",
253
+ CITY = "CITY",
254
+ SPECIAL = "SPECIAL"
255
+ }
256
+ /** @enumType */
257
+ type JurisdictionTypeWithLiterals = JurisdictionType | 'UNDEFINED' | 'COUNTRY' | 'STATE' | 'COUNTY' | 'CITY' | 'SPECIAL';
258
+ /** Tax details for a specific line item. */
259
+ interface LineItemTaxDetails {
260
+ /**
261
+ * Line item ID.
262
+ * @minLength 1
263
+ * @maxLength 100
264
+ */
265
+ _id?: string;
266
+ /**
267
+ * Line item name to display.
268
+ * @maxLength 250
269
+ */
270
+ itemName?: string | null;
271
+ /**
272
+ * Line item quantity.
273
+ * @min 1
274
+ * @max 100000
275
+ */
276
+ quantity?: number;
277
+ /**
278
+ * Array of each tax applied, grouped by `jurisdiction`.
279
+ * @maxSize 7
280
+ */
281
+ taxBreakdown?: TaxBreakdown[];
282
+ /** Summary of this line item's total price and tax. */
283
+ taxSummary?: LineItemTaxSummary;
284
+ /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */
285
+ addressIndex?: AddressIndex;
286
+ /** Whether tax is included in the price. */
287
+ taxIncludedInPrice?: boolean;
288
+ }
289
+ /** A detailed description of all the tax authorities applied on this item. */
290
+ interface TaxBreakdown {
291
+ /**
292
+ * Jurisdiction that taxes were calculated for.
293
+ * @maxLength 200
294
+ */
295
+ jurisdiction?: string | null;
296
+ /**
297
+ * Non-taxable amount of the price.
298
+ * @format DECIMAL_VALUE
299
+ * @decimalValue options { maxScale:4, gte:0 }
300
+ */
301
+ nonTaxableAmount?: string | null;
302
+ /**
303
+ * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
304
+ * @format DECIMAL_VALUE
305
+ * @decimalValue options { maxScale:6, gte:0 }
306
+ */
307
+ rate?: string | null;
308
+ /**
309
+ * Amount of this tax calculated for this jurisdiction.
310
+ * @format DECIMAL_VALUE
311
+ * @decimalValue options { maxScale:4 }
312
+ */
313
+ taxAmount?: string | null;
314
+ /**
315
+ * Taxable amount of the price.
316
+ * @format DECIMAL_VALUE
317
+ * @decimalValue options { maxScale:4, gte:0 }
318
+ */
319
+ taxableAmount?: string | null;
320
+ /**
321
+ * Type of tax that was calculated. For example, `"Sales Tax"`, `"Income Tax"`, `"Value Added Tax"`, etc.
322
+ * @maxLength 200
323
+ */
324
+ taxType?: string | null;
325
+ /**
326
+ * Name of the tax that was calculated. For example, `"NY State Sales Tax"`, `"Quebec GST"`, etc.
327
+ * @maxLength 200
328
+ */
329
+ taxName?: string | null;
330
+ /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"Çounty"`, `"City"`, `"Special"`, etc. */
331
+ jurisdictionType?: JurisdictionTypeWithLiterals;
332
+ }
333
+ interface LineItemTaxSummary {
334
+ /**
335
+ * Total price for this line item.
336
+ * To determine the price for each individual unit of this line item, divide by `quantity`.
337
+ * @format DECIMAL_VALUE
338
+ * @decimalValue options { lte:1000000000000000 }
339
+ */
340
+ fullPrice?: string | null;
341
+ /**
342
+ * Total amount of tax calculated for this line item.
343
+ * @format DECIMAL_VALUE
344
+ * @decimalValue options { maxScale:4 }
345
+ */
346
+ taxAmount?: string;
347
+ /**
348
+ * Total taxable amount for this line item.
349
+ * @format DECIMAL_VALUE
350
+ * @decimalValue options { maxScale:4 }
351
+ */
352
+ taxableAmount?: string;
353
+ /**
354
+ * ID of the calculator app that calculated tax for this line item.
355
+ * @maxLength 50
356
+ */
357
+ appId?: string | null;
358
+ }
359
+ interface ApplicationError {
360
+ /** Error code. */
361
+ code?: string;
362
+ /** Description of the error. */
363
+ description?: string;
364
+ /** Data related to the error. */
365
+ data?: Record<string, any> | null;
366
+ }
367
+ interface ListTaxCalculatorsRequest {
368
+ }
369
+ interface ListTaxCalculatorsResponse {
370
+ /**
371
+ * Retrieved tax calculators.
372
+ * @maxSize 10
373
+ */
374
+ taxCalculatorDetails?: TaxCalculatorDetails[];
375
+ }
376
+ interface TaxCalculatorDetails {
377
+ /**
378
+ * ID of the tax calculator.
379
+ * @format GUID
380
+ */
381
+ appId?: string;
382
+ /**
383
+ * Display name of the tax calculator.
384
+ * @minLength 1
385
+ * @maxLength 200
386
+ */
387
+ displayName?: string;
388
+ /**
389
+ * 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.
390
+ * @format COUNTRY
391
+ * @maxSize 195
392
+ */
393
+ unsupportedCountries?: string[];
394
+ }
395
+ interface CalculateTaxOptions {
396
+ /**
397
+ * Optional ID of the entity that tax is being calculated for. For example, a cart ID.
398
+ * @format GUID
399
+ * @immutable
400
+ */
401
+ externalId?: string | null;
402
+ /**
403
+ * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
404
+ * @format CURRENCY
405
+ */
406
+ currency?: string;
407
+ /**
408
+ * Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
409
+ * @minSize 1
410
+ * @maxSize 3
411
+ */
412
+ addresses: Address[];
413
+ /**
414
+ * Line items to calculate tax for.
415
+ * @minSize 1
416
+ * @maxSize 300
417
+ */
418
+ lineItems: LineItem[];
419
+ }
420
+
421
+ export { type Address as A, type CalculateTaxOptions as C, JurisdictionType as J, type ListTaxCalculatorsResponse as L, type MultipleAddresses as M, type TaxCalculationGateway as T, type CalculateTaxResponse as a, type CalculateTaxRequest as b, type LineItem as c, type AddressIndex as d, type AddressIndexAddressIndexOptionsOneOf as e, type TaxSummary as f, type AggregatedTaxBreakdown as g, type LineItemTaxDetails as h, type TaxBreakdown as i, type LineItemTaxSummary as j, type ApplicationError as k, type ListTaxCalculatorsRequest as l, type TaxCalculatorDetails as m };
@@ -1,9 +1,8 @@
1
- import { HttpClient } from '@wix/sdk-types';
2
- import { CalculateTaxOptions, CalculateTaxResponse, ListTaxCalculatorsResponse } from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js';
3
- export declare const __metadata: {
4
- PACKAGE_NAME: string;
5
- };
6
- export declare function calculateTax(httpClient: HttpClient): CalculateTaxSignature;
1
+ import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { C as CalculateTaxOptions, a as CalculateTaxResponse, L as ListTaxCalculatorsResponse } from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.mjs';
3
+ export { A as Address, d as AddressIndex, e as AddressIndexAddressIndexOptionsOneOf, g as AggregatedTaxBreakdown, k as ApplicationError, b as CalculateTaxRequest, J as JurisdictionType, c as LineItem, h as LineItemTaxDetails, j as LineItemTaxSummary, l as ListTaxCalculatorsRequest, M as MultipleAddresses, i as TaxBreakdown, T as TaxCalculationGateway, m as TaxCalculatorDetails, f as TaxSummary } from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-Cina_f0e.mjs';
4
+
5
+ declare function calculateTax$1(httpClient: HttpClient): CalculateTaxSignature;
7
6
  interface CalculateTaxSignature {
8
7
  /**
9
8
  * Calculates tax for the provided line items.
@@ -26,7 +25,7 @@ interface CalculateTaxSignature {
26
25
  */
27
26
  (options?: CalculateTaxOptions | undefined): Promise<CalculateTaxResponse>;
28
27
  }
29
- export declare function listTaxCalculators(httpClient: HttpClient): ListTaxCalculatorsSignature;
28
+ declare function listTaxCalculators$1(httpClient: HttpClient): ListTaxCalculatorsSignature;
30
29
  interface ListTaxCalculatorsSignature {
31
30
  /**
32
31
  * Retrieves a list of installed tax calculators.
@@ -35,4 +34,8 @@ interface ListTaxCalculatorsSignature {
35
34
  */
36
35
  (): Promise<ListTaxCalculatorsResponse>;
37
36
  }
38
- export { Address, AddressIndex, AddressIndexAddressIndexOptionsOneOf, AggregatedTaxBreakdown, ApplicationError, CalculateTaxOptions, CalculateTaxRequest, CalculateTaxResponse, JurisdictionType, LineItem, LineItemTaxDetails, LineItemTaxSummary, ListTaxCalculatorsRequest, ListTaxCalculatorsResponse, MultipleAddresses, TaxBreakdown, TaxCalculationGateway, TaxCalculatorDetails, TaxSummary, } from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.js';
37
+
38
+ declare const calculateTax: MaybeContext<BuildRESTFunction<typeof calculateTax$1> & typeof calculateTax$1>;
39
+ declare const listTaxCalculators: MaybeContext<BuildRESTFunction<typeof listTaxCalculators$1> & typeof listTaxCalculators$1>;
40
+
41
+ export { CalculateTaxOptions, CalculateTaxResponse, ListTaxCalculatorsResponse, calculateTax, listTaxCalculators };
@@ -0,0 +1,185 @@
1
+ // src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import {
4
+ renameKeysFromSDKRequestToRESTRequest,
5
+ renameKeysFromRESTResponseToSDKResponse
6
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
7
+
8
+ // src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.http.ts
9
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
10
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
11
+ function resolveWixBillingV1TaxCalculationUrl(opts) {
12
+ const domainToMappings = {
13
+ "manage._base_domain_": [
14
+ {
15
+ srcPath: "/billing/v1/calculate-tax",
16
+ destPath: "/v1/calculate-tax"
17
+ },
18
+ {
19
+ srcPath: "/billing/v1/list-tax-calculators",
20
+ destPath: "/v1/list-tax-calculators"
21
+ }
22
+ ],
23
+ "www.wixapis.com": [
24
+ {
25
+ srcPath: "/billing/v1/calculate-tax",
26
+ destPath: "/v1/calculate-tax"
27
+ },
28
+ {
29
+ srcPath: "/billing/v1/list-tax-calculators",
30
+ destPath: "/v1/list-tax-calculators"
31
+ }
32
+ ]
33
+ };
34
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
35
+ }
36
+ var PACKAGE_NAME = "@wix/auto_sdk_billing_tax-calculation";
37
+ function calculateTax(payload) {
38
+ function __calculateTax({ host }) {
39
+ const metadata = {
40
+ entityFqdn: "wix.gateways.billing.v1.tax_calculation_gateway",
41
+ method: "POST",
42
+ methodFqn: "wix.billing.v1.TaxCalculation.CalculateTax",
43
+ packageName: PACKAGE_NAME,
44
+ url: resolveWixBillingV1TaxCalculationUrl({
45
+ protoPath: "/v1/calculate-tax",
46
+ data: payload,
47
+ host
48
+ }),
49
+ data: payload
50
+ };
51
+ return metadata;
52
+ }
53
+ return __calculateTax;
54
+ }
55
+ function listTaxCalculators(payload) {
56
+ function __listTaxCalculators({ host }) {
57
+ const metadata = {
58
+ entityFqdn: "wix.gateways.billing.v1.tax_calculation_gateway",
59
+ method: "GET",
60
+ methodFqn: "wix.billing.v1.TaxCalculation.ListTaxCalculators",
61
+ packageName: PACKAGE_NAME,
62
+ url: resolveWixBillingV1TaxCalculationUrl({
63
+ protoPath: "/v1/list-tax-calculators",
64
+ data: payload,
65
+ host
66
+ }),
67
+ params: toURLSearchParams(payload)
68
+ };
69
+ return metadata;
70
+ }
71
+ return __listTaxCalculators;
72
+ }
73
+
74
+ // src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal.ts
75
+ import { transformSDKAddressToRESTAddress } from "@wix/sdk-runtime/transformations/address";
76
+ import { transformRESTAddressToSDKAddress } from "@wix/sdk-runtime/transformations/address";
77
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
78
+ var JurisdictionType = /* @__PURE__ */ ((JurisdictionType2) => {
79
+ JurisdictionType2["UNDEFINED"] = "UNDEFINED";
80
+ JurisdictionType2["COUNTRY"] = "COUNTRY";
81
+ JurisdictionType2["STATE"] = "STATE";
82
+ JurisdictionType2["COUNTY"] = "COUNTY";
83
+ JurisdictionType2["CITY"] = "CITY";
84
+ JurisdictionType2["SPECIAL"] = "SPECIAL";
85
+ return JurisdictionType2;
86
+ })(JurisdictionType || {});
87
+ async function calculateTax2(options) {
88
+ const { httpClient, sideEffects } = arguments[1];
89
+ const payload = transformPaths(
90
+ renameKeysFromSDKRequestToRESTRequest({
91
+ externalId: options?.externalId,
92
+ currency: options?.currency,
93
+ addresses: options?.addresses,
94
+ lineItems: options?.lineItems
95
+ }),
96
+ [
97
+ {
98
+ transformFn: transformSDKAddressToRESTAddress,
99
+ paths: [{ path: "addresses", isRepeated: true }]
100
+ }
101
+ ]
102
+ );
103
+ const reqOpts = calculateTax(payload);
104
+ sideEffects?.onSiteCall?.();
105
+ try {
106
+ const result = await httpClient.request(reqOpts);
107
+ sideEffects?.onSuccess?.(result);
108
+ return renameKeysFromRESTResponseToSDKResponse(
109
+ transformPaths(result.data, [
110
+ {
111
+ transformFn: transformRESTAddressToSDKAddress,
112
+ paths: [{ path: "addresses", isRepeated: true }]
113
+ }
114
+ ])
115
+ );
116
+ } catch (err) {
117
+ const transformedError = sdkTransformError(
118
+ err,
119
+ {
120
+ spreadPathsToArguments: {},
121
+ explicitPathsToArguments: {
122
+ externalId: "$[0].externalId",
123
+ currency: "$[0].currency",
124
+ addresses: "$[0].addresses",
125
+ lineItems: "$[0].lineItems"
126
+ },
127
+ singleArgumentUnchanged: false
128
+ },
129
+ ["options"]
130
+ );
131
+ sideEffects?.onError?.(err);
132
+ throw transformedError;
133
+ }
134
+ }
135
+ async function listTaxCalculators2() {
136
+ const { httpClient, sideEffects } = arguments[0];
137
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
138
+ const reqOpts = listTaxCalculators(
139
+ payload
140
+ );
141
+ sideEffects?.onSiteCall?.();
142
+ try {
143
+ const result = await httpClient.request(reqOpts);
144
+ sideEffects?.onSuccess?.(result);
145
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
146
+ } catch (err) {
147
+ const transformedError = sdkTransformError(
148
+ err,
149
+ {
150
+ spreadPathsToArguments: {},
151
+ explicitPathsToArguments: {},
152
+ singleArgumentUnchanged: false
153
+ },
154
+ []
155
+ );
156
+ sideEffects?.onError?.(err);
157
+ throw transformedError;
158
+ }
159
+ }
160
+
161
+ // src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.public.ts
162
+ function calculateTax3(httpClient) {
163
+ return (options) => calculateTax2(
164
+ options,
165
+ // @ts-ignore
166
+ { httpClient }
167
+ );
168
+ }
169
+ function listTaxCalculators3(httpClient) {
170
+ return () => listTaxCalculators2(
171
+ // @ts-ignore
172
+ { httpClient }
173
+ );
174
+ }
175
+
176
+ // src/gateways-billing-v1-tax-calculation-gateway-tax-calculation.context.ts
177
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
178
+ var calculateTax4 = /* @__PURE__ */ createRESTModule(calculateTax3);
179
+ var listTaxCalculators4 = /* @__PURE__ */ createRESTModule(listTaxCalculators3);
180
+ export {
181
+ JurisdictionType,
182
+ calculateTax4 as calculateTax,
183
+ listTaxCalculators4 as listTaxCalculators
184
+ };
185
+ //# sourceMappingURL=index.mjs.map