@wix/stores 1.0.67 → 1.0.68
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/src/stores-catalog-v1-product.http.d.ts +8 -7
- package/build/cjs/src/stores-catalog-v1-product.http.js +8 -7
- package/build/cjs/src/stores-catalog-v1-product.http.js.map +1 -1
- package/build/cjs/src/stores-catalog-v1-product.public.d.ts +14 -14
- package/build/cjs/src/stores-catalog-v1-product.public.js +18 -18
- package/build/cjs/src/stores-catalog-v1-product.public.js.map +1 -1
- package/build/cjs/src/stores-catalog-v1-product.types.d.ts +37 -23
- package/build/cjs/src/stores-catalog-v1-product.types.js.map +1 -1
- package/build/cjs/src/stores-catalog-v1-product.universal.d.ts +150 -121
- package/build/cjs/src/stores-catalog-v1-product.universal.js +125 -78
- package/build/cjs/src/stores-catalog-v1-product.universal.js.map +1 -1
- package/build/es/src/stores-catalog-v1-product.http.d.ts +8 -7
- package/build/es/src/stores-catalog-v1-product.http.js +8 -7
- package/build/es/src/stores-catalog-v1-product.http.js.map +1 -1
- package/build/es/src/stores-catalog-v1-product.public.d.ts +14 -14
- package/build/es/src/stores-catalog-v1-product.public.js +15 -15
- package/build/es/src/stores-catalog-v1-product.public.js.map +1 -1
- package/build/es/src/stores-catalog-v1-product.types.d.ts +37 -23
- package/build/es/src/stores-catalog-v1-product.types.js.map +1 -1
- package/build/es/src/stores-catalog-v1-product.universal.d.ts +150 -121
- package/build/es/src/stores-catalog-v1-product.universal.js +121 -74
- package/build/es/src/stores-catalog-v1-product.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stores-catalog-v1-product.types.js","sourceRoot":"","sources":["../../../src/stores-catalog-v1-product.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"stores-catalog-v1-product.types.js","sourceRoot":"","sources":["../../../src/stores-catalog-v1-product.types.ts"],"names":[],"mappings":";;;AAgIA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,oEAAqD,CAAA;IACrD,oCAAqB,CAAA;IACrB,kCAAmB,CAAA;AACrB,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AA4BD,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,wCAAqB,CAAA;IACrB,gDAA6B,CAAA;IAC7B,oEAAiD,CAAA;AACnD,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B;AA4ED,IAAY,eAuBX;AAvBD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,0BAAO,CAAA;IACP,8BAAW,CAAA;IACX,4BAAS,CAAA;IACT,0BAAO,CAAA;IACP,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,0BAAO,CAAA;IACP,8BAAW,CAAA;IACX,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,gCAAa,CAAA;IACb,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,8BAAW,CAAA;IACX,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,gCAAa,CAAA;AACf,CAAC,EAvBW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAuB1B;AAyDD,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,4EAA2D,CAAA;IAC3D,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,4BAAW,CAAA;AACb,CAAC,EAPW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAOxB;AA8BD,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iEAAmD,CAAA;IACnD,qCAAuB,CAAA;IACvB,6BAAe,CAAA;AACjB,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AA0CD,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,kBAAkB;IAClB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;AACrB,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB;AAytBD,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
|
|
@@ -10,7 +10,12 @@ export interface Product {
|
|
|
10
10
|
* @readonly
|
|
11
11
|
*/
|
|
12
12
|
_id?: string;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Product name.
|
|
15
|
+
*
|
|
16
|
+
* Min: 1 character
|
|
17
|
+
* Max: 80 characters
|
|
18
|
+
*/
|
|
14
19
|
name?: string | null;
|
|
15
20
|
/** A friendly URL name (generated automatically by the catalog when a product is created), can be updated. */
|
|
16
21
|
slug?: string;
|
|
@@ -18,11 +23,11 @@ export interface Product {
|
|
|
18
23
|
visible?: boolean | null;
|
|
19
24
|
/** Currently, only creating physical products ( `"productType": "physical"` ) is supported via the API. */
|
|
20
25
|
productType?: ProductType;
|
|
21
|
-
/** Product description.
|
|
26
|
+
/** Product description. */
|
|
22
27
|
description?: string | null;
|
|
23
|
-
/** Stock keeping unit
|
|
28
|
+
/** Stock keeping unit. If [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is enabled, SKUs will be set per variant, and this field will be empty. */
|
|
24
29
|
sku?: string | null;
|
|
25
|
-
/** Product weight
|
|
30
|
+
/** Product weight. If [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is enabled, weight will be set per variant, and this field will be empty. */
|
|
26
31
|
weight?: number | null;
|
|
27
32
|
/**
|
|
28
33
|
* Product weight range. The minimum and maximum weights of all the variants.
|
|
@@ -77,9 +82,9 @@ export interface Product {
|
|
|
77
82
|
* @readonly
|
|
78
83
|
*/
|
|
79
84
|
customTextFields?: CustomTextField[];
|
|
80
|
-
/** Whether variants are being managed for this product - enables unique SKU, price and weight per variant. Also affects inventory data. */
|
|
85
|
+
/** Whether variants are being managed for this product - enables unique SKU, price and weight per variant. Also affects inventory data. Once set to `true`, can be reset to `false` only if no variants exist. You cannot set `manageVariants` to `true` if more than 300 variants are defined. */
|
|
81
86
|
manageVariants?: boolean | null;
|
|
82
|
-
/** Options
|
|
87
|
+
/** Options for this product. */
|
|
83
88
|
productOptions?: ProductOption[];
|
|
84
89
|
/**
|
|
85
90
|
* Product page URL for this product (generated automatically by the server).
|
|
@@ -331,9 +336,9 @@ export interface ProductOption {
|
|
|
331
336
|
* @readonly
|
|
332
337
|
*/
|
|
333
338
|
optionType?: OptionType;
|
|
334
|
-
/** Option name
|
|
339
|
+
/** Option name. */
|
|
335
340
|
name?: string;
|
|
336
|
-
/** Choices available for this option */
|
|
341
|
+
/** Choices available for this option. */
|
|
337
342
|
choices?: Choice[];
|
|
338
343
|
}
|
|
339
344
|
export declare enum OptionType {
|
|
@@ -342,9 +347,9 @@ export declare enum OptionType {
|
|
|
342
347
|
color = "color"
|
|
343
348
|
}
|
|
344
349
|
export interface Choice {
|
|
345
|
-
/**
|
|
350
|
+
/** Choice value. */
|
|
346
351
|
value?: string;
|
|
347
|
-
/** Choice
|
|
352
|
+
/** Choice description. */
|
|
348
353
|
description?: string;
|
|
349
354
|
/**
|
|
350
355
|
* Media items (images, videos) associated with this choice
|
|
@@ -369,7 +374,11 @@ export interface PageUrl {
|
|
|
369
374
|
path?: string;
|
|
370
375
|
}
|
|
371
376
|
export interface Discount {
|
|
372
|
-
/**
|
|
377
|
+
/**
|
|
378
|
+
* Discount type:
|
|
379
|
+
* + `"AMOUNT"`
|
|
380
|
+
* + `"PERCENT"`
|
|
381
|
+
*/
|
|
373
382
|
type?: DiscountType;
|
|
374
383
|
/** Discount value */
|
|
375
384
|
value?: number;
|
|
@@ -482,7 +491,7 @@ export interface UpdateProductResponse {
|
|
|
482
491
|
product?: Product;
|
|
483
492
|
}
|
|
484
493
|
export interface DeleteProductRequest {
|
|
485
|
-
/** ID of the product to
|
|
494
|
+
/** ID of the product to delete. */
|
|
486
495
|
_id: string;
|
|
487
496
|
}
|
|
488
497
|
export interface DeleteProductResponse {
|
|
@@ -496,6 +505,7 @@ export interface BulkDeleteProductsResponse {
|
|
|
496
505
|
export interface UpdateVariantsRequest {
|
|
497
506
|
/** ID of the product with managed variants. */
|
|
498
507
|
_id: string;
|
|
508
|
+
/** Variant info to update. */
|
|
499
509
|
variants?: VariantOverride[];
|
|
500
510
|
}
|
|
501
511
|
export interface VariantOverride {
|
|
@@ -530,15 +540,15 @@ export interface ResetAllVariantDataResponse {
|
|
|
530
540
|
export interface AddProductsToCollectionRequest {
|
|
531
541
|
/** Collection ID. Cannot be used to add products to All Products */
|
|
532
542
|
_id: string;
|
|
533
|
-
/** IDs of the products to add to the collection. */
|
|
543
|
+
/** IDs of the products to add to the collection, separated by commas. */
|
|
534
544
|
productIds?: string[];
|
|
535
545
|
}
|
|
536
546
|
export interface AddProductsToCollectionResponse {
|
|
537
547
|
}
|
|
538
548
|
export interface RemoveProductsFromCollectionRequest {
|
|
539
|
-
/**
|
|
549
|
+
/** ID of the collection from which to remove products. */
|
|
540
550
|
_id: string;
|
|
541
|
-
/** IDs of the products
|
|
551
|
+
/** IDs of the products to remove from the collection. */
|
|
542
552
|
productIds: string[];
|
|
543
553
|
}
|
|
544
554
|
export interface RemoveProductsFromCollectionResponse {
|
|
@@ -546,29 +556,28 @@ export interface RemoveProductsFromCollectionResponse {
|
|
|
546
556
|
export interface AddProductMediaRequest {
|
|
547
557
|
/** Product ID. */
|
|
548
558
|
_id: string;
|
|
559
|
+
/** Sources of media items already uploaded to the Wix site. */
|
|
549
560
|
media?: MediaDataForWrite[];
|
|
550
561
|
}
|
|
551
562
|
export interface MediaDataForWrite extends MediaDataForWriteMediaSourceOneOf {
|
|
552
|
-
/** Media ID.
|
|
563
|
+
/** Media ID. */
|
|
553
564
|
mediaId?: string;
|
|
554
565
|
/** Media external URL (for new media items). */
|
|
555
566
|
url?: string;
|
|
556
|
-
/**
|
|
557
|
-
* Optional - assign this media item to a specific product choice.
|
|
558
|
-
* Note that you may set media items for choices under only one option (e.g., if Colors blue, green, and red have media items, Sizes S, M, and L can't have media items assigned to them).
|
|
559
|
-
* You may clear existing media from choices via the Remove Product Media From Choices endpoint
|
|
560
|
-
*/
|
|
567
|
+
/** Assign this media item to a specific product choice. Note that you may set media items for choices under only one option (e.g., if Colors blue, green, and red have media items, Sizes S, M, and L can't have media items assigned to them). You may clear existing media from choices with the [Remove Product Media From Choices](#removeproductmediafromchoices). */
|
|
561
568
|
choice?: OptionAndChoice;
|
|
562
569
|
}
|
|
563
570
|
/** @oneof */
|
|
564
571
|
export interface MediaDataForWriteMediaSourceOneOf {
|
|
565
|
-
/** Media ID.
|
|
572
|
+
/** Media ID. */
|
|
566
573
|
mediaId?: string;
|
|
567
574
|
/** Media external URL (for new media items). */
|
|
568
575
|
url?: string;
|
|
569
576
|
}
|
|
570
577
|
export interface OptionAndChoice {
|
|
578
|
+
/** Option to add the media to. */
|
|
571
579
|
option?: string;
|
|
580
|
+
/** Choice to add the media to. */
|
|
572
581
|
choice?: string;
|
|
573
582
|
}
|
|
574
583
|
export interface AddProductMediaResponse {
|
|
@@ -584,12 +593,13 @@ export interface RemoveProductMediaResponse {
|
|
|
584
593
|
export interface AddProductMediaToChoicesRequest {
|
|
585
594
|
/** Product ID. */
|
|
586
595
|
_id: string;
|
|
596
|
+
/** Product media items and the choices to add the media to. */
|
|
587
597
|
media?: MediaAssignmentToChoice[];
|
|
588
598
|
}
|
|
589
599
|
export interface MediaAssignmentToChoice {
|
|
590
|
-
/**
|
|
600
|
+
/** Option name. */
|
|
591
601
|
option?: string;
|
|
592
|
-
/** Choice
|
|
602
|
+
/** Choice name. */
|
|
593
603
|
choice?: string;
|
|
594
604
|
/** Media IDs (available via the Query Product endpoint). */
|
|
595
605
|
mediaIds?: string[];
|
|
@@ -597,15 +607,15 @@ export interface MediaAssignmentToChoice {
|
|
|
597
607
|
export interface AddProductMediaToChoicesResponse {
|
|
598
608
|
}
|
|
599
609
|
export interface RemoveProductMediaFromChoicesRequest {
|
|
600
|
-
/** Product ID. */
|
|
610
|
+
/** Product ID from whose choices to remove media items. */
|
|
601
611
|
_id: string;
|
|
602
|
-
/**
|
|
612
|
+
/** Media to remove from choices. If an empty array is passed, all media will be removed from all choices for the given product. */
|
|
603
613
|
media?: MediaAssignmentToChoice[];
|
|
604
614
|
}
|
|
605
615
|
export interface RemoveProductMediaFromChoicesResponse {
|
|
606
616
|
}
|
|
607
617
|
export interface DeleteProductOptionsRequest {
|
|
608
|
-
/**
|
|
618
|
+
/** ID of the product with options to delete. */
|
|
609
619
|
_id: string;
|
|
610
620
|
}
|
|
611
621
|
export interface DeleteProductOptionsResponse {
|
|
@@ -690,7 +700,7 @@ export interface UpdateCollectionResponse {
|
|
|
690
700
|
collection?: Collection;
|
|
691
701
|
}
|
|
692
702
|
export interface DeleteCollectionRequest {
|
|
693
|
-
/** ID of the collection to delete.
|
|
703
|
+
/** ID of the collection to delete. */
|
|
694
704
|
_id: string;
|
|
695
705
|
}
|
|
696
706
|
export interface DeleteCollectionResponse {
|
|
@@ -879,8 +889,8 @@ export interface PercentageData {
|
|
|
879
889
|
*/
|
|
880
890
|
roundToInt?: boolean;
|
|
881
891
|
/**
|
|
882
|
-
* Percentage value, as a whole number (integer) between
|
|
883
|
-
* For example, pass 100 to increase value by 100% (multiply original value by 2).
|
|
892
|
+
* Percentage value, as a whole number (integer) between `-100`` and `1000``.
|
|
893
|
+
* For example, pass `100`` to increase value by 100% (multiply original value by 2).
|
|
884
894
|
*/
|
|
885
895
|
rate?: number;
|
|
886
896
|
}
|
|
@@ -1135,7 +1145,7 @@ export interface GetCollectionRequest {
|
|
|
1135
1145
|
_id: string;
|
|
1136
1146
|
/**
|
|
1137
1147
|
* Whether to return the `collection.numberOfProducts` field in the response.
|
|
1138
|
-
* Defaults to false
|
|
1148
|
+
* Defaults to `false`, in which case the value of `collection.numberOfProducts` will be `0`.
|
|
1139
1149
|
*/
|
|
1140
1150
|
includeNumberOfProducts?: boolean;
|
|
1141
1151
|
}
|
|
@@ -1154,7 +1164,7 @@ export interface GetCollectionBySlugResponse {
|
|
|
1154
1164
|
export interface ProductOptionsAvailabilityRequest {
|
|
1155
1165
|
/** Requested product ID. */
|
|
1156
1166
|
_id: string;
|
|
1157
|
-
/** Array containing the selected options (e.g, color: Blue, size: Large). */
|
|
1167
|
+
/** Set of key-value pairs. Array containing the selected options (e.g, color: Blue, size: Large). */
|
|
1158
1168
|
options?: Record<string, string>;
|
|
1159
1169
|
}
|
|
1160
1170
|
export interface ProductOptionsAvailabilityResponse {
|
|
@@ -1367,25 +1377,28 @@ export interface AggregateProductsResponse {
|
|
|
1367
1377
|
}
|
|
1368
1378
|
/**
|
|
1369
1379
|
* Creates a new product.
|
|
1380
|
+
*
|
|
1381
|
+
* This function is not a universal function and runs only on the backend.
|
|
1382
|
+
* @param product - Product information.
|
|
1370
1383
|
* @public
|
|
1371
1384
|
* @documentationMaturity preview
|
|
1372
|
-
* @requiredField
|
|
1373
|
-
* @requiredField
|
|
1374
|
-
* @requiredField
|
|
1375
|
-
* @requiredField
|
|
1385
|
+
* @requiredField product
|
|
1386
|
+
* @requiredField product.costAndProfitData.itemCost
|
|
1387
|
+
* @requiredField product.name
|
|
1388
|
+
* @requiredField product.priceData
|
|
1389
|
+
* @requiredField product.priceData.price
|
|
1376
1390
|
*/
|
|
1377
|
-
export declare function createProduct(
|
|
1378
|
-
export interface CreateProductOptions {
|
|
1379
|
-
/** Product information. */
|
|
1380
|
-
product?: Product;
|
|
1381
|
-
}
|
|
1391
|
+
export declare function createProduct(product: Product): Promise<CreateProductResponse>;
|
|
1382
1392
|
/**
|
|
1383
1393
|
* Updates specified fields in a product.
|
|
1394
|
+
*
|
|
1395
|
+
* This function is not a universal function and runs only on the backend.
|
|
1384
1396
|
* @param _id - Product ID (generated automatically by the catalog).
|
|
1385
1397
|
* @public
|
|
1386
1398
|
* @documentationMaturity preview
|
|
1387
1399
|
* @requiredField _id
|
|
1388
1400
|
* @requiredField product
|
|
1401
|
+
* @param product - Product info to update.
|
|
1389
1402
|
*/
|
|
1390
1403
|
export declare function updateProduct(_id: string, product: UpdateProduct): Promise<UpdateProductResponse>;
|
|
1391
1404
|
export interface UpdateProduct {
|
|
@@ -1394,7 +1407,12 @@ export interface UpdateProduct {
|
|
|
1394
1407
|
* @readonly
|
|
1395
1408
|
*/
|
|
1396
1409
|
_id?: string;
|
|
1397
|
-
/**
|
|
1410
|
+
/**
|
|
1411
|
+
* Product name.
|
|
1412
|
+
*
|
|
1413
|
+
* Min: 1 character
|
|
1414
|
+
* Max: 80 characters
|
|
1415
|
+
*/
|
|
1398
1416
|
name?: string | null;
|
|
1399
1417
|
/** A friendly URL name (generated automatically by the catalog when a product is created), can be updated. */
|
|
1400
1418
|
slug?: string;
|
|
@@ -1402,11 +1420,11 @@ export interface UpdateProduct {
|
|
|
1402
1420
|
visible?: boolean | null;
|
|
1403
1421
|
/** Currently, only creating physical products ( `"productType": "physical"` ) is supported via the API. */
|
|
1404
1422
|
productType?: ProductType;
|
|
1405
|
-
/** Product description.
|
|
1423
|
+
/** Product description. */
|
|
1406
1424
|
description?: string | null;
|
|
1407
|
-
/** Stock keeping unit
|
|
1425
|
+
/** Stock keeping unit. If [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is enabled, SKUs will be set per variant, and this field will be empty. */
|
|
1408
1426
|
sku?: string | null;
|
|
1409
|
-
/** Product weight
|
|
1427
|
+
/** Product weight. If [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is enabled, weight will be set per variant, and this field will be empty. */
|
|
1410
1428
|
weight?: number | null;
|
|
1411
1429
|
/**
|
|
1412
1430
|
* Product weight range. The minimum and maximum weights of all the variants.
|
|
@@ -1461,9 +1479,9 @@ export interface UpdateProduct {
|
|
|
1461
1479
|
* @readonly
|
|
1462
1480
|
*/
|
|
1463
1481
|
customTextFields?: CustomTextField[];
|
|
1464
|
-
/** Whether variants are being managed for this product - enables unique SKU, price and weight per variant. Also affects inventory data. */
|
|
1482
|
+
/** Whether variants are being managed for this product - enables unique SKU, price and weight per variant. Also affects inventory data. Once set to `true`, can be reset to `false` only if no variants exist. You cannot set `manageVariants` to `true` if more than 300 variants are defined. */
|
|
1465
1483
|
manageVariants?: boolean | null;
|
|
1466
|
-
/** Options
|
|
1484
|
+
/** Options for this product. */
|
|
1467
1485
|
productOptions?: ProductOption[];
|
|
1468
1486
|
/**
|
|
1469
1487
|
* Product page URL for this product (generated automatically by the server).
|
|
@@ -1512,117 +1530,124 @@ export interface UpdateProduct {
|
|
|
1512
1530
|
}
|
|
1513
1531
|
/**
|
|
1514
1532
|
* Deletes a product.
|
|
1515
|
-
*
|
|
1533
|
+
*
|
|
1534
|
+
* This function is not a universal function and runs only on the backend.
|
|
1535
|
+
* @param _id - ID of the product to delete.
|
|
1516
1536
|
* @public
|
|
1517
|
-
* @documentationMaturity preview
|
|
1518
1537
|
* @requiredField _id
|
|
1519
1538
|
*/
|
|
1520
1539
|
export declare function deleteProduct(_id: string): Promise<void>;
|
|
1521
1540
|
/**
|
|
1522
1541
|
* Updates variants of a specified product.
|
|
1542
|
+
*
|
|
1543
|
+
* This function is not a universal function and runs only on the backend.
|
|
1523
1544
|
* @param _id - ID of the product with managed variants.
|
|
1545
|
+
* @param variants - Variant info to update.
|
|
1524
1546
|
* @public
|
|
1525
1547
|
* @documentationMaturity preview
|
|
1526
1548
|
* @requiredField _id
|
|
1549
|
+
* @requiredField variants
|
|
1527
1550
|
*/
|
|
1528
|
-
export declare function
|
|
1529
|
-
export interface UpdateVariantsOptions {
|
|
1530
|
-
variants?: VariantOverride[];
|
|
1531
|
-
}
|
|
1551
|
+
export declare function updateProductVariants(_id: string, variants: VariantOverride[]): Promise<UpdateVariantsResponse>;
|
|
1532
1552
|
/**
|
|
1533
|
-
* Resets
|
|
1553
|
+
* Resets the data (such as the price and the weight) of all variants for a given product to their default values.
|
|
1554
|
+
*
|
|
1555
|
+
* This function is not a universal function and runs only on the backend.
|
|
1534
1556
|
* @param _id - Product ID.
|
|
1535
1557
|
* @public
|
|
1536
1558
|
* @documentationMaturity preview
|
|
1537
1559
|
* @requiredField _id
|
|
1538
1560
|
*/
|
|
1539
|
-
export declare function
|
|
1561
|
+
export declare function resetAllProductVariantData(_id: string): Promise<void>;
|
|
1540
1562
|
/**
|
|
1541
1563
|
* Adds products to a specified collection.
|
|
1564
|
+
*
|
|
1565
|
+
* This function is not a universal function and runs only on the backend.
|
|
1542
1566
|
* @param _id - Collection ID. Cannot be used to add products to All Products
|
|
1567
|
+
* @param productIds - IDs of the products to add to the collection, separated by commas.
|
|
1543
1568
|
* @public
|
|
1544
|
-
* @documentationMaturity preview
|
|
1545
1569
|
* @requiredField _id
|
|
1570
|
+
* @requiredField productIds
|
|
1546
1571
|
*/
|
|
1547
|
-
export declare function addProductsToCollection(_id: string,
|
|
1548
|
-
export interface AddProductsToCollectionOptions {
|
|
1549
|
-
/** IDs of the products to add to the collection. */
|
|
1550
|
-
productIds?: string[];
|
|
1551
|
-
}
|
|
1572
|
+
export declare function addProductsToCollection(_id: string, productIds: string[]): Promise<void>;
|
|
1552
1573
|
/**
|
|
1553
1574
|
* Deletes products from a specified collection.
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
1575
|
+
*
|
|
1576
|
+
* This function is not a universal function and runs only on the backend.
|
|
1577
|
+
* @param _id - ID of the collection from which to remove products.
|
|
1578
|
+
* @param productIds - IDs of the products to remove from the collection.
|
|
1556
1579
|
* @public
|
|
1557
|
-
* @documentationMaturity preview
|
|
1558
1580
|
* @requiredField _id
|
|
1559
1581
|
* @requiredField productIds
|
|
1560
1582
|
*/
|
|
1561
1583
|
export declare function removeProductsFromCollection(_id: string, productIds: string[]): Promise<void>;
|
|
1562
1584
|
/**
|
|
1563
1585
|
* Adds media items to a specified product, either via URL or existing media ID.
|
|
1586
|
+
*
|
|
1587
|
+
* > **NOTE:** The URL is not validated and no event is triggered to indicate if the media was added successfully.
|
|
1588
|
+
*
|
|
1589
|
+
* This function is not a universal function and runs only on the backend.
|
|
1564
1590
|
* @param _id - Product ID.
|
|
1591
|
+
* @param media - Sources of media items already uploaded to the Wix site.
|
|
1565
1592
|
* @public
|
|
1566
|
-
* @documentationMaturity preview
|
|
1567
1593
|
* @requiredField _id
|
|
1594
|
+
* @requiredField media
|
|
1568
1595
|
*/
|
|
1569
|
-
export declare function addProductMedia(_id: string,
|
|
1570
|
-
export interface AddProductMediaOptions {
|
|
1571
|
-
media?: MediaDataForWrite[];
|
|
1572
|
-
}
|
|
1596
|
+
export declare function addProductMedia(_id: string, media: MediaDataForWrite[]): Promise<void>;
|
|
1573
1597
|
/**
|
|
1574
1598
|
* Removes specified media items from a product.
|
|
1575
1599
|
* Pass an empty array to remove all media items.
|
|
1600
|
+
*
|
|
1601
|
+
* This function is not a universal function and runs only on the backend.
|
|
1576
1602
|
* @param _id - Product ID.
|
|
1603
|
+
* @param mediaIds - List of media IDs to remove. Pass an empty array to delete all media items for the product.
|
|
1577
1604
|
* @public
|
|
1578
|
-
* @documentationMaturity preview
|
|
1579
1605
|
* @requiredField _id
|
|
1606
|
+
* @requiredField mediaIds
|
|
1580
1607
|
*/
|
|
1581
|
-
export declare function removeProductMedia(_id: string,
|
|
1582
|
-
export interface RemoveProductMediaOptions {
|
|
1583
|
-
/** List of media IDs to remove. Pass an empty array to delete all media items for the product. */
|
|
1584
|
-
mediaIds?: string[];
|
|
1585
|
-
}
|
|
1608
|
+
export declare function removeProductMedia(_id: string, mediaIds: string[]): Promise<void>;
|
|
1586
1609
|
/**
|
|
1587
1610
|
* Links media items that are already associated with a specific product to a choice within the same product.
|
|
1588
1611
|
*
|
|
1589
1612
|
* Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).
|
|
1590
1613
|
*
|
|
1591
1614
|
* To remove all existing media items, call the [Remove Product Media From Choices](https://dev.wix.com/api/rest/wix-stores/catalog/products/remove-product-media-from-choices) endpoint.
|
|
1615
|
+
*
|
|
1616
|
+
* This function is not a universal function and runs only on the backend.
|
|
1592
1617
|
* @param _id - Product ID.
|
|
1618
|
+
* @param media - Product media items and the choices to add the media to.
|
|
1593
1619
|
* @public
|
|
1594
|
-
* @documentationMaturity preview
|
|
1595
1620
|
* @requiredField _id
|
|
1596
|
-
* @requiredField
|
|
1597
|
-
* @requiredField
|
|
1621
|
+
* @requiredField media
|
|
1622
|
+
* @requiredField media.choice
|
|
1623
|
+
* @requiredField media.option
|
|
1598
1624
|
*/
|
|
1599
|
-
export declare function addProductMediaToChoices(_id: string,
|
|
1600
|
-
export interface AddProductMediaToChoicesOptions {
|
|
1601
|
-
media?: MediaAssignmentToChoice[];
|
|
1602
|
-
}
|
|
1625
|
+
export declare function addProductMediaToChoices(_id: string, media: MediaAssignmentToChoice[]): Promise<void>;
|
|
1603
1626
|
/**
|
|
1604
1627
|
* Removes media items from all or some of a product's choices.
|
|
1605
1628
|
* (Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).)
|
|
1606
|
-
*
|
|
1629
|
+
*
|
|
1630
|
+
* This function is not a universal function and runs only on the backend.
|
|
1631
|
+
* @param _id - Product ID from whose choices to remove media items.
|
|
1632
|
+
* @param media - Media to remove from choices. If an empty array is passed, all media will be removed from all choices for the given product.
|
|
1607
1633
|
* @public
|
|
1608
|
-
* @documentationMaturity preview
|
|
1609
1634
|
* @requiredField _id
|
|
1635
|
+
* @requiredField media
|
|
1610
1636
|
*/
|
|
1611
|
-
export declare function removeProductMediaFromChoices(_id: string,
|
|
1612
|
-
export interface RemoveProductMediaFromChoicesOptions {
|
|
1613
|
-
/** Optional - if an empty array is passed, all media will be removed from all choices. */
|
|
1614
|
-
media?: MediaAssignmentToChoice[];
|
|
1615
|
-
}
|
|
1637
|
+
export declare function removeProductMediaFromChoices(_id: string, media: MediaAssignmentToChoice[]): Promise<void>;
|
|
1616
1638
|
/**
|
|
1617
|
-
* Delete all options from a specific product
|
|
1618
|
-
*
|
|
1639
|
+
* Delete all options from a specific product. Only available when [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is disabled.
|
|
1640
|
+
*
|
|
1641
|
+
* This function is not a universal function and runs only on the backend.
|
|
1642
|
+
* @param _id - ID of the product with options to delete.
|
|
1619
1643
|
* @public
|
|
1620
|
-
* @documentationMaturity preview
|
|
1621
1644
|
* @requiredField _id
|
|
1622
1645
|
*/
|
|
1623
1646
|
export declare function deleteProductOptions(_id: string): Promise<void>;
|
|
1624
1647
|
/**
|
|
1625
1648
|
* Deletes a product's brand.
|
|
1649
|
+
*
|
|
1650
|
+
* This function is not a universal function and runs only on the backend.
|
|
1626
1651
|
* @param _id - Product ID.
|
|
1627
1652
|
* @public
|
|
1628
1653
|
* @documentationMaturity preview
|
|
@@ -1631,6 +1656,8 @@ export declare function deleteProductOptions(_id: string): Promise<void>;
|
|
|
1631
1656
|
export declare function removeBrand(_id: string): Promise<void>;
|
|
1632
1657
|
/**
|
|
1633
1658
|
* Creates a new collection.
|
|
1659
|
+
*
|
|
1660
|
+
* This function is not a universal function and runs only on the backend.
|
|
1634
1661
|
* @param collection - Collection info.
|
|
1635
1662
|
* @public
|
|
1636
1663
|
* @documentationMaturity preview
|
|
@@ -1639,13 +1666,15 @@ export declare function removeBrand(_id: string): Promise<void>;
|
|
|
1639
1666
|
*/
|
|
1640
1667
|
export declare function createCollection(collection: Collection): Promise<CreateCollectionResponse>;
|
|
1641
1668
|
/**
|
|
1642
|
-
* Updates specified properties of a collection.
|
|
1643
|
-
*
|
|
1669
|
+
* Updates specified properties of a collection. To add products to a collection, call the [addProductsToCollection](#addproductstocollection) function.
|
|
1670
|
+
*
|
|
1671
|
+
* This function is not a universal function and runs only on the backend.
|
|
1644
1672
|
* @param _id - Collection ID (generated automatically by the catalog).
|
|
1645
1673
|
* @public
|
|
1646
1674
|
* @documentationMaturity preview
|
|
1647
1675
|
* @requiredField _id
|
|
1648
1676
|
* @requiredField collection
|
|
1677
|
+
* @param collection - Collection info to update.
|
|
1649
1678
|
*/
|
|
1650
1679
|
export declare function updateCollection(_id: string | null, collection: UpdateCollection): Promise<UpdateCollectionResponse>;
|
|
1651
1680
|
export interface UpdateCollection {
|
|
@@ -1675,14 +1704,18 @@ export interface UpdateCollection {
|
|
|
1675
1704
|
}
|
|
1676
1705
|
/**
|
|
1677
1706
|
* Deletes a collection.
|
|
1678
|
-
*
|
|
1707
|
+
*
|
|
1708
|
+
* This function is not a universal function and runs only on the backend.
|
|
1679
1709
|
* @public
|
|
1680
1710
|
* @documentationMaturity preview
|
|
1681
1711
|
* @requiredField _id
|
|
1712
|
+
* @param _id - ID of the collection to delete.
|
|
1682
1713
|
*/
|
|
1683
1714
|
export declare function deleteCollection(_id: string): Promise<void>;
|
|
1684
1715
|
/**
|
|
1685
1716
|
* Deletes a product's ribbon.
|
|
1717
|
+
*
|
|
1718
|
+
* This function is not a universal function and runs only on the backend.
|
|
1686
1719
|
* @param _id - Product ID.
|
|
1687
1720
|
* @public
|
|
1688
1721
|
* @documentationMaturity preview
|
|
@@ -1691,28 +1724,31 @@ export declare function deleteCollection(_id: string): Promise<void>;
|
|
|
1691
1724
|
export declare function removeRibbon(_id: string): Promise<void>;
|
|
1692
1725
|
/**
|
|
1693
1726
|
* Updates a specified property for up to 100 products at a time.
|
|
1694
|
-
* @param
|
|
1727
|
+
* @param set - Field to update.
|
|
1695
1728
|
* @public
|
|
1696
|
-
* @
|
|
1697
|
-
* @requiredField ids
|
|
1729
|
+
* @requiredField options
|
|
1730
|
+
* @requiredField options.ids
|
|
1731
|
+
* @requiredField set
|
|
1698
1732
|
*/
|
|
1699
|
-
export declare function bulkUpdateProducts(
|
|
1733
|
+
export declare function bulkUpdateProducts(set: SetValue, options: BulkUpdateProductsOptions): Promise<BulkUpdateProductsResponse>;
|
|
1700
1734
|
export interface BulkUpdateProductsOptions {
|
|
1701
|
-
/**
|
|
1702
|
-
|
|
1735
|
+
/** Product IDs. */
|
|
1736
|
+
ids: string[];
|
|
1703
1737
|
}
|
|
1704
1738
|
/**
|
|
1705
1739
|
* Adjusts a specified numerical property for up to 100 products at a time.
|
|
1706
1740
|
* The property can be increased or decreased either by percentage or amount.
|
|
1707
|
-
* @param
|
|
1741
|
+
* @param adjust - Numerical property to adjust.
|
|
1708
1742
|
* @public
|
|
1709
1743
|
* @documentationMaturity preview
|
|
1710
|
-
* @requiredField
|
|
1744
|
+
* @requiredField adjust
|
|
1745
|
+
* @requiredField options
|
|
1746
|
+
* @requiredField options.ids
|
|
1711
1747
|
*/
|
|
1712
|
-
export declare function
|
|
1713
|
-
export interface
|
|
1714
|
-
/**
|
|
1715
|
-
|
|
1748
|
+
export declare function bulkAdjustProductProperty(adjust: AdjustValue, options: BulkAdjustProductPropertyOptions): Promise<BulkAdjustProductPropertiesResponse>;
|
|
1749
|
+
export interface BulkAdjustProductPropertyOptions {
|
|
1750
|
+
/** Product IDs. */
|
|
1751
|
+
ids: string[];
|
|
1716
1752
|
}
|
|
1717
1753
|
/**
|
|
1718
1754
|
* Returns a list of up to 100 products, given the provided paging, sorting and filtering.
|
|
@@ -1830,14 +1866,13 @@ export interface QueryCollectionsOptions {
|
|
|
1830
1866
|
* Retrieves a collection with the provided ID.
|
|
1831
1867
|
* @param _id - Requested collection ID.
|
|
1832
1868
|
* @public
|
|
1833
|
-
* @documentationMaturity preview
|
|
1834
1869
|
* @requiredField _id
|
|
1835
1870
|
*/
|
|
1836
1871
|
export declare function getCollection(_id: string, options?: GetCollectionOptions): Promise<GetCollectionResponse>;
|
|
1837
1872
|
export interface GetCollectionOptions {
|
|
1838
1873
|
/**
|
|
1839
1874
|
* Whether to return the `collection.numberOfProducts` field in the response.
|
|
1840
|
-
* Defaults to false
|
|
1875
|
+
* Defaults to `false`, in which case the value of `collection.numberOfProducts` will be `0`.
|
|
1841
1876
|
*/
|
|
1842
1877
|
includeNumberOfProducts?: boolean;
|
|
1843
1878
|
}
|
|
@@ -1845,22 +1880,18 @@ export interface GetCollectionOptions {
|
|
|
1845
1880
|
* Retrieves a collection with the provided slug.
|
|
1846
1881
|
* @param slug - Slug of the collection to retrieve.
|
|
1847
1882
|
* @public
|
|
1848
|
-
* @documentationMaturity preview
|
|
1849
1883
|
* @requiredField slug
|
|
1850
1884
|
*/
|
|
1851
1885
|
export declare function getCollectionBySlug(slug: string): Promise<GetCollectionBySlugResponse>;
|
|
1852
1886
|
/**
|
|
1853
1887
|
* Gets the availability of relevant product variants based on the product ID and selections provided. See [Use Cases](https://dev.wix.com/api/rest/wix-stores/catalog/use-cases) for an example.
|
|
1854
1888
|
* @param _id - Requested product ID.
|
|
1889
|
+
* @param options - Set of key-value pairs. Array containing the selected options (e.g, color: Blue, size: Large).
|
|
1855
1890
|
* @public
|
|
1856
|
-
* @documentationMaturity preview
|
|
1857
1891
|
* @requiredField _id
|
|
1892
|
+
* @requiredField options
|
|
1858
1893
|
*/
|
|
1859
|
-
export declare function getProductOptionsAvailability(_id: string, options
|
|
1860
|
-
export interface GetProductOptionsAvailabilityOptions {
|
|
1861
|
-
/** Array containing the selected options (e.g, color: Blue, size: Large). */
|
|
1862
|
-
options?: Record<string, string>;
|
|
1863
|
-
}
|
|
1894
|
+
export declare function getProductOptionsAvailability(_id: string, options: Record<string, string>): Promise<ProductOptionsAvailabilityResponse>;
|
|
1864
1895
|
/**
|
|
1865
1896
|
* Retrieves product variants, based on either choices (option-choice key-value pairs) or variant IDs.
|
|
1866
1897
|
* See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.
|
|
@@ -1884,14 +1915,12 @@ export interface QueryProductVariantsOptions {
|
|
|
1884
1915
|
}
|
|
1885
1916
|
/**
|
|
1886
1917
|
* Retrieves up to 100 store variants, given the provided paging, filtering, and sorting.
|
|
1918
|
+
* @param query - Query options.
|
|
1887
1919
|
* @public
|
|
1888
1920
|
* @documentationMaturity preview
|
|
1921
|
+
* @requiredField query
|
|
1889
1922
|
*/
|
|
1890
|
-
export declare function queryStoreVariants(
|
|
1891
|
-
export interface QueryStoreVariantsOptions {
|
|
1892
|
-
/** Query options. */
|
|
1893
|
-
query?: PlatformQuery;
|
|
1894
|
-
}
|
|
1923
|
+
export declare function queryStoreVariants(query: PlatformQuery): Promise<QueryStoreVariantsResponse>;
|
|
1895
1924
|
/**
|
|
1896
1925
|
* Retrieves a store variant with the provided ID.
|
|
1897
1926
|
* @param _id - Store variant ID. Comprised of the `productId` and the `variantId`, separated by a hyphen. For example, `{productId}-{variantId}`.
|