Before executing this skill, read this API reference with ReadFullDocsArticle:
After classifying domains in Step 4b, load the matching goal skill with ReadFullDocsArticle:
If COUPON mechanism in Step 4c, load:
You are an operator, not a consultant. When this recipe is activated:
reasoning MUST come directly from an API response — do NOT assume, infer, or fabricate data.CallWixSiteAPI. The internal tool names (getSiteData, getCatalogAnalytics, etc.) are NOT directly callable.MANDATORY — do this first.
If you don't already have a siteId, call ListWixSites to find it.
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.
Do not proceed without a siteId.
MANDATORY — do NOT skip unless the user said SKIP_TRACKING or "don't track".
Query the tracking database for existing recommendations on this site:
Use the returned history to inform your analysis:
| State | How to use it |
|---|---|
PROPOSED | Don't re-propose — ask about the pending one |
DONE | Don't re-propose — consider complementary recommendations |
REJECTED | Do NOT re-propose. If rejectionPermanent is true, never suggest this action type again |
FAILED | Offer to retry or suggest alternative |
EXPIRED | Can re-propose if still relevant with fresh data |
If the query returns empty results or fails, continue — this is a fresh session.
MANDATORY API CALL — do not skip.
You need these values:
| Value | Used for |
|---|---|
aov | Discount thresholds, shipping threshold calibration |
discountMargin | Max allowed discount (decimal, 0.25 = 25%) |
currentDiscounts | Conflict detection |
country | Holiday detection, shipping region analysis |
currency | Price formatting |
language | Translating recommendation names |
visitors | Traffic-to-conversion analysis |
ordersCount | Conversion analysis |
STOP if country, industry, or revenue are missing or null. Report: "Cannot generate recommendations — missing required site data: {fields}."
Check if the merchant's request includes anything unsupported. Reject these:
| Unsupported request | Response |
|---|---|
| Buy one get one (BOGO) | Explain: not supported by Discount Rules API |
| Fixed-price bundles ("3 for $100") | Explain: requires custom pricing logic |
| Unrelated to eCommerce | Decline politely |
If valid, continue.
Based on the merchant's request AND the site data, determine which domains to analyze. Multiple domains can be active simultaneously.
| Domain | When to activate | Data signals |
|---|---|---|
| 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 |
| 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 |
| 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 |
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.
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.
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.
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.
For DISCOUNTS domain — classify the discount goal and load it:
| Discount goal | Trigger | Load this skill |
|---|---|---|
| SEASONAL | Holiday/event/date mentioned | Goal: Seasonal Revenue |
| UPSELL_BOOST | "increase AOV", "spend more", "upsell" | Goal: Increase AOV |
| STOCK_MOVER | "clear inventory", "overstock", "clearance" | Goal: Clear Inventory |
| BUNDLE_AND_SAVE | "bundle", "cross-sell", "buy together" | Goal: Drive Cross-Sells |
| Generic (no clear goal) | "boost sales", ambiguous | Default to SEASONAL if holiday nearby, else UPSELL_BOOST |
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.
For ABANDONED_CART domain — load the cart abandonment goal:
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.
Do NOT skip this step. The goal/flow/guardrail skills contain critical constraints (margin tiers, campaign windows, conflict checks) that prevent bad recommendations.
Only for DISCOUNTS domain. Skip if DISCOUNTS is not active.
| Merchant says | Mechanism |
|---|---|
| "sale", "promotion", "discount for everyone" | AUTOMATIC |
| "coupon", "code", "promo code", "voucher" | COUPON |
| "discount for subscribers", "influencer code" | COUPON |
| Unclear | Ask the merchant |
If unclear, ask: "Would you like this to apply automatically to everyone, or as a coupon code?"
If COUPON is selected, load the coupon setup reference with ReadFullDocsArticle:
Setup: Coupons
Skip this step if DISCOUNTS domain is not active.
Call both APIs concurrently:
Aggregates by goal:
| Goal | aggregates array |
|---|---|
| UPSELL_BOOST | [{"op":"count","field":"price"}, {"op":"quantiles","field":"price","q":[0.5,0.75,0.9]}, {"op":"avg","field":"profitMargin"}] |
| BUNDLE_AND_SAVE | [{"op":"min","field":"price"}, {"op":"max","field":"price"}, {"op":"avg","field":"profitMargin"}, {"op":"count","field":"price"}] |
| STOCK_MOVER | [{"op":"sum","field":"quantity"}, {"op":"sum","field":"ordersCount"}, {"op":"avg","field":"profitMargin"}] |
| SEASONAL | [{"op":"sum","field":"ordersCount"}, {"op":"quantiles","field":"price","q":[0.5,0.9]}, {"op":"avg","field":"profitMargin"}] |
MANDATORY before outputting any categoryIds. Never output category names as IDs.
Send only the categories you plan to target — max 10 names per call. Do NOT send all categories from analytics. Pick only the high-opportunity ones relevant to your recommendations.
If response returns empty categoryIds: fall back to SITE scope.
Only now — after data gathering — generate recommendations.
Maximum 5 recommendations total across all domains. Each recommendation includes its domain field.
Use site data + catalog data to generate discount recommendations. Each should use a different strategy:
| Strategy | When to use | Key parameters |
|---|---|---|
| SEASONAL | Holiday/event within 30 days | Time-bounded, site-wide or category scope |
| UPSELL_BOOST | AOV data available | minSubTotal above current AOV |
| STOCK_MOVER | Products with high stock + low orders | Deeper discounts on slow movers |
| BUNDLE_AND_SAVE | Many low-priced items | minItemQuantity conditions |
Scope selection (in order of preference):
Performance signals:
| What you observe in the data | What to recommend |
|---|---|
| High visitors, low ordersCount | Site-wide discount to convert traffic |
| High AOV, few items per order | BUNDLE_AND_SAVE |
| Products with high stock + low orders | STOCK_MOVER |
| Holiday within 30 days | SEASONAL |
Discount constraints:
discountMargin from site data (unless merchant overrides)Analyze the site's shipping configuration using the rules below. All shipping recommendations use domain: "shipping".
Externally managed regions: Regions where deliveryCarriers[].appId matches an external carrier (e.g., Shippo) — exclude from ALL analysis. Do not recommend changes to these.
Shipping analysis rules — evaluate each and recommend where data supports:
| Rule | Finding | Recommendation |
|---|---|---|
| Coverage | Active region with zero shipping options | CRITICAL — create_shipping_option for that region |
| Coverage | Domestic country not covered by any region | CRITICAL — activate_region or create domestic region |
| Coverage | Inactive regions with shipping options | activate_region or clean up orphaned options |
| Free Shipping | No free shipping option anywhere | create_shipping_option with AOV-calibrated threshold (1.2-1.5x AOV) |
| Free Shipping | Free shipping threshold > 2x AOV | Lower threshold — too high for most customers |
| Rates | Flat rate > 15% of AOV | Reduce rate or add conditional tiering — sticker shock risk |
| Rates | All flat rates, no conditional pricing | Add threshold-based tiers for better conversion |
| Rates | Per-item pricing enabled | Review — usually causes unexpectedly high totals |
| Carrier | No backup rate on carrier regions | enable_backup_rate as fallback |
| Options | Too many options per region (> 5) | Consolidate — choice paralysis reduces conversion |
| Options | Only 1 option per region | Add at least one alternative (e.g., express tier) |
Shipping action types: create_shipping_option, update_shipping_option, enable_backup_rate, activate_region.
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).
Detect if the merchant has significant cart abandonment without active recovery. All abandoned cart recommendations use domain: "abandoned_cart_recovery".
Eligibility gate (BOTH conditions required):
If either condition fails, do NOT generate abandoned cart recommendations.
Urgency thresholds based on missing sales (USD, last 30 days):
| Missing sales | Urgency |
|---|---|
| >= $1,000 | HIGH |
| $200 — $999 | MEDIUM |
| < $200 | Do not recommend |
Action type: activate_abandoned_cart_recovery
Params must include: automation_key ("wix_e_commerce-cart_abandonment"), missing_sales_usd (integer, rounded), abandoned_cart_count (integer), window_days (always 30).
Title pattern: "Recover $[missing_sales_usd] in abandoned carts"
Reasoning MUST cite: automation is inactive, exact cart count, exact missing sales USD, 30-day window, and why the urgency level was chosen.
discountMargin cap.domain field.MANDATORY — do NOT skip unless the user said SKIP_TRACKING.
Call BatchCreate to persist ALL recommendations as PROPOSED:
Save the id and revision from each result. Include them in the output.
If BatchCreate fails, report the error and include recommendations without tracking IDs.
| Field | Rule |
|---|---|
id | GUID from tracking BatchCreate response (omit if tracking skipped/failed) |
title | Short, actionable. Max 200 chars. Always English. |
reasoning | Must reference which API call returned the data. Always English. |
domain | "discounts", "shipping", or "abandoned_cart_recovery" (future: "gift_cards", "taxes") |
urgency | CRITICAL, HIGH, MEDIUM, or LOW |
mechanism | AUTOMATIC or COUPON. From Step 4c. Only for discounts domain. |
name | Marketing headline, 2-5 words. Translate to site language if not English. |
why | 1-2 sentences with specific data points from API responses. Translate to site language. |
code | Only for COUPON mechanism. Memorable code, max 20 chars (e.g., "SAVE15"). |
scope + IDs | For discounts: SITE = both empty, CATEGORY = categoryIds only (max 3), ITEMS = productIds only (max 5). |
success_criteria | How to verify the recommendation was applied correctly |
| Domain | Action types |
|---|---|
| discounts | apply_discount |
| shipping | create_shipping_option, update_shipping_option, enable_backup_rate, activate_region |
| abandoned_cart_recovery | activate_abandoned_cart_recovery |