@wix/agent-skills 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/LICENSE +21 -0
- package/README.md +111 -0
- package/package.json +29 -0
- package/skills/wix-app/SKILL.md +344 -0
- package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
- package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
- package/skills/wix-app/references/APP_VALIDATION.md +171 -0
- package/skills/wix-app/references/BACKEND_API.md +233 -0
- package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
- package/skills/wix-app/references/CODE_QUALITY.md +33 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
- package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
- package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
- package/skills/wix-app/references/DOCUMENTATION.md +42 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
- package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
- package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
- package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
- package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
- package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
- package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
- package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
- package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
- package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
- package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
- package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
- package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
- package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
- package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
- package/skills/wix-design-system/SKILL.md +129 -0
- package/skills/wix-design-system/references/file-structure.md +56 -0
- package/skills/wix-design-system/scripts/wds.cjs +531 -0
- package/skills/wix-headless/SKILL.md +418 -0
- package/skills/wix-headless/references/DISCOVERY.md +332 -0
- package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
- package/skills/wix-headless/references/SETUP.md +154 -0
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
- package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
- package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
- package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
- package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
- package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
- package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
- package/skills/wix-headless/references/commands/install-app.md +42 -0
- package/skills/wix-headless/references/commands/known-apps.json +5 -0
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
- package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
- package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
- package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
- package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
- package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
- package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
- package/skills/wix-headless/references/shared/STYLING.md +117 -0
- package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
- package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
- package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
- package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
- package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
- package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
- package/skills/wix-headless/references/verticals/_schema.json +160 -0
- package/skills/wix-headless/references/verticals/_schema.md +185 -0
- package/skills/wix-headless/references/verticals/blog.md +125 -0
- package/skills/wix-headless/references/verticals/cms.md +121 -0
- package/skills/wix-headless/references/verticals/ecom.md +96 -0
- package/skills/wix-headless/references/verticals/forms.md +106 -0
- package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
- package/skills/wix-headless/references/verticals/stores.md +167 -0
- package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
- package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
- package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
- package/skills/wix-headless/scripts/preview.sh +45 -0
- package/skills/wix-headless/scripts/release.sh +73 -0
- package/skills/wix-headless/scripts/scaffold.sh +53 -0
- package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
- package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
- package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
- package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
- package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
- package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
- package/skills/wix-headless/templates/ecom/cart.astro +13 -0
- package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
- package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
- package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
- package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
- package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
- package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
- package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
- package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
- package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
- package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
- package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
- package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
- package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
- package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
- package/skills/wix-headless/templates/stores/categories.ts +155 -0
- package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
- package/skills/wix-headless/templates/stores/components-stores.css +295 -0
- package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
- package/skills/wix-headless/templates/stores/products/index.astro +101 -0
- package/skills/wix-manage/SKILL.md +280 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
- package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
- package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
- package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
- package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
- package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
- package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
- package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
- package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
- package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
- package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
- package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
- package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
- package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
- package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
- package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
- package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
- package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
- package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
- package/skills/wix-manage/references/events/list-events.md +203 -0
- package/skills/wix-manage/references/forms/create-form.md +260 -0
- package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
- package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
- package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
- package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
- package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
- package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
- package/skills/wix-manage/references/sites/query-sites.md +125 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
- package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
- package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Find Products (Query and Search, Catalog V3)"
|
|
3
|
+
description: Find, search, query, and list products from a Wix Store using Catalog V3 Search Products and Query Products endpoints. Explains when to use each endpoint, correct fields enum values, filtering, sorting, and paging.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# RECIPE: Business Recipe – Find Products in a Wix Store (Query and Search, Catalog V3)
|
|
7
|
+
|
|
8
|
+
Find products in a Wix store using the Catalog V3 Search Products and Query Products APIs.
|
|
9
|
+
|
|
10
|
+
## Article: How to Find Products
|
|
11
|
+
|
|
12
|
+
### STEP 0: Choose the right product lookup method
|
|
13
|
+
|
|
14
|
+
Use **Search Products** for text search and name-based lookup. Use **Query Products** for structured filtering, sorting, paging, and listing products.
|
|
15
|
+
|
|
16
|
+
| Need | Endpoint | Notes |
|
|
17
|
+
| ---- | -------- | ----- |
|
|
18
|
+
| Find products by name or free text | [Search Products](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/search-products) | Best for user-provided names, keywords, and broad product lookup. |
|
|
19
|
+
| List all products or page through the catalog | [Query Products](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products) | Supports paging and structured filters on the fields listed below. |
|
|
20
|
+
| Filter by `id`, `slug`, `handle`, dates, or `visible` | [Query Products](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products) | Best for exact structured criteria. |
|
|
21
|
+
| Need exact name matching after text lookup | [Search Products](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/search-products) + client-side match | Search by the name text, then match the returned `product.name` in your own code. |
|
|
22
|
+
|
|
23
|
+
### STEP 1: Search products by name or free text
|
|
24
|
+
|
|
25
|
+
Use Search Products when the user gives a product name, keyword, or other text expression:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
curl -X POST 'https://www.wixapis.com/stores/v3/products/search' \
|
|
29
|
+
-H 'Content-Type: application/json' \
|
|
30
|
+
-H 'Authorization: <AUTH>' \
|
|
31
|
+
-d '{
|
|
32
|
+
"search": {
|
|
33
|
+
"expression": "Blue Shirt"
|
|
34
|
+
}
|
|
35
|
+
}'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For exact name matching, search with the user-provided text and then compare the returned `product.name` values in your own code.
|
|
39
|
+
|
|
40
|
+
### STEP 2: Query products with structured filters, sorting, or paging
|
|
41
|
+
|
|
42
|
+
Use the **POST** [Query Products](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products) endpoint to query products. The endpoint returns up to 100 products per request.
|
|
43
|
+
|
|
44
|
+
**Endpoint:** `POST https://www.wixapis.com/stores/v3/products/query`
|
|
45
|
+
|
|
46
|
+
**Basic query (all products, default fields):**
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
curl -X POST 'https://www.wixapis.com/stores/v3/products/query' \
|
|
50
|
+
-H 'Content-Type: application/json' \
|
|
51
|
+
-H 'Authorization: <AUTH>' \
|
|
52
|
+
-d '{
|
|
53
|
+
"query": {}
|
|
54
|
+
}'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This returns all products with their default fields (id, name, slug, visible, productType, priceData, stock, media, etc.).
|
|
58
|
+
|
|
59
|
+
### STEP 3: Understanding the `fields` parameter
|
|
60
|
+
|
|
61
|
+
The `fields` array requests **additional** fields beyond the defaults. It does **NOT** accept property names like `"name"` or `"id"`.
|
|
62
|
+
|
|
63
|
+
**⚠️ CRITICAL: Valid `fields` enum values:**
|
|
64
|
+
|
|
65
|
+
| Enum Value | Description |
|
|
66
|
+
| ---------------------------------- | ---------------------------- |
|
|
67
|
+
| `URL` | Product page URL |
|
|
68
|
+
| `CURRENCY` | Currency information |
|
|
69
|
+
| `INFO_SECTION` | Info sections (rich content) |
|
|
70
|
+
| `MERCHANT_DATA` | Merchant-specific data |
|
|
71
|
+
| `PLAIN_DESCRIPTION` | Plain text description |
|
|
72
|
+
| `INFO_SECTION_PLAIN_DESCRIPTION` | Info section plain text |
|
|
73
|
+
| `SUBSCRIPTION_PRICES_INFO` | Subscription pricing |
|
|
74
|
+
| `BREADCRUMBS_INFO` | Category breadcrumbs |
|
|
75
|
+
| `WEIGHT_MEASUREMENT_UNIT_INFO` | Weight unit info |
|
|
76
|
+
| `VARIANT_OPTION_CHOICE_NAMES` | Variant option choice names |
|
|
77
|
+
| `MEDIA_ITEMS_INFO` | Additional media items |
|
|
78
|
+
| `DESCRIPTION` | Rich text description |
|
|
79
|
+
| `DIRECT_CATEGORIES_INFO` | Direct category info |
|
|
80
|
+
| `ALL_CATEGORIES_INFO` | All category info |
|
|
81
|
+
| `MIN_VARIANT_PRICE_INFO` | Minimum variant price |
|
|
82
|
+
| `INFO_SECTION_DESCRIPTION` | Info section rich content |
|
|
83
|
+
| `THUMBNAIL` | Thumbnail image |
|
|
84
|
+
| `DIRECT_CATEGORY_IDS` | Direct category IDs |
|
|
85
|
+
| `PRODUCT_CHOICES_MEDIA_REFERENCES` | Choice-specific media |
|
|
86
|
+
|
|
87
|
+
**WRONG – these are NOT valid field values:**
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
"fields": ["id", "name", "slug", "visible", "priceData"]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**CORRECT – use enum constants or leave empty for defaults:**
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
"fields": []
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**CORRECT – requesting additional fields:**
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
"fields": ["DESCRIPTION", "URL", "ALL_CATEGORIES_INFO"]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### STEP 4: Filtering and sorting with Query Products
|
|
106
|
+
|
|
107
|
+
`QueryProducts` supports filters only on these fields:
|
|
108
|
+
|
|
109
|
+
| Field | Supported Filters | Sortable |
|
|
110
|
+
| ----- | ----------------- | -------- |
|
|
111
|
+
| `id` | `$eq`, `$ne`, `$exists`, `$in`, `$startsWith` | No |
|
|
112
|
+
| `handle` | `$eq`, `$ne`, `$exists`, `$in`, `$startsWith` | No |
|
|
113
|
+
| `options.id` | `$isEmpty`, `$hasAll`, `$hasSome` | No |
|
|
114
|
+
| `slug` | `$eq`, `$ne`, `$exists`, `$in`, `$startsWith` | Yes |
|
|
115
|
+
| `createdDate` | `$eq`, `$ne`, `$exists`, `$in`, `$lt`, `$lte`, `$gt`, `$gte` | Yes |
|
|
116
|
+
| `updatedDate` | `$eq`, `$ne`, `$exists`, `$in`, `$lt`, `$lte`, `$gt`, `$gte` | Yes |
|
|
117
|
+
| `visible` | `$eq`, `$ne`, `$exists`, `$in` | Yes |
|
|
118
|
+
|
|
119
|
+
**Query with filter and sort:**
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
curl -X POST 'https://www.wixapis.com/stores/v3/products/query' \
|
|
123
|
+
-H 'Content-Type: application/json' \
|
|
124
|
+
-H 'Authorization: <AUTH>' \
|
|
125
|
+
-d '{
|
|
126
|
+
"fields": [],
|
|
127
|
+
"query": {
|
|
128
|
+
"filter": {
|
|
129
|
+
"visible": true
|
|
130
|
+
},
|
|
131
|
+
"sort": [
|
|
132
|
+
{
|
|
133
|
+
"field_name": "createdDate",
|
|
134
|
+
"order": "ASC"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"paging": {
|
|
138
|
+
"limit": 50,
|
|
139
|
+
"offset": 0
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Filter by product IDs:**
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
curl -X POST 'https://www.wixapis.com/stores/v3/products/query' \
|
|
149
|
+
-H 'Content-Type: application/json' \
|
|
150
|
+
-H 'Authorization: <AUTH>' \
|
|
151
|
+
-d '{
|
|
152
|
+
"fields": [],
|
|
153
|
+
"query": {
|
|
154
|
+
"filter": {
|
|
155
|
+
"id": {
|
|
156
|
+
"$in": [
|
|
157
|
+
"product-id-1",
|
|
158
|
+
"product-id-2"
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}'
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### STEP 5: Handling pagination
|
|
167
|
+
|
|
168
|
+
When there are more products than the page limit, use cursor-based or offset-based paging:
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"query": {
|
|
173
|
+
"paging": {
|
|
174
|
+
"limit": 100,
|
|
175
|
+
"offset": 0
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Check the response `pagingMetadata` to determine if more pages exist.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Important Notes
|
|
186
|
+
|
|
187
|
+
- **Variant data is NOT returned** by Query Products. To get variant details, use [Get Product](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/get-product) for individual products.
|
|
188
|
+
- **Non-visible products** require the `SCOPE.STORES.PRODUCT_READ_ADMIN` permission.
|
|
189
|
+
- Default fields include: `id`, `name`, `slug`, `visible`, `productType`, `priceData`, `stock`, `media`, `createdDate`, `updatedDate`.
|
|
190
|
+
- The `fields` parameter adds fields **on top of** the defaults — you never need to request `id` or `name` explicitly.
|
|
191
|
+
|
|
192
|
+
## Conclusion
|
|
193
|
+
|
|
194
|
+
To find products by name or free text, use `POST https://www.wixapis.com/stores/v3/products/search`. To list, page, sort, or structurally filter products, use `POST https://www.wixapis.com/stores/v3/products/query`. Use `fields: []` for defaults, or pass valid enum values like `DESCRIPTION`, `URL`, `ALL_CATEGORIES_INFO` for additional data. Never pass property names as field values.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Query Products (Catalog V1)"
|
|
3
|
+
description: Query and list products from a Wix Store using the Catalog V1 Query Products endpoint. Use this recipe when the site's catalog version is CATALOG_V1. Covers basic queries, filtering, sorting, and paging.
|
|
4
|
+
---
|
|
5
|
+
# RECIPE: Business Recipe - Query Products (Catalog V1)
|
|
6
|
+
|
|
7
|
+
## STEP 1: Query Products
|
|
8
|
+
|
|
9
|
+
Use `POST https://www.wixapis.com/stores-reader/v1/products/query` to query products from a V1 store.
|
|
10
|
+
|
|
11
|
+
**Basic query (all products):**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
curl -X POST 'https://www.wixapis.com/stores-reader/v1/products/query' \
|
|
15
|
+
-H 'Content-Type: application/json' \
|
|
16
|
+
-H 'Authorization: <AUTH>' \
|
|
17
|
+
-d '{
|
|
18
|
+
"query": {}
|
|
19
|
+
}'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## STEP 2: Filtering and Sorting
|
|
25
|
+
|
|
26
|
+
> **CRITICAL:** In V1, `filter` and `sort` are **JSON-encoded strings**, not objects — unlike V3 where they are plain objects.
|
|
27
|
+
|
|
28
|
+
**Query with filter and sort:**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -X POST 'https://www.wixapis.com/stores-reader/v1/products/query' \
|
|
32
|
+
-H 'Content-Type: application/json' \
|
|
33
|
+
-H 'Authorization: <AUTH>' \
|
|
34
|
+
-d '{
|
|
35
|
+
"query": {
|
|
36
|
+
"filter": "{\"visible\": true}",
|
|
37
|
+
"sort": "[{\"fieldName\": \"name\", \"order\": \"ASC\"}]",
|
|
38
|
+
"paging": {
|
|
39
|
+
"limit": 50,
|
|
40
|
+
"offset": 0
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Query by product IDs:**
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
curl -X POST 'https://www.wixapis.com/stores-reader/v1/products/query' \
|
|
50
|
+
-H 'Content-Type: application/json' \
|
|
51
|
+
-H 'Authorization: <AUTH>' \
|
|
52
|
+
-d '{
|
|
53
|
+
"query": {
|
|
54
|
+
"filter": "{\"id\": {\"$in\": [\"product-id-1\", \"product-id-2\"]}}"
|
|
55
|
+
}
|
|
56
|
+
}'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Key Differences from V3
|
|
62
|
+
|
|
63
|
+
| Feature | Catalog V1 | Catalog V3 |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| Query endpoint | `POST /stores-reader/v1/products/query` | `POST /stores/v3/products/query` |
|
|
66
|
+
| Filter/sort | JSON-encoded strings | Plain objects |
|
|
67
|
+
| Additional fields | Not applicable | Enum values like `DESCRIPTION`, `URL` |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Important Notes
|
|
72
|
+
|
|
73
|
+
- **Never use `/stores/v3/` endpoints on a CATALOG_V1 site** — they return `428 Precondition Required`.
|
|
74
|
+
- Check the site's catalog version in dynamic context before choosing endpoints.
|
|
75
|
+
- To create products on a V1 site, see [Create Product (Catalog V1)](create-product-catalog-v1.md).
|
|
76
|
+
|
|
77
|
+
## References
|
|
78
|
+
|
|
79
|
+
- [V1 Query Products](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/query-products)
|
|
80
|
+
- [Catalog Versioning Overview](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction)
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Setup Online Store (Catalog V3)"
|
|
3
|
+
description: Initializes a Stores catalog with Catalog V3 Products API, bulk products endpoint, and Categories API. Covers product creation, option configuration, variant management, and category assignment.
|
|
4
|
+
---
|
|
5
|
+
**RECIPE**: Business Recipe – Initial Setup for a Wix Online Store (Catalog V3)
|
|
6
|
+
|
|
7
|
+
A concise checklist for preparing any new Wix site that uses the Online Stores app with Catalog V3.
|
|
8
|
+
**Notice** that this recipe is **NOT** meant for coding purposes and is **ONLY** meant for initial catalog setup.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Article: Steps for Setting Up a Wix Online Store
|
|
13
|
+
**YOU MUST** Complete all the following steps **in the given order** (1 -5) without skipping any and **without requiring additional user input**.
|
|
14
|
+
**YOU MUST** remind yourself as many times as needed throughout the process that you most complete all the steps and not stop at all in the middle.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
**⚠️ CRITICAL ORDER REQUIREMENT: You MUST start with creating products FIRST (Steps 1-2), then categories (Steps 3-5). Categories API might take some time to be fully available after Stores installation, so always create products before attempting category operations.**
|
|
18
|
+
|
|
19
|
+
### STEP 1: Confirm Catalog V3 & Stick to V3 APIs
|
|
20
|
+
|
|
21
|
+
- **Check if the site uses Catalog V3.**
|
|
22
|
+
This can be done using the [Get Catalog Version](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/get-catalog-version) endpoint.
|
|
23
|
+
path: `https://www.wixapis.com/stores/v3/provision/version`
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
- From this point forward, as long as the result is V3, use only Catalog V3 REST endpoints.
|
|
27
|
+
All API calls should be directed to endpoints starting with `/stores/v3/....` Do not mix V3 calls with earlier versions.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
- Exception for Categories:
|
|
31
|
+
The Categories API is an exception. It uses a v1 endpoint, as it replaces the older Collections API. For example, to create a category in V3, use the following endpoint:
|
|
32
|
+
`https://www.wixapis.com/categories/v1/categories`
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### STEP 2: Create 5 new products based on the format specified in the Bulk Create Products with Options recipe (4 in stock, 1 out of stock)
|
|
36
|
+
1. First *YOU MUST* pull up the [Bulk Create Wix Store Products with Options](bulk-create-products-with-options.md) recipe to understand the exact format required for creating products.
|
|
37
|
+
2. Create 5 products according to this format using bulk creation (use a single bulk request). 4 of the created products **MUST** have ALL there variants in-stock, and the last (5th) product **MUST** have all its variants be out-of-stock.
|
|
38
|
+
3. **Make sure** to add in image (using media) using a url from the web that matches each product.
|
|
39
|
+
4. **YOU MUST** use the price formatting as seen in the example, meaning using actualPrice and compareAtPrice.
|
|
40
|
+
5. **ALL** products **MUST** be created **EXACTLY** from the same format as the full example in the Bulk Create Wix Store Products with Options recipe. **ONLY** information within the strings of the given fields may differ based on the products.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
**⚠️ CRITICAL: EXACT FORMAT REQUIREMENTS**
|
|
44
|
+
**YOU MUST** use the following recipe to create ALL products with the EXACT same format:
|
|
45
|
+
- **Bulk Create Wix Store Products with Options**
|
|
46
|
+
[Recipe: Bulk Create Products with Options](bulk-create-products-with-options.md)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### STEP 3: Prepare Three Store Categories
|
|
50
|
+
1. Determine how many categories the user requested.
|
|
51
|
+
2. If fewer than **3** are provided, create additional categories until the total equals **3** which are relevant for the type of store.
|
|
52
|
+
3. Examples for different types of stores:
|
|
53
|
+
- **Book store** → Drama, Kids, Sci-Fi
|
|
54
|
+
- **Fashion** → Men, Women, Kids
|
|
55
|
+
- **Other industries** → any logical grouping that fits the catalog.
|
|
56
|
+
4. Use the Categories API to create each category. **YOU MUST USE** the endpoint: [Create Category](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/create-category) based on the example below.
|
|
57
|
+
**⚠️ CRITICAL: Use correct endpoint `/categories/v1/bulk/categories/{categoryId}/add-items` with `catalogItemId`, `appId: "215238eb-22a5-4c36-9e7b-e7c08025e04e"`, and `treeReference` object.**
|
|
58
|
+
When calling the endpoint, make sure the request body includes a top-level `treeReference` field. It must **not** be nested inside the `category` object.
|
|
59
|
+
|
|
60
|
+
Use the following example format:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"category": {
|
|
65
|
+
"name": "Drinkware",
|
|
66
|
+
"description": "The Drinkware category includes a wide range of containers designed for holding beverages",
|
|
67
|
+
"visible": true
|
|
68
|
+
},
|
|
69
|
+
"treeReference": {
|
|
70
|
+
"appNamespace": "@wix/stores",
|
|
71
|
+
"treeKey": null
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### STEP 4: Add Each Product to a Category
|
|
78
|
+
1. **YOU MUST** add each existing product to at least one category that most makes sense.
|
|
79
|
+
2. First acquire the product's ids to use for this action.
|
|
80
|
+
3. Then adding a product to a category **MUST** be done using the Category API, specifically [Bulk Add Items To Category](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/bulk-add-items-to-category), where products are referred to as items. This endpoint enables adding multiple products at once to a category.
|
|
81
|
+
|
|
82
|
+
**⚠️ CRITICAL: Use correct endpoint `/categories/v1/bulk/categories/{categoryId}/add-items` with `catalogItemId`, `appId: "215238eb-22a5-4c36-9e7b-e7c08025e04e"`, and `treeReference` object.**
|
|
83
|
+
**Make Sure** you pass the treeReference correctly at the same level as "items".
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### STEP 5: Ensure Each Product was Added to a Category
|
|
87
|
+
1. **YOU MUST** ensure that each product is connected to at least one category.
|
|
88
|
+
2. **You MUST** do this by using the [List Items In Category](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/list-items-in-category) for EVERY Category (for example: 3 required api calls for 3 categories). If the list of items is empty, it means that the product was not added to that category and **YOU MUST** repeat step 4.
|
|
89
|
+
The path for this endpoint in REST is: `https://www.wixapis.com/categories/v1/categories/{categoryId}/list-items`
|
|
90
|
+
3. When calling the endpoint, make sure the request body includes a top-level `treeReference` field. It must **not** be nested inside the `category` object.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Conclusion
|
|
95
|
+
Following these steps **in order** guarantees the creation flow for new V3 Wix Online Store sites:
|
|
96
|
+
- Contains exactly **3** categories
|
|
97
|
+
- Contains exactly **5** products (unless the user explicitly requests fewer)
|
|
98
|
+
- Each product is connected to at least one category.
|
|
99
|
+
- All products follow the correct Catalog V3 API format as specified in the referenced recipe.
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Update Product Pre-Order (Catalog V3)"
|
|
3
|
+
description: Manages pre-order settings for product variants using V3 Inventory API. Covers enabling/disabling pre-orders, setting messages, configuring limits, and handling trackQuantity requirements.
|
|
4
|
+
---
|
|
5
|
+
# Update Product Pre-Order Information (Catalog V3)
|
|
6
|
+
|
|
7
|
+
This recipe outlines the steps to manage pre-orders for product variants, including enabling/disabling pre-orders, setting messages, and configuring limits.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- Wix Stores app installed
|
|
12
|
+
- Product with variants already created
|
|
13
|
+
- API access with stores permissions
|
|
14
|
+
|
|
15
|
+
## Required APIs
|
|
16
|
+
|
|
17
|
+
- **Products Search API**: [REST](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/search-products)
|
|
18
|
+
- **Query Inventory Items API**: [REST](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/inventory-items-v3/query-inventory-items)
|
|
19
|
+
- **Bulk Update Inventory Items API**: [REST](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/inventory-items-v3/bulk-update-inventory-items)
|
|
20
|
+
- **Update Inventory Item API**: [REST](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/inventory-items-v3/update-inventory-item)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 1: Find the Product and Get Variant Information
|
|
25
|
+
|
|
26
|
+
### 1.1 Search for the Product
|
|
27
|
+
|
|
28
|
+
**Endpoint**: `POST https://www.wixapis.com/stores/v3/products/search`
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"search": {
|
|
33
|
+
"expression": "Product Name"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 1.2 Query Inventory Items for Variant Details
|
|
39
|
+
|
|
40
|
+
Use the `productId` from the search to get variant information:
|
|
41
|
+
|
|
42
|
+
**Endpoint**: `POST https://www.wixapis.com/stores/v3/inventory-items/query`
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"query": {
|
|
47
|
+
"filter": {
|
|
48
|
+
"productId": {
|
|
49
|
+
"$in": ["<PRODUCT_ID>"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The response includes:
|
|
57
|
+
- `product.variantName` - identifies each variant
|
|
58
|
+
- `inventoryItemId` - needed for updates
|
|
59
|
+
- `revision` - required for update operations
|
|
60
|
+
- `locationId` - inventory location
|
|
61
|
+
- Current `preorderInfo` settings
|
|
62
|
+
|
|
63
|
+
### IMPORTANT NOTES:
|
|
64
|
+
- I MUST get user input on which specific variant(s) to update
|
|
65
|
+
- I MUST NEVER update all variants without explicit user selection
|
|
66
|
+
- I MUST ask the user whether to enable or disable pre-orders for each variant
|
|
67
|
+
- If enabling, I MUST get the pre-order message from the user
|
|
68
|
+
- If setting a pre-order limit, I MUST ensure `trackQuantity: true` is set
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Step 2: Update Pre-Order Information
|
|
73
|
+
|
|
74
|
+
### Method A: Bulk Update (PREFERRED for multiple variants)
|
|
75
|
+
|
|
76
|
+
Use when applying the same pre-order settings to multiple variants:
|
|
77
|
+
|
|
78
|
+
**Endpoint**: `POST https://www.wixapis.com/stores/v3/bulk/inventory-items/update`
|
|
79
|
+
|
|
80
|
+
**Request Body (Enable Pre-Order)**:
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"inventoryItems": [
|
|
84
|
+
{
|
|
85
|
+
"inventoryItem": {
|
|
86
|
+
"id": "<inventoryItemId_variant1>",
|
|
87
|
+
"revision": "<revision_as_integer>",
|
|
88
|
+
"preorderInfo": {
|
|
89
|
+
"enabled": true,
|
|
90
|
+
"message": "Available for pre-order! Ships in 2 weeks."
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"inventoryItem": {
|
|
96
|
+
"id": "<inventoryItemId_variant2>",
|
|
97
|
+
"revision": "<revision_as_integer>",
|
|
98
|
+
"preorderInfo": {
|
|
99
|
+
"enabled": true,
|
|
100
|
+
"message": "Available for pre-order! Ships in 2 weeks."
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"returnEntity": true,
|
|
106
|
+
"reason": "MANUAL"
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Request Body (With Pre-Order Limit)**:
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"inventoryItems": [
|
|
114
|
+
{
|
|
115
|
+
"inventoryItem": {
|
|
116
|
+
"id": "<inventoryItemId>",
|
|
117
|
+
"revision": "<revision_as_integer>",
|
|
118
|
+
"trackQuantity": true,
|
|
119
|
+
"quantity": 100,
|
|
120
|
+
"preorderInfo": {
|
|
121
|
+
"enabled": true,
|
|
122
|
+
"message": "Pre-order now!",
|
|
123
|
+
"limit": 50
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"returnEntity": true,
|
|
129
|
+
"reason": "MANUAL"
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### IMPORTANT NOTES:
|
|
134
|
+
- Pre-order limits ONLY work when `trackQuantity: true`
|
|
135
|
+
- If variant wasn't tracking quantity, I MUST ask user for initial quantity
|
|
136
|
+
- The `revision` field is required and must be an integer
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### Method B: Individual Update (Single variant or unique settings)
|
|
141
|
+
|
|
142
|
+
**Endpoint**: `PATCH https://www.wixapis.com/stores/v3/inventory-items/{inventoryItemId}`
|
|
143
|
+
|
|
144
|
+
**Request Body (Enable Pre-Order)**:
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"inventoryItem": {
|
|
148
|
+
"id": "<inventoryItemId>",
|
|
149
|
+
"revision": "<revision_as_integer>",
|
|
150
|
+
"preorderInfo": {
|
|
151
|
+
"enabled": true,
|
|
152
|
+
"message": "Coming soon! Pre-order today."
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"reason": "MANUAL"
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Request Body (Disable Pre-Order)**:
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"inventoryItem": {
|
|
163
|
+
"id": "<inventoryItemId>",
|
|
164
|
+
"revision": "<revision_as_integer>",
|
|
165
|
+
"preorderInfo": {
|
|
166
|
+
"enabled": false,
|
|
167
|
+
"limit": null
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"reason": "MANUAL"
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Pre-Order Limit Behavior
|
|
177
|
+
|
|
178
|
+
When you set a `preorderInfo.limit`:
|
|
179
|
+
- It specifies how many units can be pre-ordered **after stock reaches zero**
|
|
180
|
+
- Example: 10 in stock + limit of 50 = customers can order up to 60 total (10 regular + 50 pre-order)
|
|
181
|
+
|
|
182
|
+
### CRITICAL: Enabling Quantity Tracking
|
|
183
|
+
|
|
184
|
+
If setting a limit on a variant that wasn't tracking quantity:
|
|
185
|
+
|
|
186
|
+
1. **Inform the user**: "`trackQuantity` will be enabled for this variant"
|
|
187
|
+
2. **Ask for initial quantity**: "What initial stock quantity should I set?"
|
|
188
|
+
3. **Include both in update**:
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"inventoryItem": {
|
|
192
|
+
"id": "<inventoryItemId>",
|
|
193
|
+
"revision": "<revision_as_integer>",
|
|
194
|
+
"trackQuantity": true,
|
|
195
|
+
"quantity": "<USER_PROVIDED_QUANTITY>",
|
|
196
|
+
"preorderInfo": {
|
|
197
|
+
"enabled": true,
|
|
198
|
+
"message": "Pre-order message",
|
|
199
|
+
"limit": 50
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"reason": "MANUAL"
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Next Steps
|
|
209
|
+
|
|
210
|
+
After updating pre-order settings:
|
|
211
|
+
- Confirm the changes with the user
|
|
212
|
+
- Offer to update other products or variants
|
|
213
|
+
- Consider updating product descriptions to mention pre-order availability
|