@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.
Files changed (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/package.json +29 -0
  4. package/skills/wix-app/SKILL.md +344 -0
  5. package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
  6. package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
  7. package/skills/wix-app/references/APP_VALIDATION.md +171 -0
  8. package/skills/wix-app/references/BACKEND_API.md +233 -0
  9. package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
  10. package/skills/wix-app/references/CODE_QUALITY.md +33 -0
  11. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
  12. package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
  13. package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
  14. package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
  15. package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
  16. package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
  17. package/skills/wix-app/references/DOCUMENTATION.md +42 -0
  18. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
  19. package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
  20. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
  21. package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
  22. package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
  23. package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
  24. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
  25. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
  26. package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
  27. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
  28. package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
  29. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
  30. package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
  31. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
  32. package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
  33. package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
  34. package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
  35. package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
  36. package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
  37. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
  38. package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
  39. package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
  40. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
  41. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
  42. package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
  43. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
  44. package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
  45. package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
  46. package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
  47. package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
  48. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
  49. package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
  50. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
  51. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
  52. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
  53. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
  54. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
  55. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
  56. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
  57. package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
  58. package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
  59. package/skills/wix-design-system/SKILL.md +129 -0
  60. package/skills/wix-design-system/references/file-structure.md +56 -0
  61. package/skills/wix-design-system/scripts/wds.cjs +531 -0
  62. package/skills/wix-headless/SKILL.md +418 -0
  63. package/skills/wix-headless/references/DISCOVERY.md +332 -0
  64. package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
  65. package/skills/wix-headless/references/SETUP.md +154 -0
  66. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
  67. package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
  68. package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
  69. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
  70. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
  71. package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
  72. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
  73. package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
  74. package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
  75. package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
  76. package/skills/wix-headless/references/commands/install-app.md +42 -0
  77. package/skills/wix-headless/references/commands/known-apps.json +5 -0
  78. package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
  79. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
  80. package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
  81. package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
  82. package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
  83. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
  84. package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
  85. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
  86. package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
  87. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
  88. package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
  89. package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
  90. package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
  91. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
  92. package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
  93. package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
  94. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
  95. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
  96. package/skills/wix-headless/references/shared/STYLING.md +117 -0
  97. package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
  98. package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
  99. package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
  100. package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
  101. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
  102. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
  103. package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
  104. package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
  105. package/skills/wix-headless/references/verticals/_schema.json +160 -0
  106. package/skills/wix-headless/references/verticals/_schema.md +185 -0
  107. package/skills/wix-headless/references/verticals/blog.md +125 -0
  108. package/skills/wix-headless/references/verticals/cms.md +121 -0
  109. package/skills/wix-headless/references/verticals/ecom.md +96 -0
  110. package/skills/wix-headless/references/verticals/forms.md +106 -0
  111. package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
  112. package/skills/wix-headless/references/verticals/stores.md +167 -0
  113. package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
  114. package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
  115. package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
  116. package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
  117. package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
  118. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
  119. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
  120. package/skills/wix-headless/scripts/preview.sh +45 -0
  121. package/skills/wix-headless/scripts/release.sh +73 -0
  122. package/skills/wix-headless/scripts/scaffold.sh +53 -0
  123. package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
  124. package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
  125. package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
  126. package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
  127. package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
  128. package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
  129. package/skills/wix-headless/templates/ecom/cart.astro +13 -0
  130. package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
  131. package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
  132. package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
  133. package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
  134. package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
  135. package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
  136. package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
  137. package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
  138. package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
  139. package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
  140. package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
  141. package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
  142. package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
  143. package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
  144. package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
  145. package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
  146. package/skills/wix-headless/templates/stores/categories.ts +155 -0
  147. package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
  148. package/skills/wix-headless/templates/stores/components-stores.css +295 -0
  149. package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
  150. package/skills/wix-headless/templates/stores/products/index.astro +101 -0
  151. package/skills/wix-manage/SKILL.md +280 -0
  152. package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
  153. package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
  154. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
  155. package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
  156. package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
  157. package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
  158. package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
  159. package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
  160. package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
  161. package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
  162. package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
  163. package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
  164. package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
  165. package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
  166. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
  167. package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
  168. package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
  169. package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
  170. package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
  171. package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
  172. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
  173. package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
  174. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
  175. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
  176. package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
  177. package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
  178. package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
  179. package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
  180. package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
  181. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
  182. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
  183. package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
  184. package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
  185. package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
  186. package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
  187. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
  188. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
  189. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
  190. package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
  191. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
  192. package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
  193. package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
  194. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
  195. package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
  196. package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
  197. package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
  198. package/skills/wix-manage/references/events/list-events.md +203 -0
  199. package/skills/wix-manage/references/forms/create-form.md +260 -0
  200. package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
  201. package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
  202. package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
  203. package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
  204. package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
  205. package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
  206. package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
  207. package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
  208. package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
  209. package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
  210. package/skills/wix-manage/references/sites/query-sites.md +125 -0
  211. package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
  212. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
  213. package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
  214. package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
  215. package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
  216. package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
  217. package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
  218. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
  219. package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
  220. package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
@@ -0,0 +1,420 @@
1
+ ---
2
+ name: "API: Recommendation Tracking"
3
+ description: CRUD API for persisting and managing the lifecycle of AI-generated recommendations. Tracks state transitions from PROPOSED through APPROVED, EXECUTING, to DONE/FAILED/REJECTED. Every recommendation must be persisted here before presenting to the merchant.
4
+ layer: config
5
+ ---
6
+ # API: Recommendation Tracking Service
7
+
8
+ This service persists recommendations in a database and tracks their lifecycle state. Every recommendation generated by any domain (discounts, shipping, etc.) **MUST** be persisted here before being presented to the merchant.
9
+
10
+ **Service**: `wix.ecom.agentic.recommendations.v1.AgenticRecommendationsService`
11
+
12
+ **Base URL**: `https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations`
13
+
14
+ ## How to call these APIs
15
+
16
+ Use `CallWixSiteAPI` to invoke each endpoint:
17
+
18
+ ```
19
+ CallWixSiteAPI(
20
+ url: "https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/<endpoint>",
21
+ method: "POST",
22
+ body: { ... }
23
+ )
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Data Model
29
+
30
+ ### Recommendation
31
+
32
+ | Field | Type | Access | Description |
33
+ |---|---|---|---|
34
+ | `id` | string (GUID) | readOnly | Auto-generated unique identifier |
35
+ | `revision` | int64 | readOnly | Optimistic lock — must match current value for state transitions |
36
+ | `createdDate` | Timestamp | readOnly | When the recommendation was created |
37
+ | `updatedDate` | Timestamp | readOnly | When the recommendation was last updated |
38
+ | `title` | string | writable | Short human-readable title (max 200 chars) |
39
+ | `reasoning` | string | writable | Why this recommendation is being made, citing specific data (max 2000 chars) |
40
+ | `domain` | string | writable | Business domain: `"shipping"`, `"discounts"`, etc. (max 50 chars) |
41
+ | `urgency` | enum | writable | `CRITICAL`, `HIGH`, `MEDIUM`, or `LOW` |
42
+ | `advice` | Advice | writable | The action to take (see below) |
43
+ | `state` | enum | readOnly | Current lifecycle state (see State Machine) |
44
+ | `expiresAt` | Timestamp | writable | When the recommendation auto-expires |
45
+ | `conversationId` | string (GUID) | writable | Links all recommendations in a session |
46
+ | `decidedBy` | string | readOnly | Who made the last state transition |
47
+ | `rejectionReason` | string | readOnly | Reason for rejection (max 1000 chars) |
48
+ | `rejectionPermanent` | boolean | readOnly | If true, this action type is permanently blocked for this site |
49
+ | `executionResult` | ExecutionResult | readOnly | Result of execution (set on DONE/FAILED) |
50
+
51
+ ### Advice
52
+
53
+ | Field | Type | Description |
54
+ |---|---|---|
55
+ | `action` | string | Action identifier (e.g., `"apply_discount"`, `"create_shipping_option"`) (max 100 chars) |
56
+ | `params` | object | Domain-specific parameters (discount config, shipping option details, etc.) |
57
+ | `successCriteria` | string | How to verify the action succeeded (max 500 chars) |
58
+
59
+ ### ExecutionResult
60
+
61
+ | Field | Type | Description |
62
+ |---|---|---|
63
+ | `status` | enum | `SUCCESS`, `PARTIAL_FAILURE`, or `FAILURE` |
64
+ | `summary` | string | Description of what happened (max 2000 chars) |
65
+ | `error` | string | Error message if failed (max 2000 chars) |
66
+ | `resultPayload` | object | Additional result data |
67
+
68
+ ---
69
+
70
+ ## State Machine
71
+
72
+ ```
73
+ PROPOSED → APPROVED → EXECUTING → DONE
74
+ │ └──→ FAILED
75
+ ├──→ REJECTED
76
+ └──→ EXPIRED (scheduler)
77
+ ```
78
+
79
+ | From | To | Trigger | API Method |
80
+ |---|---|---|---|
81
+ | — | PROPOSED | Recommendation created | BatchCreate / Create |
82
+ | PROPOSED | APPROVED | Merchant approves | Approve |
83
+ | PROPOSED | REJECTED | Merchant rejects | Reject |
84
+ | PROPOSED | EXPIRED | `expiresAt` passed | Automatic (scheduler) |
85
+ | PROPOSED | PROPOSED | Merchant modifies parameters | Update (state unchanged) |
86
+ | APPROVED | EXECUTING | Execution begins | MarkExecuting |
87
+ | EXECUTING | DONE | Execution succeeded | MarkDone |
88
+ | EXECUTING | FAILED | Execution failed | MarkFailed |
89
+
90
+ ---
91
+
92
+ ## BatchCreate
93
+
94
+ Creates multiple recommendations (1-100) atomically. All start in PROPOSED state. **Use this as the default** — always batch recommendations together.
95
+
96
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/batch-create`
97
+
98
+ **Request**:
99
+ ```json
100
+ {
101
+ "agenticRecommendations": [
102
+ {
103
+ "title": "15% Off Electronics — Orders Over $200",
104
+ "reasoning": "AOV is $165. Electronics avg margin 42%. $200 threshold incentivizes adding one more item.",
105
+ "domain": "discounts",
106
+ "urgency": "HIGH",
107
+ "advice": {
108
+ "action": "apply_discount",
109
+ "params": {
110
+ "mechanism": "AUTOMATIC",
111
+ "scope": "CATEGORY",
112
+ "discountType": "PERCENTAGE",
113
+ "discount": 15,
114
+ "conditions": { "minSubTotal": 200 }
115
+ },
116
+ "successCriteria": "15% discount applied to Electronics for orders above $200"
117
+ }
118
+ }
119
+ ],
120
+ "conversationId": "<conversationId>"
121
+ }
122
+ ```
123
+
124
+ **Response**:
125
+ ```json
126
+ {
127
+ "results": [
128
+ {
129
+ "agenticRecommendation": {
130
+ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
131
+ "revision": "1",
132
+ "state": "PROPOSED",
133
+ "title": "15% Off Electronics — Orders Over $200",
134
+ "reasoning": "...",
135
+ "domain": "discounts",
136
+ "urgency": "HIGH",
137
+ "advice": { "..." : "..." },
138
+ "conversationId": "...",
139
+ "createdDate": "2026-05-10T10:00:00Z",
140
+ "updatedDate": "2026-05-10T10:00:00Z"
141
+ }
142
+ }
143
+ ]
144
+ }
145
+ ```
146
+
147
+ **Important**: Save the `id` and `revision` from each result — you need them for all subsequent state transitions.
148
+
149
+ ---
150
+
151
+ ## Create
152
+
153
+ Creates a single recommendation in PROPOSED state. Prefer BatchCreate for multiple recommendations.
154
+
155
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations`
156
+
157
+ **Request**:
158
+ ```json
159
+ {
160
+ "agenticRecommendation": {
161
+ "title": "Add Free Shipping for Orders Over $75",
162
+ "reasoning": "No free shipping option. delivery_step_cvr is 48%, below 65% benchmark. AOV is $62.",
163
+ "domain": "shipping",
164
+ "urgency": "HIGH",
165
+ "advice": {
166
+ "action": "create_shipping_option",
167
+ "params": {
168
+ "category": "free_shipping",
169
+ "ids": ["region-guid"],
170
+ "rates": [{ "amount": "0", "conditions": [{ "type": "BY_TOTAL_PRICE", "operator": "GTE", "value": "75" }] }]
171
+ },
172
+ "successCriteria": "Free shipping option created for orders above $75"
173
+ },
174
+ "conversationId": "<conversationId>"
175
+ }
176
+ }
177
+ ```
178
+
179
+ **Response**: Single `agenticRecommendation` object with `id`, `revision`, and `state: "PROPOSED"`.
180
+
181
+ ---
182
+
183
+ ## Query
184
+
185
+ Query recommendations by conversation ID, state, or domain. Returns paginated results.
186
+
187
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/query`
188
+
189
+ **Request**:
190
+ ```json
191
+ {
192
+ "query": {
193
+ "filter": {
194
+ "conversationId": "<conversationId>",
195
+ "state": { "$in": ["PROPOSED", "APPROVED"] }
196
+ },
197
+ "cursorPaging": { "limit": 50 }
198
+ }
199
+ }
200
+ ```
201
+
202
+ **Filterable fields**: `conversationId`, `state`, `domain`, `urgency`, `id`
203
+
204
+ **Response**:
205
+ ```json
206
+ {
207
+ "agenticRecommendations": [
208
+ {
209
+ "id": "a1b2c3d4-...",
210
+ "revision": "1",
211
+ "state": "PROPOSED",
212
+ "title": "...",
213
+ "domain": "discounts",
214
+ "urgency": "HIGH",
215
+ "advice": { "..." : "..." }
216
+ }
217
+ ],
218
+ "pagingMetadata": { "count": 1, "cursors": {}, "hasNext": false }
219
+ }
220
+ ```
221
+
222
+ ---
223
+
224
+ ## Get
225
+
226
+ Fetch a single recommendation by ID.
227
+
228
+ **Endpoint**: `GET https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}`
229
+
230
+ **Response**: Single `agenticRecommendation` object with all fields.
231
+
232
+ ---
233
+
234
+ ## Count
235
+
236
+ Get recommendation counts grouped by state for the current site.
237
+
238
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/count`
239
+
240
+ **Request**: `{}`
241
+
242
+ **Response**:
243
+ ```json
244
+ {
245
+ "counts": {
246
+ "PROPOSED": 3,
247
+ "APPROVED": 1,
248
+ "EXECUTING": 0,
249
+ "DONE": 5,
250
+ "FAILED": 1,
251
+ "REJECTED": 2
252
+ }
253
+ }
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Update
259
+
260
+ Update a PROPOSED recommendation. Only `title`, `reasoning`, `urgency`, `advice`, and `expiresAt` can be updated. State stays PROPOSED.
261
+
262
+ **Endpoint**: `PATCH https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}`
263
+
264
+ **Request**:
265
+ ```json
266
+ {
267
+ "agenticRecommendation": {
268
+ "id": "a1b2c3d4-...",
269
+ "revision": "1",
270
+ "advice": {
271
+ "action": "apply_discount",
272
+ "params": { "discount": 20 },
273
+ "successCriteria": "20% discount applied"
274
+ }
275
+ },
276
+ "fieldMask": { "paths": ["advice"] }
277
+ }
278
+ ```
279
+
280
+ **Response**: Updated `agenticRecommendation` with incremented `revision`.
281
+
282
+ **Constraint**: Only works on PROPOSED recommendations. Non-PROPOSED returns INVALID_STATE_TRANSITION.
283
+
284
+ ---
285
+
286
+ ## Approve
287
+
288
+ PROPOSED → APPROVED. Call when the merchant agrees with a recommendation.
289
+
290
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/approve`
291
+
292
+ **Request**:
293
+ ```json
294
+ {
295
+ "revision": "1"
296
+ }
297
+ ```
298
+
299
+ **Response**: Updated `agenticRecommendation` with `state: "APPROVED"` and incremented `revision`.
300
+
301
+ ---
302
+
303
+ ## Reject
304
+
305
+ PROPOSED → REJECTED. Call when the merchant declines.
306
+
307
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/reject`
308
+
309
+ **Request**:
310
+ ```json
311
+ {
312
+ "revision": "1",
313
+ "reason": "Merchant prefers flat-rate discount instead",
314
+ "permanent": false
315
+ }
316
+ ```
317
+
318
+ | Field | Type | Required | Description |
319
+ |---|---|---|---|
320
+ | `revision` | int64 | Yes | Current revision for optimistic locking |
321
+ | `reason` | string | No | Why the merchant rejected (max 1000 chars) |
322
+ | `permanent` | boolean | No | If true, permanently blocks this action type for this site |
323
+
324
+ **Response**: Updated `agenticRecommendation` with `state: "REJECTED"`.
325
+
326
+ ---
327
+
328
+ ## MarkExecuting
329
+
330
+ APPROVED → EXECUTING. Call immediately before applying the recommendation.
331
+
332
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/mark-executing`
333
+
334
+ **Request**:
335
+ ```json
336
+ {
337
+ "revision": "2"
338
+ }
339
+ ```
340
+
341
+ **Response**: Updated `agenticRecommendation` with `state: "EXECUTING"` and incremented `revision`.
342
+
343
+ ---
344
+
345
+ ## MarkDone
346
+
347
+ EXECUTING → DONE. Call after the recommendation was successfully applied.
348
+
349
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/mark-done`
350
+
351
+ **Request**:
352
+ ```json
353
+ {
354
+ "revision": "3",
355
+ "executionResult": {
356
+ "status": "SUCCESS",
357
+ "summary": "Created 15% discount rule for Electronics with $200 minimum"
358
+ }
359
+ }
360
+ ```
361
+
362
+ **Response**: Updated `agenticRecommendation` with `state: "DONE"` and `executionResult`.
363
+
364
+ ---
365
+
366
+ ## MarkFailed
367
+
368
+ EXECUTING → FAILED. Call when execution fails.
369
+
370
+ **Endpoint**: `POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/mark-failed`
371
+
372
+ **Request**:
373
+ ```json
374
+ {
375
+ "revision": "3",
376
+ "executionResult": {
377
+ "status": "FAILURE",
378
+ "summary": "Failed to create discount rule",
379
+ "error": "REVISION_MISMATCH: discount rule was modified by another process"
380
+ }
381
+ }
382
+ ```
383
+
384
+ **Response**: Updated `agenticRecommendation` with `state: "FAILED"` and `executionResult`.
385
+
386
+ ---
387
+
388
+ ## Error Codes
389
+
390
+ | Error | HTTP | Meaning |
391
+ |---|---|---|
392
+ | RECOMMENDATION_SUPPRESSED | 400 | Action + site blocked by permanent rejection |
393
+ | INVALID_STATE_TRANSITION | 400 | Wrong source state for the requested transition |
394
+ | VERSION_MISMATCH | 400 | Optimistic lock conflict — re-fetch and retry |
395
+ | RECOMMENDATION_NOT_FOUND | 404 | ID doesn't exist |
396
+
397
+ On VERSION_MISMATCH: Query to get the latest revision, then retry the operation with the updated revision.
398
+
399
+ ---
400
+
401
+ ## Integration pattern for all recommendation flows
402
+
403
+ Every recommendation flow MUST follow this lifecycle:
404
+
405
+ ```
406
+ Step 1: Generate recommendations (domain-specific analysis)
407
+ Step 2: BatchCreate → persist ALL recommendations as PROPOSED (save id + revision for each)
408
+ Step 3: Present recommendations to merchant (include id + revision)
409
+ Step 4: On each merchant action:
410
+ - APPROVE: Approve → MarkExecuting → apply the change → MarkDone or MarkFailed
411
+ - REJECT: Reject (with reason, permanent flag)
412
+ - MODIFY: Update (field mask) → stays PROPOSED → re-present
413
+ ```
414
+
415
+ **Rules**:
416
+ - Every recommendation MUST be persisted before presenting to the merchant
417
+ - Always use the latest `revision` from the previous API response
418
+ - Track ALL outcomes — both success (MarkDone) and failure (MarkFailed)
419
+ - On VERSION_MISMATCH: re-fetch with Query, get latest revision, retry
420
+ - Never skip the EXECUTING state — always call MarkExecuting before applying
@@ -0,0 +1,267 @@
1
+ ---
2
+ name: "Flow: Add Free Shipping"
3
+ description: Creates a free shipping option with an AOV-calibrated threshold to reduce cart abandonment and increase average order value. Validates threshold against catalog price distribution.
4
+ layer: flow
5
+ references:
6
+ - name: "Guardrail: Rate Pricing Sanity"
7
+ path: ecommerce/guardrail-rate-pricing-sanity.md
8
+ load: true
9
+ - name: "Setup: Shipping Rates"
10
+ path: ecommerce/setup-shipping-rates.md
11
+ load: true
12
+ ---
13
+ # Flow: Add Free Shipping
14
+
15
+ > **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
16
+ > - [Guardrail: Rate Pricing Sanity](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-rate-pricing-sanity)
17
+ > - [Setup: Shipping Rates](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/setup-shipping-rates)
18
+
19
+ Adds a free shipping option with an optimal threshold calibrated against the site's average order value and catalog price distribution. Free shipping is the single most effective lever for reducing cart abandonment at the delivery step.
20
+
21
+ ## Prerequisites
22
+
23
+ - Wix Stores (or another eCommerce business solution) installed on the site
24
+ - Site metrics available (revenue, ordersCount) for AOV calculation
25
+ - Catalog stats available (price quantiles) for threshold calibration
26
+ - At least one active delivery region configured
27
+
28
+ ## Required APIs
29
+
30
+ - [Query Shipping Options](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/shipping-options/query-shipping-options)
31
+ - [Create Shipping Option](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/shipping-options/create-shipping-option)
32
+ - [Update Shipping Option](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/shipping-options/update-shipping-option)
33
+ - [Query Delivery Profiles](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/delivery-profiles/query-delivery-profiles)
34
+
35
+ ---
36
+
37
+ ## Step 1: Check for existing free shipping
38
+
39
+ Query all shipping options and check if free shipping already exists.
40
+
41
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/shipping-options/query`
42
+
43
+ **Request**:
44
+ ```json
45
+ {
46
+ "query": {
47
+ "cursorPaging": {
48
+ "limit": 100
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ Scan the response for any option matching either condition:
55
+ - `rates[].amount` equals `"0"`
56
+ - `title` contains "free" (case-insensitive match)
57
+
58
+ If free shipping already exists, proceed to Step 2 (threshold calibration check). If no free shipping exists, skip to Step 3.
59
+
60
+ ---
61
+
62
+ ## Step 2: Validate existing free shipping threshold
63
+
64
+ If a free shipping option already exists, extract its threshold and validate it.
65
+
66
+ ### 2a: Extract the threshold
67
+
68
+ Find the `BY_TOTAL_PRICE` `GTE` condition value from the free rate's `conditions[]` array.
69
+
70
+ Example rate with threshold:
71
+ ```json
72
+ {
73
+ "amount": "0",
74
+ "multiplyByQuantity": false,
75
+ "conditions": [
76
+ {
77
+ "type": "BY_TOTAL_PRICE",
78
+ "operator": "GTE",
79
+ "value": "75"
80
+ }
81
+ ]
82
+ }
83
+ ```
84
+
85
+ If there is no condition (unconditional free shipping), note this but do not flag it as an error -- the merchant may intentionally offer free shipping on all orders.
86
+
87
+ ### 2b: Evaluate threshold against AOV
88
+
89
+ | Condition | Diagnosis | Recommendation |
90
+ |---|---|---|
91
+ | `threshold > AOV x 2` | Too high -- customers rarely qualify for free shipping | Lower the threshold to `AOV x 1.2` |
92
+ | `threshold < AOV x 0.8` | Too low -- margin erosion risk, most orders qualify automatically | Raise the threshold to `AOV x 1.2` |
93
+ | `AOV x 0.8 <= threshold <= AOV x 2` | Acceptable range | No change needed |
94
+
95
+ If the threshold needs adjustment, update the shipping option via PATCH (see Step 5 for the update pattern).
96
+
97
+ ---
98
+
99
+ ## Step 3: Run AOV sanity check
100
+
101
+ Before calculating a threshold, validate that AOV is reliable by comparing it against catalog price distribution.
102
+
103
+ ### 3a: Get catalog price statistics
104
+
105
+ Use the catalog stats to retrieve price quantiles for the "All Products" category group:
106
+ - `price_p25` -- 25th percentile product price
107
+ - `price_p50` -- 50th percentile (median) product price
108
+ - `price_p75` -- 75th percentile product price
109
+ - `price_p90` -- 90th percentile product price
110
+
111
+ ### 3b: Determine effective_aov
112
+
113
+ | Condition | Interpretation | Action |
114
+ |---|---|---|
115
+ | `AOV < price_p25` | Anomalous -- AOV is below 75% of product prices | Override: use `price_p50` as `effective_aov` |
116
+ | `AOV > price_p90` | Possible bulk/combo orders | Use AOV but note the discrepancy |
117
+ | `price_p25 <= AOV <= price_p90` | Reasonable | Use AOV as `effective_aov` |
118
+
119
+ ---
120
+
121
+ ## Step 4: Calculate optimal free shipping threshold
122
+
123
+ Apply enhanced calibration using both `effective_aov` and catalog stats:
124
+
125
+ | Condition | Threshold Formula | Rationale |
126
+ |---|---|---|
127
+ | `price_p75 > effective_aov x 1.5` | `price_p50 x 1.5` | High-price items skew the catalog; threshold encourages 2-item orders of mid-range products |
128
+ | `price_p75 < effective_aov` | `effective_aov x 1.2` | Most products are lower-priced; threshold encourages adding items to cart |
129
+ | Default (neither condition) | `max(effective_aov x 1.2, price_p75)` | Standard calibration balancing reach and margin |
130
+
131
+ **Example calculation**:
132
+ - `effective_aov` = $60
133
+ - `price_p50` = $35, `price_p75` = $55
134
+ - `price_p75 ($55) < effective_aov ($60)` --> use `effective_aov x 1.2` = $72
135
+ - Threshold = $72
136
+
137
+ ---
138
+
139
+ ## Step 5: Identify the target delivery region
140
+
141
+ Query delivery profiles to find the primary/domestic active region.
142
+
143
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/delivery-profiles/query`
144
+
145
+ **Request**:
146
+ ```json
147
+ {
148
+ "query": {
149
+ "cursorPaging": {
150
+ "limit": 100
151
+ }
152
+ }
153
+ }
154
+ ```
155
+
156
+ Select the region where:
157
+ 1. `active=true`
158
+ 2. `destinations[].countryCode` matches the site's primary country
159
+ 3. Falls within the default delivery profile
160
+
161
+ Save the region's `id` as the `deliveryRegionId` for the new option.
162
+
163
+ ---
164
+
165
+ ## Step 6: Create the free shipping option
166
+
167
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/shipping-options`
168
+
169
+ **Request**:
170
+ ```json
171
+ {
172
+ "shippingOption": {
173
+ "title": "Free Shipping",
174
+ "estimatedDeliveryTime": "5-7 business days",
175
+ "deliveryRegionId": "42b0ed3b-fc54-4ac0-89cf-5d2d17ec441c",
176
+ "rates": [
177
+ {
178
+ "amount": "0",
179
+ "multiplyByQuantity": false,
180
+ "conditions": [
181
+ {
182
+ "type": "BY_TOTAL_PRICE",
183
+ "operator": "GTE",
184
+ "value": "72"
185
+ }
186
+ ]
187
+ }
188
+ ]
189
+ }
190
+ }
191
+ ```
192
+
193
+ **Response**:
194
+ ```json
195
+ {
196
+ "shippingOption": {
197
+ "id": "dece6160-4e72-4fcc-adcc-7607215edab0",
198
+ "revision": "1",
199
+ "createdDate": "2026-04-15T13:14:01.214Z",
200
+ "updatedDate": "2026-04-15T13:14:01.214Z",
201
+ "deliveryRegionId": "42b0ed3b-fc54-4ac0-89cf-5d2d17ec441c",
202
+ "deliveryRegionIds": [],
203
+ "title": "Free Shipping",
204
+ "estimatedDeliveryTime": "5-7 business days",
205
+ "rates": [
206
+ {
207
+ "amount": "0",
208
+ "conditions": [
209
+ {
210
+ "type": "BY_TOTAL_PRICE",
211
+ "operator": "GTE",
212
+ "value": "72"
213
+ }
214
+ ],
215
+ "multiplyByQuantity": false
216
+ }
217
+ ]
218
+ }
219
+ }
220
+ ```
221
+
222
+ **Key field rules**:
223
+
224
+ | Field | Value | Notes |
225
+ |---|---|---|
226
+ | `title` | `"Free Shipping"` | Display name at checkout |
227
+ | `estimatedDeliveryTime` | `"5-7 business days"` | Always populate -- never leave empty |
228
+ | `deliveryRegionId` | Region UUID | Use singular field, not `deliveryRegionIds` |
229
+ | `rates[].amount` | `"0"` | Decimal string for free |
230
+ | `rates[].multiplyByQuantity` | `false` | Always false for free shipping |
231
+ | `rates[].conditions[].type` | `"BY_TOTAL_PRICE"` | Cart total threshold |
232
+ | `rates[].conditions[].operator` | `"GTE"` | Greater than or equal to |
233
+ | `rates[].conditions[].value` | Threshold as string | Calculated in Step 4 |
234
+
235
+ ---
236
+
237
+ ## Step 7: Verify the option appears in checkout
238
+
239
+ Re-query shipping options to confirm the new free shipping option is live.
240
+
241
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/shipping-options/query`
242
+
243
+ Verify:
244
+ 1. The new option appears with `title: "Free Shipping"` and `amount: "0"`
245
+ 2. The condition shows the correct threshold value
246
+ 3. The option is linked to the correct `deliveryRegionId`
247
+ 4. The linked region has `active=true` in its delivery profile
248
+
249
+ Report to the merchant:
250
+ > "Free shipping created with a $[threshold] minimum order. Customers spending $[threshold] or more will see free shipping at checkout. This threshold is calibrated to your average order value to encourage larger carts while protecting margins."
251
+
252
+ ---
253
+
254
+ ## Error Handling
255
+
256
+ | Error | Cause | Fix |
257
+ |---|---|---|
258
+ | `deliveryRegionId is not a valid GUID` | Used `deliveryRegionIds` (plural) instead of `deliveryRegionId` (singular) | Use the singular `deliveryRegionId` field |
259
+ | `SHIPPING_OPTION_NOT_FOUND` | Option ID doesn't exist when trying to update | Re-query shipping options to get current IDs |
260
+ | `REVISION_MISMATCH` | Revision doesn't match the current version when updating | Re-fetch the option for the latest revision, then retry |
261
+ | Threshold seems unreasonable | AOV data is unreliable (too few orders, data anomaly) | Run the AOV sanity check (Step 3) and use `effective_aov` instead of raw AOV |
262
+ | Free shipping not visible at checkout | Region linked to the option has `active=false` | Check region active status and activate if intended |
263
+
264
+ ## References
265
+
266
+ - [Delivery Profiles API](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/delivery-profiles/introduction)
267
+ - [Shipping Options API](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/shipping-options/introduction)