@wix/ditto-codegen-public 1.0.6 → 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,411 @@
1
+
2
+ <additional_fees_service_plugin>
3
+ <purpose>Base URI where the endpoints are called.
4
+ Wix eCommerce appends the endpoint path to the base URI.
5
+ For example, to call the Calculate Additional Fees endpoint at `https://my-additional-fees.com/v1/calculateAdditionalFees`,
6
+ the base URI you provide here is `https://my-additional-fees.com/`.</purpose>
7
+ <use_cases>
8
+ - Handle appliedDiscounts: Applied discounts.
9
+ - Handle businessLocationId: The business location ID associated with the items.
10
+ Learn more about the [Locations API](https://dev.wix.com/docs/rest/business-management/locations/introduction).
11
+ - Handle buyerDetails: Information about the buyer, such as contact details.
12
+ - Handle lineItems: Line items to calculate additional fees for.
13
+
14
+ Max: 300 items
15
+ - Handle purchaseFlowId: Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.
16
+ - Handle shippingAddress: Shipping address.
17
+ - Handle shippingInfo: Shipping information.
18
+ - Handle subtotal: Subtotal. Calculated as `lineItems[i].price` multiplied by `lineItems[i].quantity`, summed across all line items.
19
+ </use_cases>
20
+ <required_handlers>
21
+ - calculateAdditionalFees() - Handler to process: The business location ID associated with the items.
22
+ Learn more about the [Locations API](https://dev.wix.com/docs/rest/business-management/locations/introduction).
23
+ </required_handlers>
24
+ <import>import { additionalFees } from '@wix/ecom/service-plugins'</import>
25
+ <types>
26
+
27
+ **AdditionalFee**
28
+ Properties:
29
+ - code: string - Additional fee's unique code or ID.
30
+
31
+ minLength 1, maxLength 100
32
+ - lineItemIds: string[] - Optional - Line items associated with this additional fee.
33
+ If no `lineItemIds` are provided, the fee will be associated with the whole cart/checkout/order.
34
+
35
+ format GUID
36
+ - name: string - Additional fee's name.
37
+
38
+ Max: 50 characters
39
+
40
+ minLength 1, maxLength 50
41
+ - price: string - Total additional fees. This `price` does not include any taxes that may apply to these additional fees. Must be stringified integer.
42
+
43
+ decimalValue { gte:0, lte:1000000000000000 }
44
+ - taxDetails: TaxDetails - Tax details.
45
+
46
+ > **Note:** Tax is not calculated in the returned `price` even when `taxDetails.taxable` is `true`.
47
+ - translatedName: string - The translated name of the additional fee. The translation language is determined by the `languages` field in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
48
+
49
+ minLength 1, maxLength 50
50
+
51
+ **AdditionalFeesSPIConfig**
52
+ Properties:
53
+ - deploymentUri: string - Base URI where the endpoints are called.
54
+ Wix eCommerce appends the endpoint path to the base URI.
55
+ For example, to call the Calculate Additional Fees endpoint at `https://my-additional-fees.com/v1/calculateAdditionalFees`,
56
+ the base URI you provide here is `https://my-additional-fees.com/`.
57
+
58
+ **Address**
59
+ Properties:
60
+ - addressLine1: string - Main address line (usually street name and number).
61
+
62
+ maxLength 150
63
+ - addressLine2: string - Free text providing more detailed address info. Usually contains apt, suite, floor.
64
+
65
+ maxLength 100
66
+ - city: string - City name.
67
+
68
+ maxLength 50
69
+ - country: string - Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.
70
+
71
+ format COUNTRY
72
+ - countryFullname: string - Country's full name.
73
+ - postalCode: string - Postal or zip code.
74
+
75
+ maxLength 50
76
+ - streetAddress: StreetAddress - Street address.
77
+ - subdivision: string - Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format.
78
+
79
+ maxLength 50
80
+ - subdivisionFullname: string - Subdivision full-name.
81
+
82
+ **AppliedDiscount**
83
+ Properties:
84
+ - discountType: DiscountType - Discount type.
85
+ - lineItemIds: string[] - IDs of line items the discount applies to.
86
+
87
+ format GUID
88
+ One of (discountSource):
89
+ - coupon: Coupon - Coupon details.
90
+ - discountRule: DiscountRule - Discount rule
91
+ - merchantDiscount: MerchantDiscount - Merchant discount.
92
+
93
+ **BuyerDetails**
94
+ Properties:
95
+ - contactDetails: FullAddressContactDetails - Contact details.
96
+
97
+ **CalculateAdditionalFeesEnvelope**
98
+ Properties:
99
+ - metadata: Context
100
+ - request: CalculateAdditionalFeesRequest
101
+
102
+ **CalculateAdditionalFeesRequest**
103
+ Properties:
104
+ - appliedDiscounts: AppliedDiscount[] - Applied discounts.
105
+
106
+ maxSize 320
107
+ - businessLocationId: string - The business location ID associated with the items.
108
+ Learn more about the [Locations API](https://dev.wix.com/docs/rest/business-management/locations/introduction).
109
+
110
+ format GUID
111
+ - buyerDetails: BuyerDetails - Information about the buyer, such as contact details.
112
+ - lineItems: LineItem[] - Line items to calculate additional fees for.
113
+
114
+ Max: 300 items
115
+
116
+ maxSize 300
117
+ - purchaseFlowId: string - Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.
118
+
119
+ format GUID
120
+ - shippingAddress: Address - Shipping address.
121
+ - shippingInfo: ShippingInformation - Shipping information.
122
+ - subtotal: string - Subtotal. Calculated as `lineItems[i].price` multiplied by `lineItems[i].quantity`, summed across all line items.
123
+
124
+ decimalValue { gte:0, lte:1000000000000000, maxScale:3 }
125
+
126
+ **CalculateAdditionalFeesResponse**
127
+ Properties:
128
+ - additionalFees: AdditionalFee[] - Additional fees calculated.
129
+
130
+ maxSize 100
131
+ - currency: string - Currency of additional fees calculated. In three-letter currency code
132
+ [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
133
+
134
+ The currency returned in the response object must match the wix site's currency or those fees will
135
+ be filtered out and not returned. Extract the `currency` from the
136
+ [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions-with-rest#request-envelope)
137
+ to ensure the correct currency is used in your calculation.
138
+
139
+ maxLength 3
140
+
141
+ **CatalogReference**
142
+ Properties:
143
+ - appId: string - ID of the app providing the catalog.
144
+
145
+ You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
146
+
147
+ For items from Wix catalogs, the following values always apply:
148
+ + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
149
+ + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
150
+ + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
151
+
152
+ minLength 1
153
+ - catalogItemId: string - ID of the item within the catalog it belongs to.
154
+
155
+ minLength 1, maxLength 36
156
+ - options: Record<string, any> - Additional item details in key:value pairs. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.
157
+
158
+ For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).
159
+
160
+ **ChargeType**
161
+ Enum values:
162
+ - HANDLING_FEE
163
+ - INSURANCE
164
+
165
+ **Context**
166
+ Properties:
167
+ - currency: string - [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.
168
+
169
+ format CURRENCY
170
+ - identity: IdentificationData - An object that describes the identity that triggered this request.
171
+ - instanceId: string - The service provider app's instance ID.
172
+
173
+ format GUID
174
+ - 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"`.
175
+ - 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.
176
+
177
+ **Coupon**
178
+ Properties:
179
+ - _id: string - Coupon ID.
180
+ - amount: string
181
+
182
+ decimalValue { gte:0, lte:1000000000000000 }
183
+ - code: string - Coupon code.
184
+ - name: string - Coupon name.
185
+
186
+ **DeliveryLogistics**
187
+ Properties:
188
+ - deliveryTime: string - Expected delivery time. For example, "3-5 business days".
189
+
190
+ maxLength 500
191
+ - instructions: string - Instructions for deliver. For example, "Please deliver during open hours and please don't park in disabled parking spot".
192
+
193
+ maxLength 1000
194
+ - pickupDetails: PickupDetails - Pickup details.
195
+
196
+ **DiscountRule**
197
+ Properties:
198
+ - _id: string - Discount rule ID
199
+
200
+ format GUID
201
+ - amount: string
202
+
203
+ decimalValue { gte:0, lte:1000000000000000 }
204
+ - name: DiscountRuleName - Discount rule name
205
+
206
+ **DiscountRuleName**
207
+ Properties:
208
+ - original: string - Original discount rule name (in site's default language).
209
+
210
+ minLength 1, maxLength 256
211
+ - translated: string - Translated discount rule name according to buyer language. Defaults to `original` when not provided.
212
+
213
+ minLength 1, maxLength 500
214
+
215
+ **DiscountType**
216
+ Enum values:
217
+ - GLOBAL: Global discount.
218
+ - SHIPPING: Discount on shipping.
219
+ - SPECIFIC_ITEMS: Discount on specific items.
220
+
221
+ **FullAddressContactDetails**
222
+ Properties:
223
+ - company: string - Contact's company name.
224
+ - email: string - Email associated with the address.
225
+
226
+ format EMAIL
227
+ - firstName: string - Contact's first name.
228
+ - lastName: string - Contact's last name.
229
+ - phone: string - Contact's phone number.
230
+
231
+ format PHONE
232
+ - vatId: VatId - Tax info. Currently usable only in Brazil.
233
+
234
+ **IdentificationData**
235
+ Properties:
236
+ - identityType: IdentityType
237
+ One of (id):
238
+ - anonymousVisitorId: string - ID of a site visitor that has not logged in to the site.
239
+ - appId: string - ID of an app.
240
+ - memberId: string - ID of a site visitor that has logged in to the site.
241
+ - wixUserId: string - ID of a Wix user (site owner, contributor, etc.).
242
+
243
+ **IdentityType**
244
+ Enum values:
245
+ - ANONYMOUS_VISITOR
246
+ - APP
247
+ - MEMBER
248
+ - UNKNOWN
249
+ - WIX_USER
250
+
251
+ **ItemModifier**
252
+ Properties:
253
+ - _id: string - Modifier ID.
254
+
255
+ minLength 1, maxLength 36
256
+ - details: TranslatableString - Additional details.
257
+ - label: TranslatableString - Primary display label for the modifier.
258
+ - price: string - The price of the modifier.
259
+
260
+ decimalValue { gte:0, lte:1000000000000000, maxScale:3 }
261
+ - quantity: number - The quantity of this modifier.
262
+
263
+ min 1, max 100000
264
+
265
+ **LineItem**
266
+ Properties:
267
+ - _id: string - Line item ID.
268
+
269
+ minLength 1, maxLength 100
270
+ - catalogReference: CatalogReference - Catalog and item reference. Includes IDs for the item and the catalog it came from, as well as further optional info. Optional for custom line items, which don't trigger the Catalog service plugin.
271
+ - depositAmount: string - Partial payment to be paid upfront during the checkout.
272
+ Only eligible for catalog items with `lineItem.paymentOption` type of `DEPOSIT_ONLINE`.
273
+
274
+ format DECIMAL_VALUE
275
+ - modifierGroups: ModifierGroup[] - Modifier groups that were added to the item.
276
+
277
+ maxSize 25
278
+ - physicalProperties: PhysicalProperties - Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability.
279
+ - price: string - Price for a single item, after discounts and modifiers.
280
+
281
+ decimalValue { gte:0 }
282
+ - productName: string - Item name.
283
+
284
+ maxLength 100
285
+ - quantity: number - Quantity of item.
286
+
287
+ Min: `1`
288
+ Max: `100000`
289
+
290
+ max 100000
291
+
292
+ **MerchantDiscount**
293
+ Properties:
294
+ - amount: string
295
+
296
+ decimalValue { gte:0, lte:1000000000000000 }
297
+
298
+ **ModifierGroup**
299
+ Properties:
300
+ - _id: string - Modifier group ID.
301
+
302
+ minLength 1, maxLength 36
303
+ - modifiers: ItemModifier[] - List of modifiers in this group.
304
+
305
+ minSize 1, maxSize 25
306
+ - name: TranslatableString - Modifier group name.
307
+
308
+ **PhysicalProperties**
309
+ Properties:
310
+ - shippable: boolean - Whether this line item is shippable.
311
+ - sku: string - Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).
312
+
313
+ maxLength 40
314
+ - weight: number - Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request.
315
+
316
+ **PickupDetails**
317
+ Properties:
318
+ - address: Address - Pickup address.
319
+ - businessLocation: boolean (deprecated) - Whether the pickup address is a business. This may affect tax calculation.
320
+ - pickupMethod: PickupMethod - Pickup method.
321
+
322
+ **PickupMethod**
323
+ Enum values:
324
+ - PICKUP_POINT
325
+ - STORE_PICKUP
326
+ - UNKNOWN_METHOD
327
+
328
+ **SelectedCarrierServiceOption**
329
+ Properties:
330
+ - code: string - Unique identifier of selected option. For example, `"usps_std_overnight"`.
331
+
332
+ maxLength 100
333
+ - cost: SelectedCarrierServiceOptionPrices - Shipping costs.
334
+ - logistics: DeliveryLogistics - Delivery logistics.
335
+ - otherCharges: SelectedCarrierServiceOptionOtherCharge[] - Other charges.
336
+
337
+ maxSize 100
338
+ - title: string - Title of the option, such as USPS Standard Overnight Delivery (in the requested locale).
339
+ For example, "Standard" or "First-Class Package International".
340
+
341
+ maxLength 250
342
+
343
+ **SelectedCarrierServiceOptionOtherCharge**
344
+ Properties:
345
+ - cost: SelectedCarrierServiceOptionPrices - Cost.
346
+
347
+ `cost` is `price` minus `totalDiscount`.
348
+ - details: string - Details of the charge.
349
+
350
+ Max: 200 characters
351
+
352
+ maxLength 200
353
+ - type: ChargeType - Type of charge.
354
+
355
+ **SelectedCarrierServiceOptionPrices**
356
+ Properties:
357
+ - price: string - Price.
358
+
359
+ decimalValue { gte:0, lte:1000000000000000 }
360
+ - totalDiscount: string - Total shipping discount.
361
+
362
+ decimalValue { gte:0, lte:1000000000000000 }
363
+
364
+ **ShippingInformation**
365
+ Properties:
366
+ - selectedCarrierServiceOption: SelectedCarrierServiceOption - Selected carrier shipping option.
367
+
368
+ **StreetAddress**
369
+ Properties:
370
+ - name: string - Street name.
371
+ - number: string - Street number.
372
+
373
+ **TaxDetails**
374
+ Properties:
375
+ - taxable: boolean - Whether additional fee is taxable.
376
+ - taxGroupId: string - Reserved for internal use.
377
+
378
+ format GUID
379
+
380
+ **TranslatableString**
381
+ Properties:
382
+ - original: string - __Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).
383
+
384
+ Min: 1 character.
385
+ Max: 200 characters.
386
+
387
+ minLength 1, maxLength 200
388
+ - translated: string - String translated into the buyer's language.
389
+
390
+ Min: 1 character.
391
+ Max: 400 characters.
392
+ Default: Same as `original`.
393
+
394
+ minLength 1, maxLength 400
395
+
396
+ **VatId**
397
+ Properties:
398
+ - _id: string - Customer's tax ID.
399
+ - type: VatType - Tax type.
400
+
401
+ Supported values:
402
+ + `CPF`: for individual tax payers
403
+ + `CNPJ`: for corporations
404
+
405
+ **VatType**
406
+ Enum values:
407
+ - CNPJ: CNPJ - for corporations
408
+ - CPF: CPF - for individual tax payers.
409
+ - UNSPECIFIED
410
+ </types>
411
+ </additional_fees_service_plugin>