@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,308 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Flow: Stock Mover"
|
|
3
|
+
description: Creates discount campaigns to clear slow-moving inventory by targeting products with high stock levels and low sales velocity. Uses deeper discounts proportional to inventory urgency.
|
|
4
|
+
layer: flow
|
|
5
|
+
references:
|
|
6
|
+
- name: "Guardrail: Discount Conflicts"
|
|
7
|
+
path: ecommerce/guardrail-discount-conflicts.md
|
|
8
|
+
load: true
|
|
9
|
+
- name: "Guardrail: Margin Protection"
|
|
10
|
+
path: ecommerce/guardrail-margin-protection.md
|
|
11
|
+
load: true
|
|
12
|
+
- name: "Setup: Discount Rules"
|
|
13
|
+
path: ecommerce/setup-discount-rules.md
|
|
14
|
+
load: true
|
|
15
|
+
---
|
|
16
|
+
# Flow: Stock Mover Clearance
|
|
17
|
+
|
|
18
|
+
> **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
|
|
19
|
+
> - [Guardrail: Discount Conflicts](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-discount-conflicts)
|
|
20
|
+
> - [Guardrail: Margin Protection](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-margin-protection)
|
|
21
|
+
> - [Setup: Discount Rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/setup-discount-rules)
|
|
22
|
+
|
|
23
|
+
Creates a discount targeting slow-moving inventory — products with high stock levels and low sales velocity. The discount depth is proportional to how overstocked the product is, with deeper discounts for the most stagnant items. Margin protection guardrails are especially important here since clearance discounts tend to push closer to cost.
|
|
24
|
+
|
|
25
|
+
## Prerequisites
|
|
26
|
+
|
|
27
|
+
- Wix Stores installed on the site
|
|
28
|
+
- Products exist in the catalog with inventory (quantity) data
|
|
29
|
+
- Access to `getCatalogAnalytics` and `getProductCatalogData` tools
|
|
30
|
+
- Inventory tracking enabled for target products
|
|
31
|
+
|
|
32
|
+
## Required APIs
|
|
33
|
+
|
|
34
|
+
- [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/discounts/discount-rules/create-discount-rule)
|
|
35
|
+
- [Query Discount Rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/discounts/discount-rules/query-discount-rules)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Step 1: Gather inventory and sales data
|
|
40
|
+
|
|
41
|
+
Call `getCatalogAnalytics` and `getProductCatalogData` concurrently to assess stock levels and sales velocity.
|
|
42
|
+
|
|
43
|
+
**getCatalogAnalytics** call:
|
|
44
|
+
```
|
|
45
|
+
aggregates: sum(quantity), sum(ordersCount), avg(profitMargin)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**getProductCatalogData** call:
|
|
49
|
+
```
|
|
50
|
+
ordered: quantity DESC, ordersCount ASC
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This sort order surfaces products with the most stock and the fewest sales first — the primary candidates for clearance.
|
|
54
|
+
|
|
55
|
+
Save the following values:
|
|
56
|
+
- `total_quantity` — total stock across catalog
|
|
57
|
+
- `total_orders` — total sales across catalog
|
|
58
|
+
- `avg_profit_margin` — average profit margin (sets discount ceiling)
|
|
59
|
+
- Per-product: `quantity`, `ordersCount`, `price`, `name`, `id`, `categoryId`
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Step 2: Identify slow-moving products
|
|
64
|
+
|
|
65
|
+
Calculate the velocity ratio for each product to identify overstocked items:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
velocity_ratio = ordersCount / quantity
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
| Velocity Ratio | Classification | Action |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| < 0.1 | **Severely overstocked** — fewer than 1 sale per 10 units in stock | High priority for clearance discount |
|
|
74
|
+
| 0.1 - 0.3 | **Moderately overstocked** — slow but not stagnant | Medium priority |
|
|
75
|
+
| 0.3 - 0.7 | **Balanced** — reasonable sell-through rate | Not a clearance candidate |
|
|
76
|
+
| > 0.7 | **Fast-moving** — selling well relative to stock | Do NOT discount — unnecessary margin erosion |
|
|
77
|
+
|
|
78
|
+
Select products with velocity_ratio < 0.3 as clearance candidates.
|
|
79
|
+
|
|
80
|
+
If `quantity = 0` for a product, skip it (nothing to clear). If `ordersCount = 0`, the velocity ratio is 0 — this is the most urgent clearance case.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Step 3: Calculate discount depth
|
|
85
|
+
|
|
86
|
+
Scale the discount based on inventory urgency. Deeper discounts for more overstocked items, constrained by margin:
|
|
87
|
+
|
|
88
|
+
| Velocity Ratio | Recommended Discount | Rationale |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| 0 (zero sales) | 20-25% | Maximum urgency — product is not moving at all |
|
|
91
|
+
| < 0.1 | 15-20% | Severely slow — needs aggressive pricing |
|
|
92
|
+
| 0.1 - 0.2 | 10-15% | Moderately slow — moderate discount |
|
|
93
|
+
| 0.2 - 0.3 | 5-10% | Slightly slow — gentle nudge |
|
|
94
|
+
|
|
95
|
+
**Margin constraint**: Always verify `discount <= avg_profit_margin - 15%` (minMarginPct). Clearance discounts are more likely to violate margin thresholds because they are deliberately deeper.
|
|
96
|
+
|
|
97
|
+
**Global cap**: Do not exceed 25% unless the merchant explicitly overrides. For clearance, merchants may accept deeper discounts to free up capital and shelf space.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Step 4: Determine discount scope
|
|
102
|
+
|
|
103
|
+
Select the scope based on the distribution of slow movers:
|
|
104
|
+
|
|
105
|
+
- **ITEMS** (preferred for clearance): Target specific slow-moving products by ID (max 5 productIds). This is the most precise approach and avoids discounting fast sellers.
|
|
106
|
+
- **CATEGORY**: When multiple slow movers cluster in the same category, target the whole category. This is simpler but may discount some healthy-velocity products in the same category.
|
|
107
|
+
- **SITE**: Rarely appropriate for clearance — avoid discounting the entire catalog to clear a few items.
|
|
108
|
+
|
|
109
|
+
When selecting ITEMS scope, prioritize the products with the worst velocity ratios (lowest first), up to the max of 5 productIds.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Step 5: Convert category names to GUIDs (if CATEGORY scope)
|
|
114
|
+
|
|
115
|
+
If scope is CATEGORY, call `getCategoryIds` to convert category names to GUIDs.
|
|
116
|
+
|
|
117
|
+
- Never use category names as scope IDs — always use the GUID.
|
|
118
|
+
- Exclude the "All Products" system category.
|
|
119
|
+
- Max 3 categoryIds per discount rule.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Step 6: Run guardrail checks
|
|
124
|
+
|
|
125
|
+
**IMPORTANT: Run both guardrail checks before creating the discount rule. Clearance discounts are the most likely to trigger margin warnings.**
|
|
126
|
+
|
|
127
|
+
### 6a: Discount Conflicts
|
|
128
|
+
|
|
129
|
+
1. Query existing active discount rules:
|
|
130
|
+
|
|
131
|
+
**Endpoint**: `POST https://www.wixapis.com/ecom/v1/discount-rules/query`
|
|
132
|
+
|
|
133
|
+
**Request**:
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"query": {
|
|
137
|
+
"filter": {
|
|
138
|
+
"active": true
|
|
139
|
+
},
|
|
140
|
+
"paging": {
|
|
141
|
+
"limit": 100
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
2. Check for scope overlap. Clearance items that already have an active discount would stack — warn the merchant about combined discount depth.
|
|
148
|
+
3. Check for coupon stacking risks. A customer combining a clearance discount with a coupon code could get an unexpectedly deep total discount.
|
|
149
|
+
|
|
150
|
+
### 6b: Margin Protection
|
|
151
|
+
|
|
152
|
+
This check is especially critical for clearance:
|
|
153
|
+
|
|
154
|
+
- Verify `discount_percentage <= avg_profit_margin - 15%` for each candidate product.
|
|
155
|
+
- If the discount would push effective margin below 15%, warn the merchant: "This clearance discount of {discount}% on {product_name} would reduce the effective margin to {remaining_margin}%. The minimum margin threshold is 15%. Proceed?"
|
|
156
|
+
- If margin data is unavailable, apply extra caution — cap at 15% unless the merchant explicitly overrides.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Step 7: Create the discount rule
|
|
161
|
+
|
|
162
|
+
**Endpoint**: `POST https://www.wixapis.com/ecom/v1/discount-rules`
|
|
163
|
+
|
|
164
|
+
**Request** — 20% off specific slow-moving products:
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"discountRule": {
|
|
168
|
+
"name": "Clearance - Overstock Items 20% Off",
|
|
169
|
+
"active": true,
|
|
170
|
+
"discounts": [
|
|
171
|
+
{
|
|
172
|
+
"discount": {
|
|
173
|
+
"discountType": "PERCENTAGE",
|
|
174
|
+
"percentage": 20
|
|
175
|
+
},
|
|
176
|
+
"scope": {
|
|
177
|
+
"id": "slow-mover-product-uuid-1",
|
|
178
|
+
"type": "SPECIFIC_PRODUCTS"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"discount": {
|
|
183
|
+
"discountType": "PERCENTAGE",
|
|
184
|
+
"percentage": 20
|
|
185
|
+
},
|
|
186
|
+
"scope": {
|
|
187
|
+
"id": "slow-mover-product-uuid-2",
|
|
188
|
+
"type": "SPECIFIC_PRODUCTS"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"discount": {
|
|
193
|
+
"discountType": "PERCENTAGE",
|
|
194
|
+
"percentage": 20
|
|
195
|
+
},
|
|
196
|
+
"scope": {
|
|
197
|
+
"id": "slow-mover-product-uuid-3",
|
|
198
|
+
"type": "SPECIFIC_PRODUCTS"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Response**:
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"discountRule": {
|
|
210
|
+
"id": "e5f6a7b8-c9d0-1234-ef01-345678901234",
|
|
211
|
+
"revision": "1",
|
|
212
|
+
"name": "Clearance - Overstock Items 20% Off",
|
|
213
|
+
"active": true,
|
|
214
|
+
"discounts": [
|
|
215
|
+
{
|
|
216
|
+
"discount": {
|
|
217
|
+
"discountType": "PERCENTAGE",
|
|
218
|
+
"percentage": 20
|
|
219
|
+
},
|
|
220
|
+
"scope": {
|
|
221
|
+
"id": "slow-mover-product-uuid-1",
|
|
222
|
+
"type": "SPECIFIC_PRODUCTS"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"discount": {
|
|
227
|
+
"discountType": "PERCENTAGE",
|
|
228
|
+
"percentage": 20
|
|
229
|
+
},
|
|
230
|
+
"scope": {
|
|
231
|
+
"id": "slow-mover-product-uuid-2",
|
|
232
|
+
"type": "SPECIFIC_PRODUCTS"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"discount": {
|
|
237
|
+
"discountType": "PERCENTAGE",
|
|
238
|
+
"percentage": 20
|
|
239
|
+
},
|
|
240
|
+
"scope": {
|
|
241
|
+
"id": "slow-mover-product-uuid-3",
|
|
242
|
+
"type": "SPECIFIC_PRODUCTS"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Request** — clearance on an entire category:
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"discountRule": {
|
|
254
|
+
"name": "Clearance - Winter Collection 15% Off",
|
|
255
|
+
"active": true,
|
|
256
|
+
"discounts": [
|
|
257
|
+
{
|
|
258
|
+
"discount": {
|
|
259
|
+
"discountType": "PERCENTAGE",
|
|
260
|
+
"percentage": 15
|
|
261
|
+
},
|
|
262
|
+
"scope": {
|
|
263
|
+
"id": "winter-collection-category-guid",
|
|
264
|
+
"type": "COLLECTION"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Save the returned `id` and `revision` for later management.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Step 8: Verify the rule is active
|
|
277
|
+
|
|
278
|
+
1. Query discount rules to confirm the new rule exists and is `active: true`
|
|
279
|
+
2. Verify the correct products or category are targeted
|
|
280
|
+
3. Report to the merchant:
|
|
281
|
+
> "Clearance discount is live: {discount}% off {number_of_products} slow-moving items. These products had a velocity ratio of {avg_velocity}, indicating high stock relative to sales. Monitor inventory levels — once stock clears, consider deactivating the rule."
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Branching logic
|
|
286
|
+
|
|
287
|
+
| Merchant intent | Scope | Discount depth | Notes |
|
|
288
|
+
|---|---|---|---|
|
|
289
|
+
| "Clear out old inventory" | ITEMS — top 5 slowest movers | Velocity-based (15-25%) | Target worst performers |
|
|
290
|
+
| "Clearance sale on winter items" | COLLECTION with category GUID | 15-20% | Category-wide clearance |
|
|
291
|
+
| "Get rid of product X" (specific) | SPECIFIC_PRODUCTS with product UUID | 20-25% (user may override) | Single product clearance |
|
|
292
|
+
| "Move stale stock across the store" | ITEMS — 5 worst velocity products | Velocity-based | Avoid SITE scope for clearance |
|
|
293
|
+
| "25% off these 3 items" (explicit) | SPECIFIC_PRODUCTS | 25% (user override) | Honor explicit request |
|
|
294
|
+
|
|
295
|
+
## Error Handling
|
|
296
|
+
|
|
297
|
+
| Error | Cause | Fix |
|
|
298
|
+
|---|---|---|
|
|
299
|
+
| `DISCOUNT_RULE_NOT_FOUND` | Rule ID doesn't exist | Re-query discount rules for current IDs |
|
|
300
|
+
| `REVISION_MISMATCH` | Revision doesn't match | Re-fetch rule for latest revision, then retry |
|
|
301
|
+
| No slow movers found | All products have healthy velocity ratios (> 0.3) | Inform merchant that inventory is balanced; no clearance needed |
|
|
302
|
+
| Margin violation | Discount would push margin below 15% | Reduce discount percentage or get explicit merchant override |
|
|
303
|
+
| Quantity data missing | Products lack inventory tracking | Cannot identify slow movers; ask merchant to enable inventory tracking or specify products manually |
|
|
304
|
+
| Max items exceeded | More than 5 slow-moving products identified | Select the 5 with worst velocity ratios; consider CATEGORY scope if they share a category |
|
|
305
|
+
|
|
306
|
+
## References
|
|
307
|
+
|
|
308
|
+
- [Discount Rules API](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/discounts/discount-rules/introduction)
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Flow: Upsell Boost"
|
|
3
|
+
description: Creates a discount campaign to increase average order value by setting minimum subtotal conditions above current AOV. Uses margin-based discount tiers and targets high-margin categories.
|
|
4
|
+
layer: flow
|
|
5
|
+
references:
|
|
6
|
+
- name: "Guardrail: Discount Conflicts"
|
|
7
|
+
path: ecommerce/guardrail-discount-conflicts.md
|
|
8
|
+
load: true
|
|
9
|
+
- name: "Guardrail: Margin Protection"
|
|
10
|
+
path: ecommerce/guardrail-margin-protection.md
|
|
11
|
+
load: true
|
|
12
|
+
- name: "Setup: Discount Rules"
|
|
13
|
+
path: ecommerce/setup-discount-rules.md
|
|
14
|
+
load: true
|
|
15
|
+
---
|
|
16
|
+
# Flow: Upsell Boost Campaign
|
|
17
|
+
|
|
18
|
+
> **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
|
|
19
|
+
> - [Guardrail: Discount Conflicts](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-discount-conflicts)
|
|
20
|
+
> - [Guardrail: Margin Protection](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-margin-protection)
|
|
21
|
+
> - [Setup: Discount Rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/setup-discount-rules)
|
|
22
|
+
|
|
23
|
+
Creates a discount that incentivizes customers to spend more per order by setting a minimum subtotal threshold above the store's current AOV. The discount percentage is scaled to the store's average profit margin, and the scope targets high-margin categories or products.
|
|
24
|
+
|
|
25
|
+
## Prerequisites
|
|
26
|
+
|
|
27
|
+
- Wix Stores installed on the site
|
|
28
|
+
- Products exist in the catalog with price data
|
|
29
|
+
- Access to `getCatalogAnalytics` and `getProductCatalogData` tools
|
|
30
|
+
- AOV data available from site metrics (revenue / ordersCount)
|
|
31
|
+
|
|
32
|
+
## Required APIs
|
|
33
|
+
|
|
34
|
+
- [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/discounts/discount-rules/create-discount-rule)
|
|
35
|
+
- [Query Discount Rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/discounts/discount-rules/query-discount-rules)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Step 1: Gather catalog data and site metrics
|
|
40
|
+
|
|
41
|
+
Call `getCatalogAnalytics` and `getProductCatalogData` concurrently to collect pricing, margin, and product data.
|
|
42
|
+
|
|
43
|
+
**getCatalogAnalytics** call:
|
|
44
|
+
```
|
|
45
|
+
aggregates: count, quantiles([0.5, 0.75, 0.9], price), avg(profitMargin)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**getProductCatalogData** call:
|
|
49
|
+
```
|
|
50
|
+
ordered: price DESC, ordersCount DESC
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Also retrieve site-level AOV from `getSiteData` (AOV = revenue / ordersCount). Run the AOV sanity check: if AOV < price_p25, override with price_p50 as the effective AOV.
|
|
54
|
+
|
|
55
|
+
Save the following values:
|
|
56
|
+
- `effective_aov` — the validated average order value
|
|
57
|
+
- `avg_profit_margin` — average profit margin across the catalog
|
|
58
|
+
- `price_p50`, `price_p75`, `price_p90` — pricing quantiles
|
|
59
|
+
- Top products by price and order volume
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Step 2: Determine margin tier and calculate discount + minSubTotal
|
|
64
|
+
|
|
65
|
+
Use the average profit margin to select the appropriate discount and threshold tier.
|
|
66
|
+
|
|
67
|
+
| Margin Tier | Condition | Max Discount | minSubTotal Formula |
|
|
68
|
+
|---|---|---|---|
|
|
69
|
+
| Low margin | `avg_profit_margin < 25%` | 10% | `1.15 x effective_aov` |
|
|
70
|
+
| Medium margin | `25% <= avg_profit_margin <= 50%` | 15% | `1.3 x effective_aov` |
|
|
71
|
+
| High margin | `avg_profit_margin > 50%` | 20% | `1.5 x effective_aov` |
|
|
72
|
+
| No data | Margin data unavailable | 10% | `1.15 x effective_aov` |
|
|
73
|
+
|
|
74
|
+
Example: If `effective_aov` = $150 and `avg_profit_margin` = 35% (medium), then max discount = 15% and raw minSubTotal = $195.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Step 3: Round minSubTotal (CRITICAL)
|
|
79
|
+
|
|
80
|
+
**minSubTotal MUST be rounded UP to the nearest $5 increment** (the result mod 5 must equal 0). Always round UP, never down.
|
|
81
|
+
|
|
82
|
+
| Raw Value | Rounded Value |
|
|
83
|
+
|---|---|
|
|
84
|
+
| $195 | $195 (already divisible by 5) |
|
|
85
|
+
| $217 | $220 |
|
|
86
|
+
| $223 | $225 |
|
|
87
|
+
| $199 | $200 |
|
|
88
|
+
| $172.50 | $175 |
|
|
89
|
+
| $201 | $205 |
|
|
90
|
+
|
|
91
|
+
Formula: `minSubTotal = ceil(raw_value / 5) * 5`
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Step 4: Determine discount scope
|
|
96
|
+
|
|
97
|
+
Select the scope based on analytics data:
|
|
98
|
+
|
|
99
|
+
- **CATEGORY** (preferred): When analytics show a clear high-margin category opportunity. Target the category with the highest profit margin that also has sufficient product count.
|
|
100
|
+
- **ITEMS**: When specific high-margin products stand out as upsell candidates (max 5 productIds).
|
|
101
|
+
- **SITE** (fallback): When no single category or product group dominates, apply catalog-wide.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Step 5: Convert category names to GUIDs (if CATEGORY scope)
|
|
106
|
+
|
|
107
|
+
If scope is CATEGORY, call `getCategoryIds` to convert human-readable category names into GUIDs. **Never output category names directly as scope IDs.**
|
|
108
|
+
|
|
109
|
+
Exclude the "All Products" system category — it contains every product and would effectively make the discount site-wide.
|
|
110
|
+
|
|
111
|
+
Max 3 categoryIds per discount rule.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Step 6: Run guardrail checks
|
|
116
|
+
|
|
117
|
+
**IMPORTANT: Run both guardrail checks before creating the discount rule.**
|
|
118
|
+
|
|
119
|
+
### 6a: Discount Conflicts
|
|
120
|
+
|
|
121
|
+
1. Query existing active discount rules:
|
|
122
|
+
|
|
123
|
+
**Endpoint**: `POST https://www.wixapis.com/ecom/v1/discount-rules/query`
|
|
124
|
+
|
|
125
|
+
**Request**:
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"query": {
|
|
129
|
+
"filter": {
|
|
130
|
+
"active": true
|
|
131
|
+
},
|
|
132
|
+
"paging": {
|
|
133
|
+
"limit": 100
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
2. Check for scope overlap, time overlap, and coupon stacking risks with the planned upsell discount.
|
|
140
|
+
3. If conflicts found, present to merchant and get confirmation before proceeding.
|
|
141
|
+
|
|
142
|
+
### 6b: Margin Protection
|
|
143
|
+
|
|
144
|
+
Verify that `discount_percentage <= avg_profit_margin - 15%` (minMarginPct). If the discount would push effective margin below 15%, warn the merchant.
|
|
145
|
+
|
|
146
|
+
The global discount cap is 25%. Do not exceed this unless the merchant explicitly overrides it.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Step 7: Create the discount rule
|
|
151
|
+
|
|
152
|
+
**Endpoint**: `POST https://www.wixapis.com/ecom/v1/discount-rules`
|
|
153
|
+
|
|
154
|
+
**Request** — 15% off orders over $195, scoped to a category:
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"discountRule": {
|
|
158
|
+
"name": "Spend $195+, Get 15% Off",
|
|
159
|
+
"active": true,
|
|
160
|
+
"discounts": [
|
|
161
|
+
{
|
|
162
|
+
"discount": {
|
|
163
|
+
"discountType": "PERCENTAGE",
|
|
164
|
+
"percentage": 15
|
|
165
|
+
},
|
|
166
|
+
"scope": {
|
|
167
|
+
"id": "category-guid-here",
|
|
168
|
+
"type": "COLLECTION"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"conditions": {
|
|
173
|
+
"subtotalRange": {
|
|
174
|
+
"from": "195.00"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Response**:
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"discountRule": {
|
|
185
|
+
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
|
|
186
|
+
"revision": "1",
|
|
187
|
+
"name": "Spend $195+, Get 15% Off",
|
|
188
|
+
"active": true,
|
|
189
|
+
"discounts": [
|
|
190
|
+
{
|
|
191
|
+
"discount": {
|
|
192
|
+
"discountType": "PERCENTAGE",
|
|
193
|
+
"percentage": 15
|
|
194
|
+
},
|
|
195
|
+
"scope": {
|
|
196
|
+
"id": "category-guid-here",
|
|
197
|
+
"type": "COLLECTION"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"conditions": {
|
|
202
|
+
"subtotalRange": {
|
|
203
|
+
"from": "195.00"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Request** — site-wide fallback example:
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"discountRule": {
|
|
214
|
+
"name": "Spend $175+, Get 10% Off Everything",
|
|
215
|
+
"active": true,
|
|
216
|
+
"discounts": [
|
|
217
|
+
{
|
|
218
|
+
"discount": {
|
|
219
|
+
"discountType": "PERCENTAGE",
|
|
220
|
+
"percentage": 10
|
|
221
|
+
},
|
|
222
|
+
"scope": {
|
|
223
|
+
"id": "catalog",
|
|
224
|
+
"type": "CATALOG"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"conditions": {
|
|
229
|
+
"subtotalRange": {
|
|
230
|
+
"from": "175.00"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Save the returned `id` and `revision` for later management.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Step 8: Verify the rule is active
|
|
242
|
+
|
|
243
|
+
1. Query discount rules to confirm the new rule exists and is `active: true`
|
|
244
|
+
2. Verify the minSubTotal condition is correctly set
|
|
245
|
+
3. Report to the merchant:
|
|
246
|
+
> "Upsell discount is live: {discount}% off on orders over ${minSubTotal} for {scope description}. This threshold is {percentage}% above your current average order value of ${effective_aov}, designed to incentivize higher spending."
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Branching logic
|
|
251
|
+
|
|
252
|
+
| Merchant intent | Scope | Discount | minSubTotal |
|
|
253
|
+
|---|---|---|---|
|
|
254
|
+
| "Increase average order value" | Determined by analytics (CATEGORY preferred) | Margin-tiered | Calculated from AOV |
|
|
255
|
+
| "Get people to spend more on electronics" | COLLECTION with electronics category GUID | Margin-tiered | Calculated from AOV |
|
|
256
|
+
| "20% off orders over $200" (explicit) | As specified by merchant | 20% (user override) | $200 (user override) |
|
|
257
|
+
| "Reward big spenders" | CATALOG (site-wide) | Margin-tiered | Calculated from AOV |
|
|
258
|
+
|
|
259
|
+
## Error Handling
|
|
260
|
+
|
|
261
|
+
| Error | Cause | Fix |
|
|
262
|
+
|---|---|---|
|
|
263
|
+
| `DISCOUNT_RULE_NOT_FOUND` | Rule ID doesn't exist | Re-query discount rules for current IDs |
|
|
264
|
+
| `REVISION_MISMATCH` | Revision doesn't match | Re-fetch rule for latest revision, then retry |
|
|
265
|
+
| AOV unavailable | No revenue or order data | Use price_p50 from catalog analytics as AOV proxy |
|
|
266
|
+
| Margin data unavailable | No profit margin data in catalog | Default to low-margin tier (10% discount, 1.15x AOV) |
|
|
267
|
+
| Category GUID not found | Category name doesn't match any collection | Re-query categories or fall back to SITE scope |
|
|
268
|
+
|
|
269
|
+
## References
|
|
270
|
+
|
|
271
|
+
- [Discount Rules API](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/discounts/discount-rules/introduction)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Goal: Clear Inventory"
|
|
3
|
+
description: Maps the STOCK_MOVER business goal to inventory turnover KPIs and clearance discount flows.
|
|
4
|
+
layer: goal
|
|
5
|
+
references:
|
|
6
|
+
- name: "Flow: Stock Mover"
|
|
7
|
+
path: ecommerce/flow-stock-mover.md
|
|
8
|
+
load: true
|
|
9
|
+
- name: "Guardrail: Margin Protection"
|
|
10
|
+
path: ecommerce/guardrail-margin-protection.md
|
|
11
|
+
load: false
|
|
12
|
+
---
|
|
13
|
+
# Goal: Clear Slow-Moving Inventory
|
|
14
|
+
|
|
15
|
+
> **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
|
|
16
|
+
> - [Flow: Stock Mover](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/flow-stock-mover)
|
|
17
|
+
>
|
|
18
|
+
> **Related skills** (read with `ReadFullDocsArticle` if needed):
|
|
19
|
+
> - [Guardrail: Margin Protection](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-margin-protection)
|
|
20
|
+
|
|
21
|
+
Automate clearance discounts for products with high stock levels and low sales velocity, converting stagnant inventory into revenue before it becomes a carrying cost liability.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Business Goal
|
|
26
|
+
|
|
27
|
+
**Goal ID:** `STOCK_MOVER`
|
|
28
|
+
|
|
29
|
+
The merchant wants to reduce excess inventory for products that are not selling at an acceptable rate. This is achieved by creating targeted discounts on slow-moving products, with discount depth proportional to how overstocked the product is relative to its sales velocity.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## KPIs
|
|
34
|
+
|
|
35
|
+
| KPI | Definition | How to measure |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| Inventory turnover ratio | ordersCount / quantity for each product | `getProductCatalogData` — compare ordersCount to current quantity |
|
|
38
|
+
| Days of supply | Current stock / average daily sales rate | Estimate from ordersCount over the product's listing period |
|
|
39
|
+
| Clearance conversion rate | Units sold during clearance / units available at start | Track stock levels before and after campaign |
|
|
40
|
+
| Revenue recovered | Revenue from clearance sales that would not have occurred organically | Compare sales velocity before and during campaign |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Triggers
|
|
45
|
+
|
|
46
|
+
Activate this goal when the merchant expresses any of the following intents:
|
|
47
|
+
|
|
48
|
+
- "clear inventory"
|
|
49
|
+
- "stock mover"
|
|
50
|
+
- "clearance sale"
|
|
51
|
+
- "old inventory"
|
|
52
|
+
- "overstocked"
|
|
53
|
+
- "slow sellers"
|
|
54
|
+
- "dead stock"
|
|
55
|
+
- "excess stock"
|
|
56
|
+
- "move old products"
|
|
57
|
+
- Any request mentioning inventory levels, stock clearance, or product velocity
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Recommended Actions
|
|
62
|
+
|
|
63
|
+
### Primary: Flow: Stock Mover Clearance
|
|
64
|
+
|
|
65
|
+
The sole action for this goal. Identifies slow-moving products using the velocity ratio (ordersCount / quantity) and creates targeted discounts with depth proportional to inventory urgency.
|
|
66
|
+
|
|
67
|
+
**When to use:** Whenever the merchant wants to reduce stock levels for underperforming products.
|
|
68
|
+
|
|
69
|
+
**Key mechanics:**
|
|
70
|
+
- Velocity analysis: products with low ordersCount relative to quantity are clearance candidates
|
|
71
|
+
- Discount depth scales with overstock severity (deeper discounts for more stagnant items)
|
|
72
|
+
- Scope is typically ITEMS (specific slow-moving products) or CATEGORY (if an entire category is underperforming)
|
|
73
|
+
- Margin protection is critical — clearance discounts push closer to cost, so the guardrail must verify effective margin stays above 15%
|
|
74
|
+
|
|
75
|
+
**Product selection criteria:**
|
|
76
|
+
- High quantity + low ordersCount = primary candidates
|
|
77
|
+
- Products with 0 orders in 30+ days = urgent candidates
|
|
78
|
+
- Products approaching seasonal irrelevance = time-sensitive candidates
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Measurement Plan
|
|
83
|
+
|
|
84
|
+
### Before campaign launch
|
|
85
|
+
|
|
86
|
+
1. Record baseline stock levels for all targeted products
|
|
87
|
+
2. Record current sales velocity (ordersCount over last 30 days)
|
|
88
|
+
3. Calculate starting inventory turnover ratio per product
|
|
89
|
+
|
|
90
|
+
### During campaign (weekly check-ins)
|
|
91
|
+
|
|
92
|
+
1. Track units sold per clearance product
|
|
93
|
+
2. Monitor margin impact — clearance discounts erode margins faster than other campaigns
|
|
94
|
+
3. Check if discount depth needs adjustment:
|
|
95
|
+
- Products still not moving after 7 days — consider deepening discount
|
|
96
|
+
- Products clearing too fast — margin may be too generous
|
|
97
|
+
|
|
98
|
+
### After campaign (30-day assessment)
|
|
99
|
+
|
|
100
|
+
1. Calculate clearance rate: `units_sold / starting_stock * 100`
|
|
101
|
+
2. Compare inventory turnover ratio before and after
|
|
102
|
+
3. Calculate revenue recovered from products that had near-zero velocity
|
|
103
|
+
4. Assess carrying cost savings from reduced inventory
|
|
104
|
+
5. Target benchmarks:
|
|
105
|
+
- Clearance rate > 50% = successful
|
|
106
|
+
- Clearance rate < 20% = discount may have been too conservative or products are truly unsellable
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Decision Matrix
|
|
111
|
+
|
|
112
|
+
| Scenario | Approach | Rationale |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| Few specific slow products | ITEMS scope, targeted discounts | Surgical clearance avoids discounting healthy inventory |
|
|
115
|
+
| Entire category underperforming | CATEGORY scope | Broader clearance when the problem is category-wide |
|
|
116
|
+
| Products near zero velocity | Deeper discounts (up to margin floor) | Aggressive clearance justified for truly stagnant stock |
|
|
117
|
+
| Seasonal items approaching end of season | Time-limited clearance with urgency | Combine with end date to create customer urgency |
|
|
118
|
+
| Merchant specifies products or percentages | Honor merchant input | User overrides always take priority |
|