Flow: Seasonal Promotion

Download skillThe skill is a reference md and part of wix-manage skill. You can use the following command to add the full wix-manage skill to your project:
Copy

Before executing this skill, read these referenced skills with ReadFullDocsArticle:

Creates event-driven promotional discounts tied to holidays, shopping events, or seasonal milestones. The flow identifies upcoming events based on the site's country and current date, calculates optimal campaign start/end windows, and targets event-relevant product categories with appropriately sized discounts.

Prerequisites

  • Wix Stores installed on the site
  • Products exist in the catalog
  • Access to getCatalogAnalytics, getProductCatalogData, and getSiteData tools
  • current_date available for event scheduling
  • Site country known for region-specific event mapping

Required APIs


Step 1: Identify upcoming event

Use current_date and the site's country (from getSiteData) to identify major holidays or shopping events within the next 30 days.

Common event calendar

EventTypical DateRegionsEvent-relevant categories
Valentine's DayFebruary 14GlobalGifts, Jewelry, Flowers, Fashion
Mother's Day2nd Sunday in May (US), March (UK)Varies by countryGifts, Home & Garden, Jewelry
Father's Day3rd Sunday in June (US)Varies by countryElectronics, Tools, Fashion
Back to SchoolAugust-SeptemberUS, GlobalSchool supplies, Kids, Fashion
Black Friday4th Friday in NovemberUS, spreading globallyElectronics, Fashion, All categories
Cyber MondayMonday after Black FridayUS, spreading globallyElectronics, Tech, All categories
ChristmasDecember 25Global (Christian-majority)Gifts, Toys, Fashion, Home
Boxing DayDecember 26UK, Canada, AustraliaAll categories (clearance)
New Year SaleJanuary 1-7GlobalAll categories (clearance)
Singles' DayNovember 11China, spreading globallyFashion, Electronics, Beauty

If no event is within 30 days, inform the merchant and suggest either a general seasonal promotion or waiting for the next event.


Step 2: Calculate campaign window

Determine the optimal start and end dates for the campaign based on the event date.

Window calculation rules

  • Start date: 3-5 days before the event date.
  • End date: 1-3 days after the event (or through the following Tuesday for weekend events).
  • IMPORTANT: If the calculated start date is before current_date, set start to current_date. Never schedule a campaign to start in the past.

Examples

EventEvent DateStartEndNotes
Valentine's DayFeb 14 (Saturday)Feb 10 (Tuesday)Feb 16 (Monday)Through the weekend after
Black FridayNov 27 (Friday)Nov 23 (Monday)Dec 1 (Tuesday)Start Monday, end following Tuesday (covers Cyber Monday)
Cyber MondayNov 30 (Monday)Nov 28 (Saturday)Dec 1 (Tuesday)Often combined with Black Friday window
ChristmasDec 25 (Thursday)Dec 20 (Saturday)Dec 27 (Saturday)Start ~5 days before, include Boxing Day
Mother's DayMay 10 (Sunday)May 6 (Wednesday)May 11 (Monday)Through the day after

Combined events

For Black Friday + Cyber Monday, use a single extended window: start the preceding Monday/Tuesday, end the following Tuesday. Do not create two separate discount rules.


Step 3: Gather catalog data

Call getCatalogAnalytics and getProductCatalogData concurrently.

getCatalogAnalytics call:

Copy

getProductCatalogData call:

Copy

This sort order surfaces the best-selling products first — seasonal campaigns should lead with proven sellers to maximize revenue.

Save the following values:

  • total_orders — overall sales volume
  • price_p50, price_p90 — price distribution for discount sizing
  • avg_profit_margin — sets discount ceiling
  • Top products by sales volume

Step 4: Focus on event-relevant categories

Map the identified event to relevant product categories:

EventPriority CategoriesFallback
Valentine's DayGifts, Jewelry, Flowers, FashionSite-wide
Black Friday / Cyber MondayElectronics, Fashion, HomeSite-wide (broad event)
ChristmasGifts, Toys, Home Decor, FashionSite-wide
Back to SchoolSchool Supplies, Kids, FashionSite-wide
Mother's Day / Father's DayGifts, relevant verticalsSite-wide

If the merchant's catalog matches an event-relevant category, target that category specifically. If no clear match exists, use site-wide scope.


Step 5: Create campaign name

Build a compelling campaign name using the event/period name:

