@wix/ditto-codegen-public 1.0.7 → 1.0.8

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.
@@ -0,0 +1,244 @@
1
+
2
+ <tax_calculation_provider_service_plugin>
3
+ <purpose>**Required.** Base URI where the endpoints are called. Wix appends the endpoint path to the base URI.
4
+
5
+ For example, to call the Calculate Tax endpoint at `https://my-tax-calc.com/v1/calculateTax`, the base URI you provide here is `"https://my-tax-calc.com/"`.</purpose>
6
+ <use_cases>
7
+ - Handle addresses: Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
8
+ - Handle currency: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
9
+ - Handle lineItems: Line items to calculate tax for.
10
+ </use_cases>
11
+ <required_handlers>
12
+ - calculateTax() - Handler to process: Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
13
+ </required_handlers>
14
+ <import>import { taxCalculationProvider } from '@wix/ecom/service-plugins'</import>
15
+ <types>
16
+
17
+ **Address**
18
+ Properties:
19
+ - addressLine1: string - Main address line, usually street and number as free text.
20
+
21
+ maxLength 200
22
+ - addressLine2: string - Free text providing more detailed address information, such as apartment, suite, or floor.
23
+
24
+ maxLength 200
25
+ - city: string - City name.
26
+
27
+ maxLength 100
28
+ - country: string - 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.
29
+
30
+ format COUNTRY
31
+ - postalCode: string - Postal or zip code.
32
+
33
+ maxLength 50
34
+ - subdivision: string - Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
35
+
36
+ maxLength 50
37
+
38
+ **AddressIndex**
39
+ One of (addressIndexOptions):
40
+ - multipleAddresses: MultipleAddresses - Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from,
41
+ as well as the address the item is shipped to.
42
+ - singleAddress: number - Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based.
43
+
44
+ **AlternativeUri**
45
+ Properties:
46
+ - absoluteUri: string - Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.
47
+ Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.
48
+
49
+ minLength 6, maxLength 2048
50
+ - methodName: string - Name of the method to create a custom URI for.
51
+
52
+ For `methodName`, use the name of the method in PascalCase.
53
+ For example, for Get Shipping Rates use `GetShippingRates`.
54
+
55
+ minLength 3, maxLength 128
56
+
57
+ **CalculateTaxEnvelope**
58
+ Properties:
59
+ - metadata: Context
60
+ - request: CalculateTaxRequest
61
+
62
+ **CalculateTaxRequest**
63
+ Properties:
64
+ - addresses: Address[] - Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`.
65
+
66
+ minSize 1, maxSize 3
67
+ - currency: string - 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
68
+
69
+ format CURRENCY
70
+ - lineItems: LineItem[] - Line items to calculate tax for.
71
+
72
+ minSize 1, maxSize 300
73
+
74
+ **CalculateTaxResponse**
75
+ Properties:
76
+ - currency: string - 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
77
+ If this code doesn't match the `currency` passed in the request, then the response is invalid.
78
+
79
+ format CURRENCY
80
+ - lineItemTaxDetails: LineItemTaxDetails[] - Details of each tax applied to each line item.
81
+
82
+ minSize 1, maxSize 300
83
+ - taxSummary: TaxSummary - Summary of the tax calculated.
84
+
85
+ **Context**
86
+ Properties:
87
+ - currency: string - [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.
88
+
89
+ format CURRENCY
90
+ - identity: IdentificationData - An object that describes the identity that triggered this request.
91
+ - instanceId: string - The service provider app's instance ID.
92
+
93
+ format GUID
94
+ - languages: string[] - A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`.
95
+ - requestId: string - A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs.
96
+
97
+ **IdentificationData**
98
+ Properties:
99
+ - identityType: IdentityType
100
+ One of (id):
101
+ - anonymousVisitorId: string - ID of a site visitor that has not logged in to the site.
102
+ - appId: string - ID of an app.
103
+ - memberId: string - ID of a site visitor that has logged in to the site.
104
+ - wixUserId: string - ID of a Wix user (site owner, contributor, etc.).
105
+
106
+ **IdentityType**
107
+ Enum values:
108
+ - ANONYMOUS_VISITOR
109
+ - APP
110
+ - MEMBER
111
+ - UNKNOWN
112
+ - WIX_USER
113
+
114
+ **JurisdictionType**
115
+ Enum values:
116
+ - CITY
117
+ - COUNTRY
118
+ - COUNTY
119
+ - SPECIAL
120
+ - STATE
121
+ - UNDEFINED
122
+
123
+ **LineItem**
124
+ Properties:
125
+ - _id: string - Line item ID.
126
+
127
+ minLength 1, maxLength 100
128
+ - addressIndex: AddressIndex - Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based.
129
+ - itemCode: string - Stock keeping unit for this line item. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).
130
+
131
+ maxLength 40
132
+ - itemName: string - Line item name to display.
133
+
134
+ maxLength 250
135
+ - price: string - Line item price.
136
+
137
+ format DECIMAL_VALUE, decimalValue { lte:1000000000000000 }
138
+ - quantity: number - Line item quantity.
139
+
140
+ min 1, max 100000
141
+ - taxGroupId: string - Tax group ID for this line item. If not provided, the default tax group applies.
142
+
143
+ format GUID
144
+ - taxIncludedInPrice: boolean - Whether tax is included in the price.
145
+ - taxRegionId: string - Tax region ID for this line item.
146
+
147
+ format GUID
148
+
149
+ **LineItemTaxDetails**
150
+ Properties:
151
+ - _id: string - Line item ID.
152
+
153
+ minLength 1, maxLength 100
154
+ - itemName: string - Line item name to display.
155
+
156
+ maxLength 250
157
+ - quantity: number - Line item quantity.
158
+
159
+ min 1, max 100000
160
+ - taxBreakdown: TaxBreakdown[] - Array of each tax applied, grouped by `jurisdiction`, `jurisdictionType`, `taxName`, `rate`, and `taxType`.
161
+
162
+ maxSize 7
163
+ - taxSummary: LineItemTaxSummary - Summary of this line item's total price and tax.
164
+
165
+ **LineItemTaxSummary**
166
+ Properties:
167
+ - fullPrice: string - Total price for this line item.
168
+ To determine the price for each individual unit of this line item, divide by `quantity`.
169
+
170
+ format DECIMAL_VALUE, decimalValue { lte:1000000000000000 }
171
+ - taxableAmount: string - Total taxable amount for this line item.
172
+
173
+ format DECIMAL_VALUE, decimalValue { maxScale:4 }
174
+ - taxAmount: string - The total amount of tax calculated for this line item.
175
+
176
+ format DECIMAL_VALUE, decimalValue { maxScale:4 }
177
+
178
+ **MultipleAddresses**
179
+ Properties:
180
+ - destination: number - Index of the destination address.
181
+ - origin: number - Index of the origin address.
182
+
183
+ **SpiBaseUri**
184
+ Properties:
185
+ - alternativeUris: AlternativeUri[] - Alternate, custom URIs to replace the default URIs for specific service plugin methods.
186
+ - baseUri: string - Base URI where the methods are called. Wix appends the path to the `baseUri`.
187
+ For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.
188
+
189
+ minLength 6, maxLength 2048
190
+
191
+ **TaxBreakdown**
192
+ Properties:
193
+ - jurisdiction: string - Jurisdiction that taxes were calculated for.
194
+
195
+ maxLength 200
196
+ - jurisdictionType: JurisdictionType - Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"County"`, `"City"`, `"Special"`, etc.
197
+ - nonTaxableAmount: string - Non-taxable amount of the price.
198
+
199
+ format DECIMAL_VALUE, decimalValue { maxScale:4, gte:0 }
200
+ - rate: string - Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`.
201
+
202
+ format DECIMAL_VALUE, decimalValue { maxScale:6, gte:0 }
203
+ - taxableAmount: string - Taxable amount of the price.
204
+
205
+ format DECIMAL_VALUE, decimalValue { maxScale:4, gte:0 }
206
+ - taxAmount: string - Amount of this tax calculated for this jurisdiction.
207
+
208
+ format DECIMAL_VALUE, decimalValue { maxScale:4 }
209
+ - taxName: string - Name of the tax that was calculated. For example, `"NY State Sales Tax"`, `"Quebec GST"`, etc.
210
+
211
+ maxLength 200
212
+ - taxType: string - Type of tax that was calculated. For example, `"Sales Tax"`, `"Income Tax"`, `"Value Added Tax"`, etc.
213
+
214
+ maxLength 200
215
+
216
+ **TaxCalculationConfig**
217
+ Properties:
218
+ - calculatorDisplayName: string - Display name of the tax calculator.
219
+
220
+ minLength 1, maxLength 200
221
+ - deploymentUri: SpiBaseUri - **Required.** Base URI where the endpoints are called. Wix appends the endpoint path to the base URI.
222
+
223
+ For example, to call the Calculate Tax endpoint at `https://my-tax-calc.com/v1/calculateTax`, the base URI you provide here is `"https://my-tax-calc.com/"`.
224
+ - unsupportedCountries: string[] - 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.
225
+
226
+ format COUNTRY, maxSize 195
227
+
228
+ **TaxSummary**
229
+ Properties:
230
+ - totalAmount: string - Total price for all line items.
231
+
232
+ format DECIMAL_VALUE, decimalValue { maxScale:4 }
233
+ - totalTax: string - Total amount of tax calculated for all line items.
234
+ Note that due to rounding, `totalTax` may not equal the sum of `lineItemTaxDetails.taxSummary.taxAmount`.
235
+
236
+ format DECIMAL_VALUE, decimalValue { maxScale:4 }
237
+ - totalTaxableAmount: string - Total taxable amount for all line items.
238
+
239
+ format DECIMAL_VALUE, decimalValue { maxScale:4 }
240
+ - totalTaxIncludedInPrice: string - Total amount of `totalTax` that is included in price. Applies to line items with `taxIncludedInPrice` set to `true`.
241
+
242
+ format DECIMAL_VALUE, decimalValue { maxScale:4 }
243
+ </types>
244
+ </tax_calculation_provider_service_plugin>