@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,582 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Recommend: eCommerce Strategy"
|
|
3
|
+
description: Unified eCommerce recommendation skill — analyzes site data across ALL domains (discounts, shipping, and future domains) and generates up to 5 actionable recommendations. Single entry point for any "help my business" request. Tracking is built-in.
|
|
4
|
+
layer: R
|
|
5
|
+
references:
|
|
6
|
+
- name: "API: Recommendation Tracking"
|
|
7
|
+
path: ecommerce/api-recommendation-tracking.md
|
|
8
|
+
load: false
|
|
9
|
+
- name: "Goal: Increase AOV"
|
|
10
|
+
path: ecommerce/goal-increase-aov.md
|
|
11
|
+
load: false
|
|
12
|
+
- name: "Goal: Clear Inventory"
|
|
13
|
+
path: ecommerce/goal-clear-inventory.md
|
|
14
|
+
load: false
|
|
15
|
+
- name: "Goal: Seasonal Revenue"
|
|
16
|
+
path: ecommerce/goal-seasonal-revenue.md
|
|
17
|
+
load: false
|
|
18
|
+
- name: "Goal: Drive Cross-Sells"
|
|
19
|
+
path: ecommerce/goal-drive-cross-sells.md
|
|
20
|
+
load: false
|
|
21
|
+
- name: "Goal: Reduce Cart Abandonment"
|
|
22
|
+
path: ecommerce/goal-reduce-cart-abandonment.md
|
|
23
|
+
load: false
|
|
24
|
+
- name: "Setup: Coupons"
|
|
25
|
+
path: ecommerce/setup-coupons.md
|
|
26
|
+
load: false
|
|
27
|
+
---
|
|
28
|
+
# Recommend: eCommerce Strategy
|
|
29
|
+
|
|
30
|
+
>
|
|
31
|
+
> **After classifying domains in Step 4b**, load the matching goal skill with `ReadFullDocsArticle`:
|
|
32
|
+
> - **SEASONAL** → [Goal: Seasonal Revenue](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-seasonal-revenue)
|
|
33
|
+
> - **UPSELL_BOOST** / **SHIPPING** → [Goal: Increase AOV](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-increase-aov) (includes both discount and shipping flows)
|
|
34
|
+
> - **STOCK_MOVER** → [Goal: Clear Inventory](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-clear-inventory)
|
|
35
|
+
> - **BUNDLE_AND_SAVE** → [Goal: Drive Cross-Sells](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-drive-cross-sells)
|
|
36
|
+
> - **ABANDONED_CART** → [Goal: Reduce Cart Abandonment](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-reduce-cart-abandonment)
|
|
37
|
+
>
|
|
38
|
+
> **If COUPON mechanism in Step 4c**, load:
|
|
39
|
+
> - [Setup: Coupons](https://dev.wix.com/docs/api-reference/business-solutions/coupons/skills/setup-coupons)
|
|
40
|
+
|
|
41
|
+
## EXECUTION RULES — READ BEFORE ANYTHING ELSE
|
|
42
|
+
|
|
43
|
+
**You are an operator, not a consultant.** When this recipe is activated:
|
|
44
|
+
|
|
45
|
+
1. **Do NOT ask clarifying questions — start executing immediately from Step 1.** The merchant's request contains enough information. The analysis steps will determine which domains and strategies apply.
|
|
46
|
+
2. **Do NOT produce recommendations before calling the mandatory APIs.** If you skip the API calls and generate advice from assumptions, your output is wrong — even if it sounds reasonable.
|
|
47
|
+
3. **Execute every step in order.** Do not skip steps. Do not merge steps. Do not answer "in the meantime."
|
|
48
|
+
4. **Use ONLY data returned by API calls.** Never substitute reasoning, general knowledge, or doc summaries for live data. Every number you cite in `reasoning` MUST come directly from an API response — do NOT assume, infer, or fabricate data.
|
|
49
|
+
5. **If a call fails or is blocked, report the exact blocker.** Do not work around it with assumptions.
|
|
50
|
+
6. **All API calls use `CallWixSiteAPI`.** The internal tool names (getSiteData, getCatalogAnalytics, etc.) are NOT directly callable.
|
|
51
|
+
7. **Generate recommendations across ALL relevant domains** — not just discounts. Consider shipping, discounts, and any other domain that the data supports.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Step 1: Resolve the target site
|
|
56
|
+
|
|
57
|
+
**MANDATORY — do this first.**
|
|
58
|
+
|
|
59
|
+
If you don't already have a `siteId`, call `ListWixSites` to find it.
|
|
60
|
+
|
|
61
|
+
If the merchant mentioned a site name, match it. If only one site exists, auto-select it. Store the `siteId` — every subsequent API call requires it.
|
|
62
|
+
|
|
63
|
+
**Do not proceed without a siteId.**
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Step 2: Load recommendation history (Tracking)
|
|
68
|
+
|
|
69
|
+
**MANDATORY — do NOT skip unless the user said `SKIP_TRACKING` or "don't track".**
|
|
70
|
+
|
|
71
|
+
Query the tracking database for existing recommendations on this site:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
CallWixSiteAPI(
|
|
75
|
+
url: "https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/query",
|
|
76
|
+
method: "POST",
|
|
77
|
+
|
|
78
|
+
body: { "query": { "filter": {}, "cursorPaging": { "limit": 50 } } }
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Use the returned history to inform your analysis:**
|
|
83
|
+
|
|
84
|
+
| State | How to use it |
|
|
85
|
+
|---|---|
|
|
86
|
+
| `PROPOSED` | Don't re-propose — ask about the pending one |
|
|
87
|
+
| `DONE` | Don't re-propose — consider complementary recommendations |
|
|
88
|
+
| `REJECTED` | Do NOT re-propose. If `rejectionPermanent` is true, never suggest this action type again |
|
|
89
|
+
| `FAILED` | Offer to retry or suggest alternative |
|
|
90
|
+
| `EXPIRED` | Can re-propose if still relevant with fresh data |
|
|
91
|
+
|
|
92
|
+
If the query returns empty results or fails, continue — this is a fresh session.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Step 3: Gather site data
|
|
97
|
+
|
|
98
|
+
**MANDATORY API CALL — do not skip.**
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
CallWixSiteAPI(
|
|
102
|
+
url: "https://www.wix.com/wix-profile-client/v4/profile/metasite",
|
|
103
|
+
method: "POST",
|
|
104
|
+
|
|
105
|
+
body: {
|
|
106
|
+
"fields": [
|
|
107
|
+
"language",
|
|
108
|
+
"merchant_business_country",
|
|
109
|
+
"success_last_30_days_industry",
|
|
110
|
+
"success_last_30_days_sub_industry",
|
|
111
|
+
"success_last_30_days_distinct_visitors",
|
|
112
|
+
"last_30_days_orders_count",
|
|
113
|
+
"online_gpv_last_30_days",
|
|
114
|
+
"payment_currency"
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Available fields:**
|
|
121
|
+
|
|
122
|
+
| Field ID | Type | Description | Used for |
|
|
123
|
+
|---|---|---|---|
|
|
124
|
+
| `language` | STRING | Wix site language code | Locale-aware recommendations |
|
|
125
|
+
| `merchant_business_country` | STRING | Merchant's business country (ISO alpha-2) | Holiday detection, region analysis, shipping |
|
|
126
|
+
| `success_last_30_days_industry` | STRING | Dominant industry in last 30 days (user growth model) | Domain classification, goal selection |
|
|
127
|
+
| `success_last_30_days_sub_industry` | STRING | Dominant sub-industry in last 30 days | Domain classification |
|
|
128
|
+
| `success_last_30_days_distinct_visitors` | LONG | Distinct visitors in last 30 days (incl. app sessions) | Traffic-based thresholds |
|
|
129
|
+
| `last_30_days_orders_count` | LONG | Order count in last 30 days | AOV calculation, goal selection |
|
|
130
|
+
| `online_gpv_last_30_days` | LONG | Online Gross Payment Volume in last 30 days (site currency units) | Revenue analysis, AOV calculation |
|
|
131
|
+
| `payment_currency` | STRING | Store payment currency code (ISO-4217) | Discount/shipping amount formatting |
|
|
132
|
+
|
|
133
|
+
**Response shape** — each field is a nested object; missing fields = no data for this site:
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"metaSiteId": "<msid>",
|
|
138
|
+
"fields": {
|
|
139
|
+
"language": { "aSingleValue": { "aString": "en-US" } },
|
|
140
|
+
"merchant_business_country": { "aSingleValue": { "aString": "US" } },
|
|
141
|
+
"payment_currency": { "aSingleValue": { "aString": "USD" } },
|
|
142
|
+
"last_30_days_orders_count": { "aSingleValue": { "aLong": "2141" } },
|
|
143
|
+
"online_gpv_last_30_days": { "aSingleValue": { "aLong": "526550" } }
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Extracting values:
|
|
149
|
+
- String: `fields.<name>.aSingleValue.aString`
|
|
150
|
+
- Number: `fields.<name>.aSingleValue.aLong` — **returned as a JSON string, parse to int before arithmetic**
|
|
151
|
+
|
|
152
|
+
**Derived value:** `aov = parseInt(online_gpv_last_30_days) / parseInt(last_30_days_orders_count)` — in `payment_currency` units
|
|
153
|
+
|
|
154
|
+
**Currency rule:** All monetary values (`online_gpv_last_30_days`, `aov`, discount thresholds, shipping amounts) are in the site's `payment_currency`. Never assume USD. Always display and compute amounts using `payment_currency`.
|
|
155
|
+
|
|
156
|
+
**STOP if `merchant_business_country`, `success_last_30_days_industry`, or `online_gpv_last_30_days` are missing or null.** Report: "Cannot generate recommendations — missing required site data: {fields}."
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Step 3b: Validate the request
|
|
161
|
+
|
|
162
|
+
Check if the merchant's request includes anything unsupported. **Reject** these:
|
|
163
|
+
|
|
164
|
+
| Unsupported request | Response |
|
|
165
|
+
|---|---|
|
|
166
|
+
| Buy one get one (BOGO) | Explain: not supported by Discount Rules API |
|
|
167
|
+
| Fixed-price bundles ("3 for $100") | Explain: requires custom pricing logic |
|
|
168
|
+
| Unrelated to eCommerce | Decline politely |
|
|
169
|
+
|
|
170
|
+
If valid, continue.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Step 4: Identify applicable domains
|
|
175
|
+
|
|
176
|
+
Based on the merchant's request AND the site data, determine which domains to analyze. **Multiple domains can be active simultaneously.**
|
|
177
|
+
|
|
178
|
+
| Domain | When to activate | Data signals |
|
|
179
|
+
|---|---|---|
|
|
180
|
+
| **DISCOUNTS** | Merchant mentions sales, promotions, revenue, AOV, clearance, holidays, coupons. **Also activate if no specific domain is mentioned** (default). | Always — site data contains discount metrics |
|
|
181
|
+
| **SHIPPING** | Merchant mentions shipping, delivery, checkout conversion, cart abandonment. **Also activate proactively** if site data suggests shipping issues. | High visitors + low orders may indicate shipping friction |
|
|
182
|
+
| **ABANDONED_CART** | Activate proactively if site data shows abandoned carts with no active recovery automation. No merchant trigger needed — detect from data. | `currentDiscounts` empty or no cart recovery automation visible |
|
|
183
|
+
|
|
184
|
+
**Priority rule**: If the merchant mentions a specific holiday/event/date, the DISCOUNTS domain MUST use the **SEASONAL** strategy — even if other signals like "boost sales" or "increase revenue" could match other goals. Holidays are time-sensitive and take priority over general intent.
|
|
185
|
+
|
|
186
|
+
**If the request is generic** (e.g., "boost my sales", "help my business"), **activate ALL domains**. The best recommendations will come from analyzing every angle.
|
|
187
|
+
|
|
188
|
+
**If the request targets a specific domain** (e.g., "give me a coupon", "fix my shipping rates", "set up a gift card"), **activate ONLY that domain**. Do not generate cross-domain recommendations — focus all 5 recommendation slots on the requested domain. The merchant asked for something specific; respect that focus.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Step 4b: Load domain-specific goal skills
|
|
193
|
+
|
|
194
|
+
**MANDATORY — load the matching goal skill(s) now using `ReadFullDocsArticle`.** These contain detailed strategy logic, KPIs, margin tiers, campaign window calculations, and guardrails that you MUST follow.
|
|
195
|
+
|
|
196
|
+
**For DISCOUNTS domain — classify the discount goal and load it:**
|
|
197
|
+
|
|
198
|
+
| Discount goal | Trigger | Load this skill |
|
|
199
|
+
|---|---|---|
|
|
200
|
+
| SEASONAL | Holiday/event/date mentioned | [Goal: Seasonal Revenue](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-seasonal-revenue) |
|
|
201
|
+
| UPSELL_BOOST | "increase AOV", "spend more", "upsell" | [Goal: Increase AOV](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-increase-aov) |
|
|
202
|
+
| STOCK_MOVER | "clear inventory", "overstock", "clearance" | [Goal: Clear Inventory](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-clear-inventory) |
|
|
203
|
+
| BUNDLE_AND_SAVE | "bundle", "cross-sell", "buy together" | [Goal: Drive Cross-Sells](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-drive-cross-sells) |
|
|
204
|
+
| Generic (no clear goal) | "boost sales", ambiguous | Default to SEASONAL if holiday nearby, else UPSELL_BOOST |
|
|
205
|
+
|
|
206
|
+
**For SHIPPING domain — load the same goal as discounts.** Shipping flows (free shipping threshold, rate optimization) serve the same business goals as discount flows. Load the matching discount goal above — it now includes shipping flow references.
|
|
207
|
+
|
|
208
|
+
**For ABANDONED_CART domain — load the cart abandonment goal:**
|
|
209
|
+
|
|
210
|
+
[Goal: Reduce Cart Abandonment](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-reduce-cart-abandonment)
|
|
211
|
+
|
|
212
|
+
**The goal skill will instruct you to load flow and guardrail skills** — follow those instructions. This chain provides the detailed execution logic you need for high-quality recommendations.
|
|
213
|
+
|
|
214
|
+
**Do NOT skip this step.** The goal/flow/guardrail skills contain critical constraints (margin tiers, campaign windows, conflict checks) that prevent bad recommendations.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Step 4c: Determine mechanism — Automatic Discount or Coupon
|
|
219
|
+
|
|
220
|
+
**Only for DISCOUNTS domain. Skip if DISCOUNTS is not active.**
|
|
221
|
+
|
|
222
|
+
| Merchant says | Mechanism |
|
|
223
|
+
|---|---|
|
|
224
|
+
| "sale", "promotion", "discount for everyone" | **AUTOMATIC** |
|
|
225
|
+
| "coupon", "code", "promo code", "voucher" | **COUPON** |
|
|
226
|
+
| "discount for subscribers", "influencer code" | **COUPON** |
|
|
227
|
+
| Unclear | **Ask the merchant** |
|
|
228
|
+
|
|
229
|
+
**If unclear, ask:** "Would you like this to apply automatically to everyone, or as a coupon code?"
|
|
230
|
+
|
|
231
|
+
**If COUPON is selected**, load the coupon setup reference with `ReadFullDocsArticle`:
|
|
232
|
+
[Setup: Coupons](https://dev.wix.com/docs/api-reference/business-solutions/coupons/skills/setup-coupons)
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Step 5: Analyze catalog
|
|
237
|
+
|
|
238
|
+
**Permission**: `ecom:discounts_recommendations:v1:recommendation:build_recommendation`
|
|
239
|
+
|
|
240
|
+
Call both APIs concurrently:
|
|
241
|
+
|
|
242
|
+
### Call 1: GetCatalogAnalytics
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
CallWixSiteAPI(
|
|
246
|
+
url: "https://manage.wix.com/recommendations/v1/recommendations/get-catalog-analytics-tool",
|
|
247
|
+
method: "POST",
|
|
248
|
+
body: {
|
|
249
|
+
"aggregates": <see table below>,
|
|
250
|
+
"minMarginPct": 0.15
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Valid `aggregates` values: `op` ∈ `count|sum|avg|min|max|stddev|quantiles` · `field` ∈ `quantity|price|cost|profit|profitMargin|ordersCount` · `q` required only for `quantiles` (array of 0.0–1.0, max 20)
|
|
256
|
+
|
|
257
|
+
**Aggregates by goal:**
|
|
258
|
+
|
|
259
|
+
| Goal | `aggregates` array |
|
|
260
|
+
|---|---|
|
|
261
|
+
| UPSELL_BOOST | `[{"op":"count","field":"price"}, {"op":"quantiles","field":"price","q":[0.5,0.75,0.9]}, {"op":"avg","field":"profitMargin"}]` |
|
|
262
|
+
| BUNDLE_AND_SAVE | `[{"op":"min","field":"price"}, {"op":"max","field":"price"}, {"op":"avg","field":"profitMargin"}, {"op":"count","field":"price"}]` |
|
|
263
|
+
| STOCK_MOVER | `[{"op":"sum","field":"quantity"}, {"op":"sum","field":"ordersCount"}, {"op":"avg","field":"profitMargin"}]` |
|
|
264
|
+
| SEASONAL | `[{"op":"sum","field":"ordersCount"}, {"op":"quantiles","field":"price","q":[0.5,0.9]}, {"op":"avg","field":"profitMargin"}]` |
|
|
265
|
+
| SHIPPING | `[{"op":"count","field":"price"}, {"op":"quantiles","field":"price","q":[0.5,0.75]}, {"op":"avg","field":"profitMargin"}]` |
|
|
266
|
+
|
|
267
|
+
**Response shape:**
|
|
268
|
+
```json
|
|
269
|
+
{
|
|
270
|
+
"categoryGroups": [
|
|
271
|
+
{
|
|
272
|
+
"categoryName": "Electronics",
|
|
273
|
+
"fields": {
|
|
274
|
+
"count()": 45,
|
|
275
|
+
"quantiles([0.5,0.75,0.9],price)": [
|
|
276
|
+
{ "quantile": 0.5, "value": 89.99 },
|
|
277
|
+
{ "quantile": 0.75, "value": 149.99 }
|
|
278
|
+
],
|
|
279
|
+
"avg(profitMargin)": 0.42
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
{ "categoryName": "All Products", "fields": { "count()": 120, "avg(profitMargin)": 0.35 } }
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
**Important**: Use "All Products" only for overall catalog stats. Exclude it from category-level analysis.
|
|
287
|
+
|
|
288
|
+
### Call 2: GetProductCatalogData
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
CallWixSiteAPI(
|
|
292
|
+
url: "https://manage.wix.com/recommendations/v1/recommendations/get-product-catalog-data-tool",
|
|
293
|
+
method: "POST",
|
|
294
|
+
body: {
|
|
295
|
+
"businessGoal": "<goal from Step 4>",
|
|
296
|
+
"minMarginPct": 0.15,
|
|
297
|
+
"catalogLimit": 30,
|
|
298
|
+
"query": "<keywords from merchant request, or empty string>",
|
|
299
|
+
"categoryNames": <category names if mentioned, or empty array>
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Sort order applied server-side by `businessGoal`:**
|
|
305
|
+
|
|
306
|
+
| Goal | Sort order |
|
|
307
|
+
|---|---|
|
|
308
|
+
| UPSELL_BOOST | price DESC, ordersCount DESC |
|
|
309
|
+
| BUNDLE_AND_SAVE | price DESC, ordersCount DESC |
|
|
310
|
+
| STOCK_MOVER | quantity DESC, ordersCount ASC |
|
|
311
|
+
| SEASONAL / SHIPPING | ordersCount DESC |
|
|
312
|
+
|
|
313
|
+
**Response shape:**
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"items": [
|
|
317
|
+
{
|
|
318
|
+
"id": "product-uuid",
|
|
319
|
+
"name": "Premium Headphones",
|
|
320
|
+
"quantity": 85,
|
|
321
|
+
"price": 149.99,
|
|
322
|
+
"profit": 67.50,
|
|
323
|
+
"profitMargin": 0.45,
|
|
324
|
+
"ordersCount": 23
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
`price` and `profit` are in `payment_currency` units. `id` is the product UUID — use for `productIds` in rules.
|
|
330
|
+
|
|
331
|
+
### Step 5b: Convert category names to GUIDs (if using CATEGORY scope)
|
|
332
|
+
|
|
333
|
+
**MANDATORY before outputting any categoryIds.** Never output category names as IDs.
|
|
334
|
+
|
|
335
|
+
**Send only categories you plan to target — max 10 per call.**
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
CallWixSiteAPI(
|
|
339
|
+
url: "https://manage.wix.com/recommendations/v1/recommendations/get-category-ids-tool",
|
|
340
|
+
method: "POST",
|
|
341
|
+
body: { "categoryNames": ["<top category 1>", "<top category 2>"] }
|
|
342
|
+
)
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**Response:** `{ "categoryIds": ["a1b2c3d4-...", "b2c3d4e5-..."] }`
|
|
346
|
+
|
|
347
|
+
If `categoryIds` is empty: category doesn't exist — fall back to SITE scope and tell the merchant: "Could not resolve category '{name}', using site-wide scope instead."
|
|
348
|
+
|
|
349
|
+
### Failure handling
|
|
350
|
+
|
|
351
|
+
- Both calls fail: Fall back to SITE scope using only site profile data.
|
|
352
|
+
- One fails: Use whichever succeeded.
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Step 6: Generate recommendations across ALL active domains
|
|
357
|
+
|
|
358
|
+
**Only now — after data gathering — generate recommendations.**
|
|
359
|
+
|
|
360
|
+
Maximum **5 recommendations total** across all domains. Each recommendation includes its `domain` field.
|
|
361
|
+
|
|
362
|
+
### Discount recommendations (if DISCOUNTS domain active)
|
|
363
|
+
|
|
364
|
+
Use site data + catalog data to generate discount recommendations. Each should use a **different strategy**:
|
|
365
|
+
|
|
366
|
+
| Strategy | When to use | Key parameters |
|
|
367
|
+
|---|---|---|
|
|
368
|
+
| SEASONAL | Holiday/event within 30 days | Time-bounded, site-wide or category scope |
|
|
369
|
+
| UPSELL_BOOST | AOV data available | minSubTotal above current AOV |
|
|
370
|
+
| STOCK_MOVER | Products with high stock + low orders | Deeper discounts on slow movers |
|
|
371
|
+
| BUNDLE_AND_SAVE | Many low-priced items | minItemQuantity conditions |
|
|
372
|
+
|
|
373
|
+
**Scope selection** (in order of preference):
|
|
374
|
+
|
|
375
|
+
1. **CATEGORY** (preferred): High-opportunity category from analytics. Must have GUID from GetCategoryIds.
|
|
376
|
+
2. **ITEMS** (specific): Individual products from catalog data. Max 5 product IDs.
|
|
377
|
+
3. **SITE** (fallback): When no clear category/product opportunity.
|
|
378
|
+
|
|
379
|
+
**Performance signals:**
|
|
380
|
+
|
|
381
|
+
| What you observe in the data | What to recommend |
|
|
382
|
+
|---|---|
|
|
383
|
+
| High visitors, low ordersCount | Site-wide discount to convert traffic |
|
|
384
|
+
| High AOV, few items per order | BUNDLE_AND_SAVE |
|
|
385
|
+
| Products with high stock + low orders | STOCK_MOVER |
|
|
386
|
+
| Holiday within 30 days | SEASONAL |
|
|
387
|
+
|
|
388
|
+
**Discount constraints:**
|
|
389
|
+
- Discount must not exceed `discountMargin` from site data (unless merchant overrides)
|
|
390
|
+
- Round percentages to 5/10/15/20/25% unless merchant specified exact value
|
|
391
|
+
- All categoryIds must be GUIDs from GetCategoryIds
|
|
392
|
+
- All productIds must be from GetProductCatalogData
|
|
393
|
+
- Mechanism must be AUTOMATIC or COUPON per Step 4c
|
|
394
|
+
|
|
395
|
+
### Shipping recommendations (if SHIPPING domain active)
|
|
396
|
+
|
|
397
|
+
Analyze the site's shipping configuration using the rules below. All shipping recommendations use `domain: "shipping"`.
|
|
398
|
+
|
|
399
|
+
**Externally managed regions:** Regions where `deliveryCarriers[].appId` matches an external carrier (e.g., Shippo) — exclude from ALL analysis. Do not recommend changes to these.
|
|
400
|
+
|
|
401
|
+
**Shipping analysis rules — evaluate each and recommend where data supports:**
|
|
402
|
+
|
|
403
|
+
| Rule | Finding | Recommendation |
|
|
404
|
+
|---|---|---|
|
|
405
|
+
| **Coverage** | Active region with zero shipping options | CRITICAL — `create_shipping_option` for that region |
|
|
406
|
+
| **Coverage** | Domestic country not covered by any region | CRITICAL — `activate_region` or create domestic region |
|
|
407
|
+
| **Coverage** | Inactive regions with shipping options | `activate_region` or clean up orphaned options |
|
|
408
|
+
| **Free Shipping** | No free shipping option anywhere | `create_shipping_option` with AOV-calibrated threshold (1.2-1.5x AOV) |
|
|
409
|
+
| **Free Shipping** | Free shipping threshold > 2x AOV | Lower threshold — too high for most customers |
|
|
410
|
+
| **Rates** | Flat rate > 15% of AOV | Reduce rate or add conditional tiering — sticker shock risk |
|
|
411
|
+
| **Rates** | All flat rates, no conditional pricing | Add threshold-based tiers for better conversion |
|
|
412
|
+
| **Rates** | Per-item pricing enabled | Review — usually causes unexpectedly high totals |
|
|
413
|
+
| **Carrier** | No backup rate on carrier regions | `enable_backup_rate` as fallback |
|
|
414
|
+
| **Options** | Too many options per region (> 5) | Consolidate — choice paralysis reduces conversion |
|
|
415
|
+
| **Options** | Only 1 option per region | Add at least one alternative (e.g., express tier) |
|
|
416
|
+
|
|
417
|
+
**Shipping action types:** `create_shipping_option`, `update_shipping_option`, `enable_backup_rate`, `activate_region`.
|
|
418
|
+
|
|
419
|
+
**Priority order:** CRITICAL blockers (no options, no coverage) → Conversion-linked (no free shipping, high rates) → Revenue opportunities (international, tiered pricing) → Configuration improvements (consolidate, add estimates).
|
|
420
|
+
|
|
421
|
+
### Abandoned cart recommendations (if ABANDONED_CART domain active)
|
|
422
|
+
|
|
423
|
+
Detect if the merchant has significant cart abandonment without active recovery. All abandoned cart recommendations use `domain: "abandoned_cart_recovery"`.
|
|
424
|
+
|
|
425
|
+
**Eligibility gate (BOTH conditions required):**
|
|
426
|
+
1. Cart abandonment recovery automation is **NOT active** on the site
|
|
427
|
+
2. Estimated missing sales >= $200 over the last 30 days
|
|
428
|
+
|
|
429
|
+
**If either condition fails, do NOT generate abandoned cart recommendations.**
|
|
430
|
+
|
|
431
|
+
**Urgency thresholds based on missing sales (USD, last 30 days):**
|
|
432
|
+
|
|
433
|
+
| Missing sales | Urgency |
|
|
434
|
+
|---|---|
|
|
435
|
+
| >= $1,000 | HIGH |
|
|
436
|
+
| $200 — $999 | MEDIUM |
|
|
437
|
+
| < $200 | Do not recommend |
|
|
438
|
+
|
|
439
|
+
**Action type:** `activate_abandoned_cart_recovery`
|
|
440
|
+
|
|
441
|
+
**Params must include:** `automation_key` ("wix_e_commerce-cart_abandonment"), `missing_sales_usd` (integer, rounded), `abandoned_cart_count` (integer), `window_days` (always 30).
|
|
442
|
+
|
|
443
|
+
**Title pattern:** "Recover $[missing_sales_usd] in abandoned carts"
|
|
444
|
+
|
|
445
|
+
**Reasoning MUST cite:** automation is inactive, exact cart count, exact missing sales USD, 30-day window, and why the urgency level was chosen.
|
|
446
|
+
|
|
447
|
+
### Cross-domain balance
|
|
448
|
+
|
|
449
|
+
- If request is generic, aim for recommendations from **multiple domains** (e.g., 2-3 discount + 1-2 shipping + abandoned cart if eligible)
|
|
450
|
+
- If request targets a specific domain, focus all slots on that domain
|
|
451
|
+
- Rank by business impact: CRITICAL blockers first, then conversion-linked, then revenue opportunities
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## Step 7: Validate before returning
|
|
456
|
+
|
|
457
|
+
1. **Conflict check**: Do existing active discounts/coupons overlap with your recommendation scope? Warn about stacking.
|
|
458
|
+
2. **Margin check**: Discounts within `discountMargin` cap.
|
|
459
|
+
3. **No duplicates**: Each recommendation targets a different scope/action combination.
|
|
460
|
+
4. **No contradictions**: Don't recommend opposite actions in the same domain.
|
|
461
|
+
5. **Strategy diversity**: Discount recommendations use different strategies where possible.
|
|
462
|
+
6. **Mechanism match**: Discount mechanism matches Step 4c determination.
|
|
463
|
+
7. **ID validity**: All categoryIds are GUIDs from GetCategoryIds. All productIds are from GetProductCatalogData.
|
|
464
|
+
8. **Rounding**: Discount percentages round to 5/10/15/20/25% unless merchant specified exact value.
|
|
465
|
+
9. **Data-backed**: Every recommendation must reference specific data from API responses.
|
|
466
|
+
10. **Domain labeled**: Every recommendation has the correct `domain` field.
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
|
|
470
|
+
## Step 8: Persist recommendations to database (Tracking)
|
|
471
|
+
|
|
472
|
+
**MANDATORY — do NOT skip unless the user said `SKIP_TRACKING`.**
|
|
473
|
+
|
|
474
|
+
Call `BatchCreate` to persist ALL recommendations as PROPOSED:
|
|
475
|
+
|
|
476
|
+
```
|
|
477
|
+
CallWixSiteAPI(
|
|
478
|
+
url: "https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/batch-create",
|
|
479
|
+
method: "POST",
|
|
480
|
+
|
|
481
|
+
body: {
|
|
482
|
+
"agenticRecommendations": [
|
|
483
|
+
{
|
|
484
|
+
"title": "<recommendation title>",
|
|
485
|
+
"reasoning": "<recommendation reasoning>",
|
|
486
|
+
"domain": "<discounts|shipping|abandoned_cart_recovery>",
|
|
487
|
+
"urgency": "<CRITICAL|HIGH|MEDIUM|LOW>",
|
|
488
|
+
"advice": {
|
|
489
|
+
"action": "<action type>",
|
|
490
|
+
"params": <params object>,
|
|
491
|
+
"successCriteria": "<how to verify success>"
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
"conversationId": "<conversationId>"
|
|
496
|
+
}
|
|
497
|
+
)
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
**Save the `id` and `revision` from each result.** Include them in the output.
|
|
501
|
+
|
|
502
|
+
If BatchCreate fails, report the error and include recommendations without tracking IDs.
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
## Output format
|
|
507
|
+
|
|
508
|
+
```json
|
|
509
|
+
{
|
|
510
|
+
"recommendations": [
|
|
511
|
+
{
|
|
512
|
+
"id": "<tracking-id from BatchCreate, or omit if tracking failed>",
|
|
513
|
+
"revision": "<revision from BatchCreate>",
|
|
514
|
+
"title": "Memorial Weekend Flash Sale — 15% Off Orders Over $250",
|
|
515
|
+
"reasoning": "AOV is $242 (online_gpv_last_30_days / last_30_days_orders_count). merchant_business_country is US, Memorial Day is within 7 days. Setting $250 threshold nudges carts above AOV while staying within 25% discount cap.",
|
|
516
|
+
"domain": "discounts",
|
|
517
|
+
"urgency": "HIGH",
|
|
518
|
+
"advice": {
|
|
519
|
+
"action": "apply_discount",
|
|
520
|
+
"params": {
|
|
521
|
+
"mechanism": "AUTOMATIC",
|
|
522
|
+
"scope": "SITE",
|
|
523
|
+
"categoryIds": [],
|
|
524
|
+
"productIds": [],
|
|
525
|
+
"name": "Memorial Weekend Sale",
|
|
526
|
+
"why": "Your AOV is $242. A 15% discount on orders over $250 encourages adding one more item.",
|
|
527
|
+
"discountType": "PERCENTAGE",
|
|
528
|
+
"discount": 15,
|
|
529
|
+
"code": "",
|
|
530
|
+
"usageLimit": 0,
|
|
531
|
+
"limitPerCustomer": 0,
|
|
532
|
+
"conditions": {
|
|
533
|
+
"minItemQuantity": 0,
|
|
534
|
+
"minSubTotal": 250,
|
|
535
|
+
"startDate": "2026-05-23",
|
|
536
|
+
"endDate": "2026-05-26"
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
"success_criteria": "15% discount applied site-wide for orders above $250 during Memorial Weekend"
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
]
|
|
543
|
+
}
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### Field rules
|
|
547
|
+
|
|
548
|
+
| Field | Rule |
|
|
549
|
+
|---|---|
|
|
550
|
+
| `id` | GUID from tracking BatchCreate response (omit if tracking skipped/failed) |
|
|
551
|
+
| `title` | Short, actionable. Max 200 chars. Always English. |
|
|
552
|
+
| `reasoning` | **Must reference which API call returned the data.** Always English. |
|
|
553
|
+
| `domain` | `"discounts"`, `"shipping"`, or `"abandoned_cart_recovery"` (future: `"gift_cards"`, `"taxes"`) |
|
|
554
|
+
| `urgency` | `CRITICAL`, `HIGH`, `MEDIUM`, or `LOW` |
|
|
555
|
+
| `mechanism` | `AUTOMATIC` or `COUPON`. From Step 4c. Only for discounts domain. |
|
|
556
|
+
| `name` | Marketing headline, 2-5 words. Translate to site `language` if not English. |
|
|
557
|
+
| `why` | 1-2 sentences with specific data points from API responses. Translate to site `language`. |
|
|
558
|
+
| `code` | Only for COUPON mechanism. Memorable code, max 20 chars (e.g., "SAVE15"). |
|
|
559
|
+
| `scope` + IDs | For discounts: SITE = both empty, CATEGORY = categoryIds only (max 3), ITEMS = productIds only (max 5). |
|
|
560
|
+
| `success_criteria` | How to verify the recommendation was applied correctly |
|
|
561
|
+
|
|
562
|
+
### Valid action types by domain
|
|
563
|
+
|
|
564
|
+
| Domain | Action types |
|
|
565
|
+
|---|---|
|
|
566
|
+
| discounts | `apply_discount` |
|
|
567
|
+
| shipping | `create_shipping_option`, `update_shipping_option`, `enable_backup_rate`, `activate_region` |
|
|
568
|
+
| abandoned_cart_recovery | `activate_abandoned_cart_recovery` |
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
## Constraints
|
|
573
|
+
|
|
574
|
+
- Maximum 5 recommendations total across all domains
|
|
575
|
+
- Each discount recommendation must use a different strategy
|
|
576
|
+
- All data must come from API responses — no assumptions
|
|
577
|
+
- Respect discountMargin cap unless merchant overrides
|
|
578
|
+
- All IDs must be GUIDs from API responses
|
|
579
|
+
- Catalog queries limited to 30 items
|
|
580
|
+
- Every recommendation MUST be persisted via tracking before presenting (unless SKIP_TRACKING)
|
|
581
|
+
- Recommendations should span multiple domains when the request is generic
|
|
582
|
+
- Never recommend changes to externally managed (Shippo) shipping regions
|