EventExample Campaign Names
Black Friday"Black Friday Flash Deal", "Black Friday Blowout"
Cyber Monday"Cyber Monday Special", "Cyber Monday Deals"
Christmas"Holiday Season Sale", "Christmas Gift Sale"
Valentine's Day"Valentine's Day Special", "Love Day Sale"
New Year"New Year Clearance", "Fresh Start Sale"
Generic seasonal"Spring Sale", "Summer Savings", "Fall Collection Sale"

Keep names concise and recognizable. The name is internal (not shown to customers in checkout) but helps merchants manage their promotions.


Step 6: Determine discount scope

  • CATEGORY (preferred for event-relevant promotions): Target the event-relevant category with the highest margin and product count.
  • SITE (for broad events): Use for events like Black Friday where the expectation is store-wide deals.

Avoid ITEMS scope for seasonal campaigns — seasonal promotions are typically broad rather than targeting individual products.


Step 7: Convert category names to GUIDs (if CATEGORY scope)

If scope is CATEGORY, call getCategoryIds to convert category names to GUIDs.

  • Never use category names as scope IDs — always use the GUID.
  • Exclude the "All Products" system category.
  • Max 3 categoryIds per discount rule.

Step 8: Run guardrail checks

Run the Guardrail: Discount Conflicts checks before creating the rule.

  1. Query existing active discount rules:

Endpoint: POST https://www.wixapis.com/ecom/v1/discount-rules/query

Request:

Copy
  1. Check for time overlap — seasonal promotions have defined windows, so check that no existing rule covers the same period on the same scope.
  2. Check for scope overlap — a seasonal category discount stacking with an existing catalog-wide discount could create unexpectedly deep combined discounts.
  3. Check for coupon stacking — seasonal events often have high coupon usage.
  4. If conflicts found, present to merchant and get confirmation.

Step 9: Create the discount rule with campaign window

Endpoint: POST https://www.wixapis.com/ecom/v1/discount-rules

Request — Black Friday 20% off electronics category, Monday-Tuesday window:

Copy

Response:

Copy

Request — Valentine's Day site-wide 15% off:

Copy

Save the returned id and revision for later management.


Step 10: Verify and remind about deactivation

  1. Query discount rules to confirm the new rule exists and is active: true

  2. Verify the activeTimeInfo window is correctly set

  3. Report to the merchant:

    "{Campaign name} is live: {discount}% off {scope description} from {start_date} to {end_date}. The discount will apply automatically at checkout during this window."

  4. IMPORTANT — Deactivation reminder: There is no native auto-deactivation in Wix discount rules. Even though activeTimeInfo.end is set, the rule remains in the system after expiration. Remind the merchant:

    "Note: After {end_date}, the discount will no longer apply at checkout, but the rule will remain active in your dashboard. You may want to deactivate or delete it after the promotion ends to keep your discount rules tidy."


Branching logic

Merchant intentEventScopeWindow
"Run a Black Friday sale"Black FridayElectronics/Fashion CATEGORY or SITEMon before through following Tue
"Valentine's promotion on gifts"Valentine's DayGifts CATEGORY3-5 days before through day after
"Christmas sale on everything"ChristmasCATALOG (site-wide)~5 days before through Dec 26
"Seasonal promotion" (generic)Next upcoming event for site's countryDetermined by analyticsStandard 3-5 day lead, 1-3 day tail
"30% off for Cyber Monday" (explicit)Cyber MondayAs specifiedUser-defined or standard window
No event within 30 daysNoneN/AInform merchant; suggest general promotion instead

Error Handling

ErrorCauseFix
DISCOUNT_RULE_NOT_FOUNDRule ID doesn't existRe-query discount rules for current IDs
REVISION_MISMATCHRevision doesn't matchRe-fetch rule for latest revision, then retry
No upcoming eventNo major holiday within 30 days of current_dateInform merchant; suggest a general promotion or ask for a specific event
Start date in the pastCalculated start < current_dateSet start to current_date
Country not availableSite country unknown from getSiteDataUse global events (Black Friday, Christmas) as fallback
Category GUID not foundEvent-relevant category doesn't exist in merchant's catalogFall back to SITE scope
Time conflict with existing ruleAnother seasonal promotion overlaps the same windowPresent conflict; suggest adjusting window or deactivating the existing rule

References

Did this help?