@wix/auto_sdk_ecom_validations 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +2 -0
- package/build/cjs/index.js +19 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +15 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.context.d.ts +5 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.context.js +9 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.context.js.map +1 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.public.d.ts +19 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.public.js +50 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.public.js.map +1 -0
- package/build/cjs/src/service-plugins-types.d.ts +694 -0
- package/build/cjs/src/service-plugins-types.js +121 -0
- package/build/cjs/src/service-plugins-types.js.map +1 -0
- package/build/es/index.d.ts +2 -0
- package/build/es/index.js +3 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +15 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.context.d.ts +5 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.context.js +6 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.context.js.map +1 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.public.d.ts +19 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.public.js +47 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.public.js.map +1 -0
- package/build/es/src/service-plugins-types.d.ts +694 -0
- package/build/es/src/service-plugins-types.js +118 -0
- package/build/es/src/service-plugins-types.js.map +1 -0
- package/build/internal/cjs/index.d.ts +2 -0
- package/build/internal/cjs/index.js +19 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +15 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.context.d.ts +5 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.context.js +9 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.context.js.map +1 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.public.d.ts +19 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.public.js +50 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.public.js.map +1 -0
- package/build/internal/cjs/src/service-plugins-types.d.ts +694 -0
- package/build/internal/cjs/src/service-plugins-types.js +121 -0
- package/build/internal/cjs/src/service-plugins-types.js.map +1 -0
- package/build/internal/es/index.d.ts +2 -0
- package/build/internal/es/index.js +3 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +15 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.context.d.ts +5 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.context.js +6 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.context.js.map +1 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.public.d.ts +19 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.public.js +47 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.public.js.map +1 -0
- package/build/internal/es/src/service-plugins-types.d.ts +694 -0
- package/build/internal/es/src/service-plugins-types.js +118 -0
- package/build/internal/es/src/service-plugins-types.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
export interface GetValidationViolationsRequest {
|
|
2
|
+
/** Information about the source of the request. */
|
|
3
|
+
sourceInfo?: SourceInfo;
|
|
4
|
+
/** Information to validate. */
|
|
5
|
+
validationInfo?: ValidationInfo;
|
|
6
|
+
}
|
|
7
|
+
export interface SourceInfo {
|
|
8
|
+
/** Source of the request. */
|
|
9
|
+
source?: Source;
|
|
10
|
+
/** Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order. */
|
|
11
|
+
purchaseFlowId?: string | null;
|
|
12
|
+
/** The stage at which the service plugin is called. */
|
|
13
|
+
stage?: Stage;
|
|
14
|
+
}
|
|
15
|
+
export declare enum Source {
|
|
16
|
+
/** Context cannot be recognized */
|
|
17
|
+
OTHER = "OTHER",
|
|
18
|
+
/** Called from Ecom's Cart service */
|
|
19
|
+
CART = "CART",
|
|
20
|
+
/** Called from Ecom's Checkout service */
|
|
21
|
+
CHECKOUT = "CHECKOUT"
|
|
22
|
+
}
|
|
23
|
+
export interface Stage extends StageStagesOneOf {
|
|
24
|
+
/** Supported values: */
|
|
25
|
+
checkoutStage?: CheckoutStage;
|
|
26
|
+
}
|
|
27
|
+
/** @oneof */
|
|
28
|
+
export interface StageStagesOneOf {
|
|
29
|
+
/** Supported values: */
|
|
30
|
+
checkoutStage?: CheckoutStage;
|
|
31
|
+
}
|
|
32
|
+
export declare enum CheckoutStage {
|
|
33
|
+
/** Not implemented. */
|
|
34
|
+
UNKNOWN_CHECKOUT_STAGE = "UNKNOWN_CHECKOUT_STAGE",
|
|
35
|
+
/** Used during the initialization of the checkout (Create Checkout). */
|
|
36
|
+
INITIALIZATION = "INITIALIZATION",
|
|
37
|
+
/** Used during the checkout process, such as updating or retrieving the checkout. */
|
|
38
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
39
|
+
/** Used during the creation of an order from the checkout. */
|
|
40
|
+
ORDER_CREATION = "ORDER_CREATION"
|
|
41
|
+
}
|
|
42
|
+
/** ValidationsData is the main entity of ValidationsSPI, which contains all the data required for validations */
|
|
43
|
+
export interface ValidationInfo {
|
|
44
|
+
/** Buyer details. */
|
|
45
|
+
buyerDetails?: BuyerDetails;
|
|
46
|
+
/** Line items. Max: 300 line items */
|
|
47
|
+
lineItems?: LineItem[];
|
|
48
|
+
/**
|
|
49
|
+
* Applied gift card details.
|
|
50
|
+
*
|
|
51
|
+
* >**Note:** Gift cards are supported through the Wix UI, though the service plugin is not currently available. Learn more about [Wix Gift Cards](https://support.wix.com/en/article/wix-stores-setting-up-wix-gift-cards).
|
|
52
|
+
*/
|
|
53
|
+
giftCard?: GiftCard;
|
|
54
|
+
/**
|
|
55
|
+
* Weight measurement unit.
|
|
56
|
+
* Default: Site's weight unit
|
|
57
|
+
*/
|
|
58
|
+
weightUnit?: WeightUnit;
|
|
59
|
+
/** Price summary. */
|
|
60
|
+
priceSummary?: PriceSummary;
|
|
61
|
+
/** Billing information. */
|
|
62
|
+
billingInfo?: AddressWithContact;
|
|
63
|
+
/** Shipping address and contact details. */
|
|
64
|
+
shippingAddress?: AddressWithContact;
|
|
65
|
+
/** Shipping information. */
|
|
66
|
+
shippingInfo?: ShippingInfo;
|
|
67
|
+
/** Custom fields. */
|
|
68
|
+
customFields?: CustomFields;
|
|
69
|
+
/** Applied discounts. */
|
|
70
|
+
appliedDiscounts?: AppliedDiscount[];
|
|
71
|
+
}
|
|
72
|
+
export interface BuyerDetails {
|
|
73
|
+
/** Buyer's email address. */
|
|
74
|
+
email?: string | null;
|
|
75
|
+
/** Contact ID if one exists. */
|
|
76
|
+
contactId?: string | null;
|
|
77
|
+
}
|
|
78
|
+
export interface LineItem {
|
|
79
|
+
/** Line item ID. */
|
|
80
|
+
_id?: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* Item quantity.
|
|
83
|
+
* Min: `0`
|
|
84
|
+
* Max: `100000`
|
|
85
|
+
*/
|
|
86
|
+
quantity?: number;
|
|
87
|
+
/** Catalog and item reference. Includes IDs for the item and the catalog it came from, as well as further optional info. */
|
|
88
|
+
catalogReference?: CatalogReference;
|
|
89
|
+
/**
|
|
90
|
+
* Product name. For example,
|
|
91
|
+
* + Stores: `product.name`
|
|
92
|
+
* + Bookings: `service.info.name`
|
|
93
|
+
* + Events: `ticket.name`
|
|
94
|
+
*/
|
|
95
|
+
productName?: ProductName;
|
|
96
|
+
/** Price of the item **after** catalog-defined discount and line item discounts. */
|
|
97
|
+
price?: MultiCurrencyPrice;
|
|
98
|
+
/** Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability. */
|
|
99
|
+
physicalProperties?: PhysicalProperties;
|
|
100
|
+
/** Item type. */
|
|
101
|
+
itemType?: ItemType;
|
|
102
|
+
/** [Subscription option](https://dev.wix.com/api/rest/wix-stores/subscription-options/introduction) information. A subscription is a product that is sold on a recurring basis. */
|
|
103
|
+
subscriptionOptionInfo?: SubscriptionOptionInfo;
|
|
104
|
+
/** Price breakdown for this line item. */
|
|
105
|
+
pricesBreakdown?: LineItemPricesData;
|
|
106
|
+
}
|
|
107
|
+
/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
|
|
108
|
+
export interface CatalogReference {
|
|
109
|
+
/** ID of the item within the catalog it belongs to. */
|
|
110
|
+
catalogItemId?: string;
|
|
111
|
+
/**
|
|
112
|
+
* ID of the app providing the catalog.
|
|
113
|
+
*
|
|
114
|
+
* You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
|
|
115
|
+
*
|
|
116
|
+
* For items from Wix catalogs, the following values always apply:
|
|
117
|
+
* + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
|
|
118
|
+
* + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
|
|
119
|
+
* + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
|
|
120
|
+
*/
|
|
121
|
+
appId?: string;
|
|
122
|
+
/**
|
|
123
|
+
* 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.
|
|
124
|
+
*
|
|
125
|
+
* For products and variants from a Wix Stores catalog, learn more about [eCommerce integration](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration).
|
|
126
|
+
*/
|
|
127
|
+
options?: Record<string, any> | null;
|
|
128
|
+
}
|
|
129
|
+
export interface ProductName {
|
|
130
|
+
/**
|
|
131
|
+
* __Required.__ Item name 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).
|
|
132
|
+
*
|
|
133
|
+
* Min: 1 character.
|
|
134
|
+
* Max: 200 characters.
|
|
135
|
+
*/
|
|
136
|
+
original?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Item name translated into the buyer's language.
|
|
139
|
+
*
|
|
140
|
+
* Min: 1 character.
|
|
141
|
+
* Max: 400 characters.
|
|
142
|
+
* Default: Same as `original`.
|
|
143
|
+
*/
|
|
144
|
+
translated?: string | null;
|
|
145
|
+
}
|
|
146
|
+
export interface MultiCurrencyPrice {
|
|
147
|
+
/** Amount. */
|
|
148
|
+
amount?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Converted amount.
|
|
151
|
+
* @readonly
|
|
152
|
+
*/
|
|
153
|
+
convertedAmount?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Amount formatted with currency symbol.
|
|
156
|
+
* @readonly
|
|
157
|
+
*/
|
|
158
|
+
formattedAmount?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Converted amount formatted with currency symbol.
|
|
161
|
+
* @readonly
|
|
162
|
+
*/
|
|
163
|
+
formattedConvertedAmount?: string;
|
|
164
|
+
}
|
|
165
|
+
export interface PhysicalProperties {
|
|
166
|
+
/** Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request. */
|
|
167
|
+
weight?: number | null;
|
|
168
|
+
/** Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku). */
|
|
169
|
+
sku?: string | null;
|
|
170
|
+
/** Whether this line item is shippable. */
|
|
171
|
+
shippable?: boolean;
|
|
172
|
+
}
|
|
173
|
+
export interface ItemType extends ItemTypeItemTypeDataOneOf {
|
|
174
|
+
/** Preset item type. */
|
|
175
|
+
preset?: ItemTypeItemType;
|
|
176
|
+
/** Custom item type. When none of the preset types are suitable, specifies the custom type. */
|
|
177
|
+
custom?: string;
|
|
178
|
+
}
|
|
179
|
+
/** @oneof */
|
|
180
|
+
export interface ItemTypeItemTypeDataOneOf {
|
|
181
|
+
/** Preset item type. */
|
|
182
|
+
preset?: ItemTypeItemType;
|
|
183
|
+
/** Custom item type. When none of the preset types are suitable, specifies the custom type. */
|
|
184
|
+
custom?: string;
|
|
185
|
+
}
|
|
186
|
+
export declare enum ItemTypeItemType {
|
|
187
|
+
UNRECOGNISED = "UNRECOGNISED",
|
|
188
|
+
PHYSICAL = "PHYSICAL",
|
|
189
|
+
DIGITAL = "DIGITAL",
|
|
190
|
+
GIFT_CARD = "GIFT_CARD",
|
|
191
|
+
SERVICE = "SERVICE"
|
|
192
|
+
}
|
|
193
|
+
export interface SubscriptionOptionInfo {
|
|
194
|
+
/** Subscription option settings. */
|
|
195
|
+
subscriptionSettings?: SubscriptionSettings;
|
|
196
|
+
/** Subscription option title. */
|
|
197
|
+
title?: Title;
|
|
198
|
+
/** Subscription option description. */
|
|
199
|
+
description?: Description;
|
|
200
|
+
}
|
|
201
|
+
export interface SubscriptionSettings {
|
|
202
|
+
/** Frequency of recurring payment. */
|
|
203
|
+
frequency?: SubscriptionFrequency;
|
|
204
|
+
/**
|
|
205
|
+
* Interval of recurring payment.
|
|
206
|
+
*
|
|
207
|
+
* Default: `1`.
|
|
208
|
+
* If SubscriptionFrequency is Day the minimum interval is 7
|
|
209
|
+
*/
|
|
210
|
+
interval?: number | null;
|
|
211
|
+
/** Whether subscription is renewed automatically at the end of each period. */
|
|
212
|
+
autoRenewal?: boolean;
|
|
213
|
+
/** Number of billing cycles before subscription ends. Ignored if `autoRenewal` is `true`. */
|
|
214
|
+
billingCycles?: number | null;
|
|
215
|
+
}
|
|
216
|
+
/** Frequency unit of recurring payment */
|
|
217
|
+
export declare enum SubscriptionFrequency {
|
|
218
|
+
UNDEFINED = "UNDEFINED",
|
|
219
|
+
DAY = "DAY",
|
|
220
|
+
WEEK = "WEEK",
|
|
221
|
+
MONTH = "MONTH",
|
|
222
|
+
YEAR = "YEAR"
|
|
223
|
+
}
|
|
224
|
+
export interface FreeTrialPeriod {
|
|
225
|
+
/** Frequency of priod. Values: DAY, WEEK, MONTH, YEAR */
|
|
226
|
+
frequency?: SubscriptionFrequency;
|
|
227
|
+
/** interval of period */
|
|
228
|
+
interval?: number;
|
|
229
|
+
}
|
|
230
|
+
export interface Title {
|
|
231
|
+
/** Subscription option name 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). */
|
|
232
|
+
original?: string;
|
|
233
|
+
/**
|
|
234
|
+
* Subscription option name translated into the buyer's language.
|
|
235
|
+
*
|
|
236
|
+
* Default: Same as `original`.
|
|
237
|
+
*/
|
|
238
|
+
translated?: string | null;
|
|
239
|
+
}
|
|
240
|
+
export interface Description {
|
|
241
|
+
/** Subscription option description. */
|
|
242
|
+
original?: string;
|
|
243
|
+
/** Translated subscription option description. */
|
|
244
|
+
translated?: string | null;
|
|
245
|
+
}
|
|
246
|
+
export interface LineItemPricesData {
|
|
247
|
+
/** Total price after discounts and after tax. */
|
|
248
|
+
totalPriceAfterTax?: MultiCurrencyPrice;
|
|
249
|
+
/** Total price after discounts, and before tax. */
|
|
250
|
+
totalPriceBeforeTax?: MultiCurrencyPrice;
|
|
251
|
+
/** Tax details. */
|
|
252
|
+
taxDetails?: ItemTaxFullDetails;
|
|
253
|
+
/** Total discount for all line items. */
|
|
254
|
+
totalDiscount?: MultiCurrencyPrice;
|
|
255
|
+
/** Catalog price after catalog discount and automatic discounts. */
|
|
256
|
+
price?: MultiCurrencyPrice;
|
|
257
|
+
/** Item price **before** line item discounts and **after** catalog-defined discount. Defaults to `price` when not provided. */
|
|
258
|
+
priceBeforeDiscounts?: MultiCurrencyPrice;
|
|
259
|
+
/** Total price **after** catalog-defined discount and line item discounts. */
|
|
260
|
+
lineItemPrice?: MultiCurrencyPrice;
|
|
261
|
+
/** Item price **before** line item discounts and **before** catalog-defined discount. Defaults to `price` when not provided. */
|
|
262
|
+
fullPrice?: MultiCurrencyPrice;
|
|
263
|
+
}
|
|
264
|
+
export interface ItemTaxFullDetails {
|
|
265
|
+
/** The portion of the total amount of this estimate that was taxable. */
|
|
266
|
+
taxableAmount?: MultiCurrencyPrice;
|
|
267
|
+
/** Calculated tax, based on `taxable_amount`. */
|
|
268
|
+
totalTax?: MultiCurrencyPrice;
|
|
269
|
+
/** Indicates whether the price already includes tax. */
|
|
270
|
+
isTaxIncluded?: boolean | null;
|
|
271
|
+
/** A detailed description of all the tax authorities applied on this item. */
|
|
272
|
+
taxBreakdown?: TaxBreakdown[];
|
|
273
|
+
}
|
|
274
|
+
export interface TaxBreakdown {
|
|
275
|
+
/** The name of the jurisdiction to which this tax detail applies. For example, "New York" or "Quebec". */
|
|
276
|
+
jurisdiction?: string | null;
|
|
277
|
+
/** The amount of this line item price that was considered nontaxable. (Decimal value) */
|
|
278
|
+
nonTaxableAmount?: MultiCurrencyPrice;
|
|
279
|
+
/** The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.0000 signifies 200% tax. (Decimal value) */
|
|
280
|
+
rate?: string | null;
|
|
281
|
+
/** The amount of tax estimated for this line item. (Decimal value) */
|
|
282
|
+
taxAmount?: MultiCurrencyPrice;
|
|
283
|
+
/** The taxable amount of this line item. */
|
|
284
|
+
taxableAmount?: MultiCurrencyPrice;
|
|
285
|
+
/** The type of tax that was calculated. Depends on the jurisdiction's tax laws. For example, "Sales Tax", "Income Tax", "Value Added Tax", etc. */
|
|
286
|
+
taxType?: string | null;
|
|
287
|
+
/**
|
|
288
|
+
* The name of the tax against which this tax amount was calculated. For example, "NY State Sales Tax", "Quebec GST", etc.
|
|
289
|
+
* This name should be explicit enough to allow the merchant to understand what tax was calculated.
|
|
290
|
+
*/
|
|
291
|
+
taxName?: string | null;
|
|
292
|
+
/** The type of the jurisdiction in which this tax detail applies. */
|
|
293
|
+
jurisdictionType?: JurisdictionType;
|
|
294
|
+
}
|
|
295
|
+
/** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
|
|
296
|
+
export declare enum JurisdictionType {
|
|
297
|
+
/** Undefined jurisdiction type. */
|
|
298
|
+
UNDEFINED = "UNDEFINED",
|
|
299
|
+
/** Country jurisdiction. */
|
|
300
|
+
COUNTRY = "COUNTRY",
|
|
301
|
+
/** State jurisdiction. */
|
|
302
|
+
STATE = "STATE",
|
|
303
|
+
/** County jurisdiction. */
|
|
304
|
+
COUNTY = "COUNTY",
|
|
305
|
+
/** City jurisdiction. */
|
|
306
|
+
CITY = "CITY",
|
|
307
|
+
/** Special jurisdiction. */
|
|
308
|
+
SPECIAL = "SPECIAL"
|
|
309
|
+
}
|
|
310
|
+
export interface GiftCard {
|
|
311
|
+
/**
|
|
312
|
+
* Gift card ID.
|
|
313
|
+
* @deprecated
|
|
314
|
+
*/
|
|
315
|
+
_id?: string;
|
|
316
|
+
/** Gift card obfuscated code. */
|
|
317
|
+
obfuscatedCode?: string;
|
|
318
|
+
/** Gift card value. */
|
|
319
|
+
amount?: MultiCurrencyPrice;
|
|
320
|
+
/** App ID of the gift card provider. */
|
|
321
|
+
appId?: string;
|
|
322
|
+
}
|
|
323
|
+
export declare enum WeightUnit {
|
|
324
|
+
/** Weight unit can't be classified, due to an error */
|
|
325
|
+
UNSPECIFIED_WEIGHT_UNIT = "UNSPECIFIED_WEIGHT_UNIT",
|
|
326
|
+
/** Kilograms */
|
|
327
|
+
KG = "KG",
|
|
328
|
+
/** Pounds */
|
|
329
|
+
LB = "LB"
|
|
330
|
+
}
|
|
331
|
+
export interface PriceSummary {
|
|
332
|
+
/** Subtotal of all line items, before discounts and before tax. */
|
|
333
|
+
subtotal?: MultiCurrencyPrice;
|
|
334
|
+
/** Total shipping price, before discounts and before tax. */
|
|
335
|
+
shipping?: MultiCurrencyPrice;
|
|
336
|
+
/** Total tax. */
|
|
337
|
+
tax?: MultiCurrencyPrice;
|
|
338
|
+
/** Total calculated discount value. */
|
|
339
|
+
discount?: MultiCurrencyPrice;
|
|
340
|
+
/** Total price **after** discounts, gift cards, and tax. */
|
|
341
|
+
total?: MultiCurrencyPrice;
|
|
342
|
+
/** Total additional fees price **before** tax. */
|
|
343
|
+
additionalFees?: MultiCurrencyPrice;
|
|
344
|
+
}
|
|
345
|
+
/** Billing Info and shipping details */
|
|
346
|
+
export interface AddressWithContact {
|
|
347
|
+
/** Address. */
|
|
348
|
+
address?: Address;
|
|
349
|
+
/** Contact details. */
|
|
350
|
+
contactDetails?: FullAddressContactDetails;
|
|
351
|
+
}
|
|
352
|
+
/** Physical address */
|
|
353
|
+
export interface Address {
|
|
354
|
+
/** Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format. */
|
|
355
|
+
country?: string | null;
|
|
356
|
+
/** Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format. */
|
|
357
|
+
subdivision?: string | null;
|
|
358
|
+
/** City name. */
|
|
359
|
+
city?: string | null;
|
|
360
|
+
/** Postal or zip code. */
|
|
361
|
+
postalCode?: string | null;
|
|
362
|
+
/** Street address. */
|
|
363
|
+
streetAddress?: StreetAddress;
|
|
364
|
+
/** Main address line (usually street name and number). */
|
|
365
|
+
addressLine1?: string | null;
|
|
366
|
+
/** Free text providing more detailed address info. Usually contains apt, suite, floor. */
|
|
367
|
+
addressLine2?: string | null;
|
|
368
|
+
/**
|
|
369
|
+
* Country's full name.
|
|
370
|
+
* @readonly
|
|
371
|
+
*/
|
|
372
|
+
countryFullname?: string | null;
|
|
373
|
+
/**
|
|
374
|
+
* Subdivision full-name.
|
|
375
|
+
* @readonly
|
|
376
|
+
*/
|
|
377
|
+
subdivisionFullname?: string | null;
|
|
378
|
+
}
|
|
379
|
+
export interface StreetAddress {
|
|
380
|
+
/** Street number. */
|
|
381
|
+
number?: string;
|
|
382
|
+
/** Street name. */
|
|
383
|
+
name?: string;
|
|
384
|
+
}
|
|
385
|
+
export interface AddressLocation {
|
|
386
|
+
/** Address latitude. */
|
|
387
|
+
latitude?: number | null;
|
|
388
|
+
/** Address longitude. */
|
|
389
|
+
longitude?: number | null;
|
|
390
|
+
}
|
|
391
|
+
/** Full contact details for an address */
|
|
392
|
+
export interface FullAddressContactDetails {
|
|
393
|
+
/** First name. */
|
|
394
|
+
firstName?: string | null;
|
|
395
|
+
/** Last name. */
|
|
396
|
+
lastName?: string | null;
|
|
397
|
+
/** Phone number. */
|
|
398
|
+
phone?: string | null;
|
|
399
|
+
/** Company name. */
|
|
400
|
+
company?: string | null;
|
|
401
|
+
/** Tax information (for Brazil only). If ID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed. */
|
|
402
|
+
vatId?: VatId;
|
|
403
|
+
}
|
|
404
|
+
export interface VatId {
|
|
405
|
+
/** Customer's tax ID. */
|
|
406
|
+
_id?: string;
|
|
407
|
+
/**
|
|
408
|
+
* Tax type.
|
|
409
|
+
*
|
|
410
|
+
* Supported values:
|
|
411
|
+
* + `CPF`: for individual tax payers
|
|
412
|
+
* + `CNPJ`: for corporations
|
|
413
|
+
*/
|
|
414
|
+
type?: VatType;
|
|
415
|
+
}
|
|
416
|
+
/** tax info types */
|
|
417
|
+
export declare enum VatType {
|
|
418
|
+
UNSPECIFIED = "UNSPECIFIED",
|
|
419
|
+
/** CPF - for individual tax payers. */
|
|
420
|
+
CPF = "CPF",
|
|
421
|
+
/** CNPJ - for corporations */
|
|
422
|
+
CNPJ = "CNPJ"
|
|
423
|
+
}
|
|
424
|
+
export interface ShippingInfo {
|
|
425
|
+
/** Selected option out of the options allowed for the `region`. */
|
|
426
|
+
selectedCarrierServiceOption?: SelectedCarrierServiceOption;
|
|
427
|
+
}
|
|
428
|
+
export interface SelectedCarrierServiceOption {
|
|
429
|
+
/** Unique identifier of selected option. For example, `usps_std_overnight`. */
|
|
430
|
+
code?: string;
|
|
431
|
+
/**
|
|
432
|
+
* Title of the option, such as USPS Standard Overnight Delivery (in the requested locale).
|
|
433
|
+
* For example, "Standard" or "First-Class Package International".
|
|
434
|
+
*/
|
|
435
|
+
title?: string;
|
|
436
|
+
/** Shipping costs. */
|
|
437
|
+
cost?: SelectedCarrierServiceOptionPrices;
|
|
438
|
+
/** Delivery solution allocations to different delivery carriers and delivery regions */
|
|
439
|
+
deliveryAllocations?: DeliveryAllocation[];
|
|
440
|
+
/** If the delivery solution is a partial and doesn't apply to all items. */
|
|
441
|
+
partial?: boolean | null;
|
|
442
|
+
}
|
|
443
|
+
export interface SelectedCarrierServiceOptionPrices {
|
|
444
|
+
/** Total shipping price, after discount and after tax. */
|
|
445
|
+
totalPriceAfterTax?: MultiCurrencyPrice;
|
|
446
|
+
/** Total price of shipping after discounts (when relevant), and before tax. */
|
|
447
|
+
totalPriceBeforeTax?: MultiCurrencyPrice;
|
|
448
|
+
/** Tax details. */
|
|
449
|
+
taxDetails?: ItemTaxFullDetails;
|
|
450
|
+
/** Shipping discount before tax. */
|
|
451
|
+
totalDiscount?: MultiCurrencyPrice;
|
|
452
|
+
/** Shipping price before discount and before tax. */
|
|
453
|
+
price?: MultiCurrencyPrice;
|
|
454
|
+
}
|
|
455
|
+
export interface DeliveryAllocation {
|
|
456
|
+
/** The delivery option's carrier details, could be multiple if the delivery option is a combination of multiple carriers */
|
|
457
|
+
deliveryCarrier?: Carrier;
|
|
458
|
+
/** The delivery region that are relevant for this delivery solution. */
|
|
459
|
+
deliveryRegion?: Region;
|
|
460
|
+
/** Populated if the delivery solution is a partially supplied by this carrier. */
|
|
461
|
+
applicableLineItems?: ApplicableLineItems;
|
|
462
|
+
}
|
|
463
|
+
export interface Carrier {
|
|
464
|
+
/** The carrier app id */
|
|
465
|
+
appId?: string | null;
|
|
466
|
+
/** Unique code that acts as an ID for a shipping rate. For example, `"usps_std_overnight"`. */
|
|
467
|
+
code?: string;
|
|
468
|
+
}
|
|
469
|
+
export interface Region {
|
|
470
|
+
/** The delivery region id. */
|
|
471
|
+
_id?: string | null;
|
|
472
|
+
/** The delivery region name. */
|
|
473
|
+
name?: string | null;
|
|
474
|
+
}
|
|
475
|
+
export interface ApplicableLineItems {
|
|
476
|
+
/** Line items that the delivery solution is for. */
|
|
477
|
+
lineItemIds?: string[];
|
|
478
|
+
}
|
|
479
|
+
export interface CustomFields {
|
|
480
|
+
/** List of custom fields */
|
|
481
|
+
fields?: CustomField[];
|
|
482
|
+
}
|
|
483
|
+
export interface CustomField {
|
|
484
|
+
/** Custom field value. */
|
|
485
|
+
value?: any;
|
|
486
|
+
/** Custom field title. */
|
|
487
|
+
title?: string;
|
|
488
|
+
/** Translated custom field title. */
|
|
489
|
+
translatedTitle?: string | null;
|
|
490
|
+
}
|
|
491
|
+
export interface AppliedDiscount extends AppliedDiscountDiscountSourceOneOf {
|
|
492
|
+
/** Coupon details. */
|
|
493
|
+
coupon?: Coupon;
|
|
494
|
+
/** Merchant discount. */
|
|
495
|
+
merchantDiscount?: MerchantDiscount;
|
|
496
|
+
/** Discount rule. */
|
|
497
|
+
discountRule?: DiscountRule;
|
|
498
|
+
/** Discount type. */
|
|
499
|
+
discountType?: DiscountType;
|
|
500
|
+
/** IDs of the line items the discount applies to. */
|
|
501
|
+
lineItemIds?: string[];
|
|
502
|
+
}
|
|
503
|
+
/** @oneof */
|
|
504
|
+
export interface AppliedDiscountDiscountSourceOneOf {
|
|
505
|
+
/** Coupon details. */
|
|
506
|
+
coupon?: Coupon;
|
|
507
|
+
/** Merchant discount. */
|
|
508
|
+
merchantDiscount?: MerchantDiscount;
|
|
509
|
+
/** Discount rule. */
|
|
510
|
+
discountRule?: DiscountRule;
|
|
511
|
+
}
|
|
512
|
+
export declare enum DiscountType {
|
|
513
|
+
/** Global discount. */
|
|
514
|
+
GLOBAL = "GLOBAL",
|
|
515
|
+
/** Discount for specific items. */
|
|
516
|
+
SPECIFIC_ITEMS = "SPECIFIC_ITEMS",
|
|
517
|
+
/** Shipping discount. */
|
|
518
|
+
SHIPPING = "SHIPPING"
|
|
519
|
+
}
|
|
520
|
+
/** Coupon */
|
|
521
|
+
export interface Coupon {
|
|
522
|
+
/** Coupon ID. */
|
|
523
|
+
_id?: string;
|
|
524
|
+
/** Coupon code. */
|
|
525
|
+
code?: string;
|
|
526
|
+
/** Coupon name. */
|
|
527
|
+
name?: string;
|
|
528
|
+
amount?: string;
|
|
529
|
+
}
|
|
530
|
+
export interface MerchantDiscount {
|
|
531
|
+
amount?: string;
|
|
532
|
+
}
|
|
533
|
+
export interface DiscountRule {
|
|
534
|
+
/** Discount rule ID. */
|
|
535
|
+
_id?: string;
|
|
536
|
+
/** Discount rule name. */
|
|
537
|
+
name?: DiscountRuleName;
|
|
538
|
+
amount?: string;
|
|
539
|
+
}
|
|
540
|
+
export interface DiscountRuleName {
|
|
541
|
+
/** Original discount rule name (in site's default language). */
|
|
542
|
+
original?: string;
|
|
543
|
+
/** Translated discount rule name according to buyer language. Defaults to `original` when not provided. */
|
|
544
|
+
translated?: string | null;
|
|
545
|
+
}
|
|
546
|
+
export interface ExternalReference {
|
|
547
|
+
/**
|
|
548
|
+
* ID of the app associated with the purchase flow.
|
|
549
|
+
* For example, the Wix Pay Links app ID.
|
|
550
|
+
*/
|
|
551
|
+
appId?: string;
|
|
552
|
+
/**
|
|
553
|
+
* Reference to an external resource ID. Used to link the purchase flow to a specific entity in an external system.
|
|
554
|
+
* For example, a Wix Pay Link ID.
|
|
555
|
+
*/
|
|
556
|
+
resourceId?: string | null;
|
|
557
|
+
}
|
|
558
|
+
export interface ExtendedFields {
|
|
559
|
+
/**
|
|
560
|
+
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
561
|
+
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
562
|
+
*
|
|
563
|
+
* You can only access fields for which you have the appropriate permissions.
|
|
564
|
+
*
|
|
565
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
566
|
+
*/
|
|
567
|
+
namespaces?: Record<string, Record<string, any>>;
|
|
568
|
+
}
|
|
569
|
+
export interface GetValidationViolationsResponse {
|
|
570
|
+
/** List of validation violations. */
|
|
571
|
+
violations?: Violation[];
|
|
572
|
+
}
|
|
573
|
+
export interface Violation {
|
|
574
|
+
/** Severity of the violation. The violations are shown on the cart and checkout pages. A warning is displayed as yellow, and allows a site visitor to proceed with caution. An error is displayed as red, and doesn't allow a site visitor to proceed with the eCommerce flow. */
|
|
575
|
+
severity?: Severity;
|
|
576
|
+
/** Target location on a checkout or cart page where the violation will be displayed. */
|
|
577
|
+
target?: Target;
|
|
578
|
+
/** Violation description. Can include rich text. Only HTTP or HTTPS links in the following format are allowed: `<a href="https://www.wix.com">Click me</a>`. */
|
|
579
|
+
description?: string | null;
|
|
580
|
+
}
|
|
581
|
+
export declare enum Severity {
|
|
582
|
+
/** The user is allowed to move forward in the flow. */
|
|
583
|
+
WARNING = "WARNING",
|
|
584
|
+
/**
|
|
585
|
+
* The user is blocked from moving forward in the flow.
|
|
586
|
+
* For example, if callerContext is CART - moving to checkout is blocked. if callerContext is CHECKOUT, placing an order is blocked.
|
|
587
|
+
*/
|
|
588
|
+
ERROR = "ERROR"
|
|
589
|
+
}
|
|
590
|
+
export interface Target extends TargetTargetTypeOneOf {
|
|
591
|
+
/** General (other) violation. */
|
|
592
|
+
other?: Other;
|
|
593
|
+
/** Specific line item violation. */
|
|
594
|
+
lineItem?: TargetLineItem;
|
|
595
|
+
}
|
|
596
|
+
/** @oneof */
|
|
597
|
+
export interface TargetTargetTypeOneOf {
|
|
598
|
+
/** General (other) violation. */
|
|
599
|
+
other?: Other;
|
|
600
|
+
/** Specific line item violation. */
|
|
601
|
+
lineItem?: TargetLineItem;
|
|
602
|
+
}
|
|
603
|
+
/** Available locations on the webpage */
|
|
604
|
+
export declare enum NameInOther {
|
|
605
|
+
/** Default location, in case no specific location is specified. */
|
|
606
|
+
OTHER_DEFAULT = "OTHER_DEFAULT"
|
|
607
|
+
}
|
|
608
|
+
/** Available locations on the line item */
|
|
609
|
+
export declare enum NameInLineItem {
|
|
610
|
+
/** Default location, in case no specific location is specified. */
|
|
611
|
+
LINE_ITEM_DEFAULT = "LINE_ITEM_DEFAULT"
|
|
612
|
+
}
|
|
613
|
+
export declare enum SuggestedFix {
|
|
614
|
+
/** No suggested fix is specified. The user should refer to the violation description to resolve the issue. */
|
|
615
|
+
UNKNOWN_SUGGESTED_FIX = "UNKNOWN_SUGGESTED_FIX",
|
|
616
|
+
/** The line item should be removed from the cart or checkout to resolve the violation. */
|
|
617
|
+
REMOVE_LINE_ITEM = "REMOVE_LINE_ITEM"
|
|
618
|
+
}
|
|
619
|
+
/** General (other) violation. */
|
|
620
|
+
export interface Other {
|
|
621
|
+
/** Location on a checkout or a cart page where a general (other) violation will be displayed. */
|
|
622
|
+
name?: NameInOther;
|
|
623
|
+
}
|
|
624
|
+
/** Specific line item violation. */
|
|
625
|
+
export interface TargetLineItem {
|
|
626
|
+
/** Location on a checkout or a cart page where the specific line item violation will be displayed. */
|
|
627
|
+
name?: NameInLineItem;
|
|
628
|
+
/** ID of the line item containing the violation. */
|
|
629
|
+
_id?: string | null;
|
|
630
|
+
}
|
|
631
|
+
export interface ValidationsSPIConfig {
|
|
632
|
+
/** Whether to validate the cart page in addition to the checkout page. Default: `false` */
|
|
633
|
+
validateInCart?: boolean;
|
|
634
|
+
/**
|
|
635
|
+
* Required. Base URI where the endpoints are called. Wix appends the endpoint path to the base URI.
|
|
636
|
+
* For example, to call the Get Validation Violations endpoint at `https://my-validations.com/v1/get-violations`, the base URI you provide here is `https://my-validations.com`.
|
|
637
|
+
*/
|
|
638
|
+
deploymentUri?: string;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* this message is not directly used by any service,
|
|
642
|
+
* it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.
|
|
643
|
+
* e.g. SPIs, event-handlers, etc..
|
|
644
|
+
* NOTE: this context object MUST be provided as the last argument in each Velo method signature.
|
|
645
|
+
*
|
|
646
|
+
* Example:
|
|
647
|
+
* ```typescript
|
|
648
|
+
* export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {
|
|
649
|
+
* ...
|
|
650
|
+
* }
|
|
651
|
+
* ```
|
|
652
|
+
*/
|
|
653
|
+
export interface Context {
|
|
654
|
+
/** 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. */
|
|
655
|
+
requestId?: string | null;
|
|
656
|
+
/** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. */
|
|
657
|
+
currency?: string | null;
|
|
658
|
+
/** An object that describes the identity that triggered this request. */
|
|
659
|
+
identity?: IdentificationData;
|
|
660
|
+
/** 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"`. */
|
|
661
|
+
languages?: string[];
|
|
662
|
+
/** The service provider app's instance ID. */
|
|
663
|
+
instanceId?: string | null;
|
|
664
|
+
}
|
|
665
|
+
export declare enum IdentityType {
|
|
666
|
+
UNKNOWN = "UNKNOWN",
|
|
667
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
668
|
+
MEMBER = "MEMBER",
|
|
669
|
+
WIX_USER = "WIX_USER",
|
|
670
|
+
APP = "APP"
|
|
671
|
+
}
|
|
672
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
673
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
674
|
+
anonymousVisitorId?: string;
|
|
675
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
676
|
+
memberId?: string;
|
|
677
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
678
|
+
wixUserId?: string;
|
|
679
|
+
/** ID of an app. */
|
|
680
|
+
appId?: string;
|
|
681
|
+
/** @readonly */
|
|
682
|
+
identityType?: IdentityType;
|
|
683
|
+
}
|
|
684
|
+
/** @oneof */
|
|
685
|
+
export interface IdentificationDataIdOneOf {
|
|
686
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
687
|
+
anonymousVisitorId?: string;
|
|
688
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
689
|
+
memberId?: string;
|
|
690
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
691
|
+
wixUserId?: string;
|
|
692
|
+
/** ID of an app. */
|
|
693
|
+
appId?: string;
|
|
694
|
+
}
|