@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,231 @@
1
+ ---
2
+ name: "Multi-Resource Service Creation"
3
+ description: Creates resource types and individual resources using Resources API. Enables services that require multiple resources (rooms + equipment + staff) with automatic allocation.
4
+ ---
5
+ # Technical Step-by-Step Instructions: Creating Multi-Resource Bookings Services (Rooms, Equipment, Staff) - Real-World, API-First
6
+
7
+ ## Description
8
+
9
+ Below are the recommended steps to successfully create Wix Bookings services that require multiple resource types (e.g., Room + Equipment + Instructor). This recipe covers the **gaps** in individual API documentation: resource architecture planning, entity relationship patterns, availability dependencies, and real-world coordination challenges that aren't clear from reading individual API references.
10
+
11
+
12
+ ---
13
+
14
+ ## Prerequisites
15
+
16
+ ### Required App Installations
17
+
18
+ Before creating multi-resource services, ensure the following requirements are met:
19
+
20
+ 1. **Wix Bookings** - Core app must be installed and configured
21
+ 2. **Premium Plan** - Advanced resource management typically requires premium features
22
+ 3. **Business Location** - At least one business location must be configured
23
+
24
+ ### App Installation Process
25
+
26
+ If you encounter resource-related errors, install the required apps using the Apps Installer API.
27
+
28
+ **For detailed app installation procedures, refer to:**
29
+ - [Apps Installer API Documentation](https://dev.wix.com/docs/api-reference/business-management/app-installation/install-app)
30
+ - Business setup recipes for comprehensive app installation workflows
31
+
32
+ ## Overview
33
+
34
+ Multi-resource services allow businesses to create bookings that require multiple types of resources simultaneously. Common examples:
35
+ - **Fitness Classes**: Room + Equipment + Instructor
36
+ - **Meeting Services**: Conference Room + AV Equipment + Catering Staff
37
+ - **Spa Treatments**: Treatment Room + Specialized Equipment + Therapist
38
+
39
+ The system involves three independent entity types that can be connected:
40
+ 1. **Resource Types** - Category definitions (Room, Equipment, Staff) - independent entities
41
+ 2. **Resources** - Individual resource instances with their own schedules and availability - independent entities
42
+ 3. **Services** - Booking services that can optionally reference resource types - independent entities
43
+
44
+ **Key Architecture Principle**: Resources and Services are **separate, independent entities**. Resources exist independently but their availability depends on business location hours (for non-staff resources) or working hour schedules (for staff resources). Services can optionally connect to resource types (not individual resources) to require resource allocation during booking, but this connection is loose and flexible.
45
+
46
+ ### CRITICAL API DISCOVERY
47
+
48
+ **❌ COMMON ARCHITECTURE MISTAKES** (Not Clear in Individual Docs):
49
+ - Creating resources without resource types first (creation sequence matters)
50
+ - Assuming resources automatically inherit business hours (availability dependency isn't clear)
51
+ - Thinking you can connect same resource to conflicting schedules
52
+
53
+ **✅ CORRECT RESOURCE ARCHITECTURE**:
54
+ - **Independent Creation**: Resource Types → Resources (both exist independently)
55
+ - **Optional Service Connection**: Services can reference resource types when resource allocation is needed
56
+ - **Loose Coupling**: Resources maintain their own schedules and availability regardless of service connections
57
+ - **Type-Based References**: Services connect to `resourceType.id`, not individual resource IDs
58
+ - **Resource Autonomy**: Resources function independently - services simply request allocation from available resources of specified types
59
+
60
+ ### Key Discovery: Resource Schedule Behavior
61
+
62
+ **Resource Availability Behavior:**
63
+ - Each resource automatically gets a dedicated `eventsSchedule` for tracking bookings
64
+ - **Non-staff resources**: Availability depends on business location hours (not 24/7)
65
+ - **Staff resources**: Have working hour schedules in addition to event schedules
66
+ - **Working hours override**: When `workingHoursSchedules` is configured, it takes precedence over location hours
67
+
68
+ **Schedule Sharing Patterns:**
69
+ - `shared: false` = Dedicated schedule per resource (recommended for most cases)
70
+ - `shared: true` = Multiple resources use same working hours schedule
71
+ - Business schedule is always `shared: true` among staff
72
+
73
+ ### Key Discovery: Service-Resource Connection Pattern
74
+
75
+ **Service Configuration Pattern:**
76
+ ```json
77
+ "serviceResources": [
78
+ {"resourceType": {"id": "room-type-id"}},
79
+ {"resourceType": {"id": "equipment-type-id"}},
80
+ {"resourceType": {"id": "staff-type-id"}}
81
+ ]
82
+ ```
83
+ **Critical**: Services specify resource **types**, not individual resources. This creates a **loose coupling** where:
84
+ - Resources exist independently but availability follows business location hours (non-staff) or working hours (staff)
85
+ - Services request allocation from available resources of specified types during booking
86
+ - No direct binding between individual resources and services
87
+ - Resource management (updates, working hours) is independent of service configuration
88
+
89
+ ### IMPORTANT NOTES
90
+
91
+ * **Entity Independence**: Resources and Services are separate entities - you can create and manage resources without any services, and vice versa
92
+ * **Optional Connection**: Services only need to reference resource types if they require resource allocation for bookings
93
+ * **Location Complexity**: `availableInAllLocations: true` is simplest; specific location configuration is complex and often unnecessary
94
+ * **Service Pricing**: Multi-resource services often justify higher pricing due to resource coordination complexity
95
+
96
+ ---
97
+
98
+ ## Steps
99
+
100
+ ### 1. Plan Resource Type Architecture
101
+
102
+ Before creating anything, plan your resource type structure. Each type should represent a category of resources that can be substituted for each other in bookings.
103
+
104
+ **Common Resource Type Patterns:**
105
+ - **Physical Spaces**: Room, Studio, Meeting Room, Treatment Room
106
+ - **Equipment Categories**: AV Equipment, Medical Equipment, Sports Equipment
107
+ - **Human Resources**: Instructor, Therapist, Consultant, Technician
108
+
109
+ **Design Principle**: If resources are interchangeable for a service, they belong to the same type.
110
+
111
+ ### 2. Create Resource Types
112
+
113
+ Create resource types using `createResourceType` API (`POST https://www.wixapis.com/bookings/v2/resources/resource-types`) ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/create-resource-type)):
114
+
115
+ **Key Requirements:**
116
+ - `name` must be unique across the site
117
+ - Keep `name` descriptive but concise (appears in booking interface)
118
+ - Save the returned `resourceType.id` for resource creation
119
+
120
+ **Important**: Cannot change `name` after creation if conflicts occur - plan carefully.
121
+
122
+ ### 3. Create Individual Resources
123
+
124
+ For each resource type, create the individual resource instances using `createResource` API (`POST https://www.wixapis.com/bookings/v2/resources`) ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/create-resource)):
125
+
126
+ **Gap Not in Docs**: The docs don't clearly explain that `availableInAllLocations: true` is the simplest approach and that specific location configuration is complex and often unnecessary.
127
+
128
+ **Advanced Configuration (Gap):**
129
+ - Custom working hours override business location hours (this behavior isn't clearly documented)
130
+ - Specific locations: Use `specificLocationOptions` (complex - avoid unless required)
131
+
132
+ **Critical**: Each resource automatically gets its own `eventsSchedule` for booking management (this is documented but the implications for multi-resource coordination aren't clear).
133
+
134
+ ### 4. Create Multi-Resource Service (Optional Connection)
135
+
136
+ Create the service that optionally connects to multiple resource types using `bulkCreateServices` API ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/bulk-create-services)):
137
+
138
+ **Service Resource Configuration:**
139
+ ```json
140
+ "serviceResources": [
141
+ {"resourceType": {"id": "room-type-id"}},
142
+ {"resourceType": {"id": "equipment-type-id"}},
143
+ {"resourceType": {"id": "instructor-type-id"}}
144
+ ]
145
+ ```
146
+
147
+ **Key Principle**: This creates a **loose connection** where the service requests resource allocation during booking, but resources remain independent entities with their own lifecycle and management.
148
+
149
+ **Pricing Strategy**: Multi-resource services typically command premium pricing due to coordination complexity.
150
+
151
+ ### 5. Understand Resource Allocation Behavior (Gap in Docs)
152
+
153
+ The docs don't explain how multi-resource allocation actually works during booking. Key behaviors to understand:
154
+ - **Peak time conflicts**: When Room 1 is booked, Wix automatically tries Room 2 for the same resource type
155
+ - **Equipment maintenance**: Blocking specific resources affects all services requiring that resource type
156
+ - **Cross-resource dependencies**: If ANY required resource type has no availability, the entire booking fails
157
+
158
+ **Architecture Implication**: Plan resource quantities based on expected concurrent demand across all services.
159
+
160
+ ### IMPORTANT NOTES
161
+
162
+ * **Resource Allocation Logic**: Wix automatically handles resource selection during booking - you specify types, not individual resources
163
+ * **Conflict Resolution**: If any required resource type has no available resources, the entire booking fails
164
+ * **Service Modification**: Adding/removing resource type requirements from existing services may affect existing bookings
165
+ * **Performance Consideration**: Complex multi-resource services may have slower booking availability calculation
166
+
167
+ ### Troubleshooting Common Issues
168
+
169
+ **"Resource type not found" Error:**
170
+ - Verify resource type was created successfully before creating resources
171
+ - Check that `typeId` exactly matches the resource type `id`
172
+ - Ensure you're not using resource type `name` when `id` is required
173
+
174
+ **"Resource type name already exists" Error (409):**
175
+ - Resource type names must be unique across the site
176
+ - Query existing resource types to avoid duplicates
177
+ - Consider using more specific names (e.g., "Meeting Room" vs "Room")
178
+
179
+ **Service doesn't show resource requirements:**
180
+ - Verify `serviceResources` array includes all required resource types
181
+ - Check that resource type IDs are correct
182
+ - Confirm service creation was successful with proper resource configuration
183
+
184
+ **Resources showing as unavailable:**
185
+ - Check if `workingHoursSchedules` is too restrictive
186
+ - Verify `locationOptions` matches your business location setup
187
+ - Test with `availableInAllLocations: true` to eliminate location issues
188
+
189
+ **Resource updates failing:**
190
+ - Handle revision conflicts with retry logic (revision requirement is documented but conflict handling strategies aren't)
191
+
192
+ **Complex location availability issues:**
193
+ - Start with `availableInAllLocations: true` for all resources
194
+ - Only add location restrictions if absolutely necessary
195
+ - Location configuration is complex and often causes more problems than it solves
196
+
197
+ **Resource deletion concerns:**
198
+ - Deleting resources with active bookings may cause issues (deletion cleanup is documented but impact on existing bookings isn't clear)
199
+ - Consider disabling/hiding resources instead of deletion
200
+
201
+ ### Resource Architecture Best Practices
202
+
203
+ **Resource Type Design:**
204
+ - Keep types broad enough to allow flexibility but specific enough to be meaningful
205
+ - Plan for growth - easier to split types later than merge them
206
+ - Use clear, customer-facing names (they appear in booking interfaces)
207
+
208
+ **Resource Naming:**
209
+ - Include location/identifier in resource names for easy management
210
+ - Be consistent with naming patterns across resource types
211
+ - Consider how names appear in booking confirmations and staff interfaces
212
+
213
+ **Availability Strategy:**
214
+ - Default to 24/7 availability unless business rules require restrictions
215
+ - Use working hours sparingly - they add complexity without always adding value
216
+ - Test availability scenarios thoroughly before going live
217
+
218
+ **Service Design:**
219
+ - Start with simpler single-resource services before attempting multi-resource
220
+ - Consider premium pricing for multi-resource services due to coordination complexity
221
+ - Plan for resource substitution scenarios (what if preferred room is unavailable?)
222
+
223
+ ## API Documentation References
224
+
225
+ * [Create Resource Type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/create-resource-type)
226
+ * [Create Resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/create-resource)
227
+ * [Update Resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/update-resource)
228
+ * [Bulk Create Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/bulk-create-services)
229
+ * [Query Resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/query-resources)
230
+ * [Calendar Schedules API](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/introduction)
231
+ * [Apps Installer API](https://dev.wix.com/docs/api-reference/business-management/app-installation/install-app)
@@ -0,0 +1,226 @@
1
+ ---
2
+ name: "Configure Default Business Hours"
3
+ description: Uses Calendar Events API to create WORKING_HOURS events on the business schedule. Covers the critical distinction between Calendar Events API (correct) vs Site Properties API (incorrect) for setting base availability.
4
+ ---
5
+ # Technical Step-by-Step Instructions: Setting Up Wix Bookings Default Business Hours (Real-World, API-First)
6
+
7
+ ## Description
8
+
9
+ Below are the recommended steps to successfully configure default business hours for Wix Bookings, which control the base availability shown in the "Set default hours" dashboard. This recipe covers the correct API usage, common pitfalls, and cleanup procedures for managing business schedule events.
10
+
11
+ ---
12
+
13
+ ## Prerequisites
14
+
15
+ - **Wix Bookings app installed** (App ID: `13d21c63-b5ec-5912-8397-c3a5ddb27a97`)
16
+
17
+ > **Note:** If you receive errors from Bookings APIs, the Wix Bookings app may not be installed on the site. Use [List Installed Apps](../app-installation/list-installed-apps.md) to verify, and [Install Wix Apps](../app-installation/install-wix-apps.md) to install it if missing.
18
+
19
+ ## Overview
20
+
21
+ Wix Bookings default business hours define the base availability for your booking system and appear in the Bookings dashboard under "Set default hours". These hours:
22
+
23
+ - **Control base availability**: Set when your business is generally available for bookings
24
+ - **Apply to new staff**: Default working hours that new staff members inherit
25
+ - **Display in dashboard**: Show as time slots in the "Set default hours" interface
26
+
27
+ ### 🚨 CRITICAL: Default Hours Upon Installation
28
+
29
+ **IMPORTANT**: When Wix Bookings is first installed on a site, it automatically creates DEFAULT business hours (typically 9 AM - 5 PM, Monday through Friday). You CANNOT simply create new hours without handling these existing default hours first.
30
+
31
+ **You MUST either:**
32
+ 1. **Update the existing default hours** to your desired schedule, OR
33
+ 2. **Delete the existing default hours** and create new ones
34
+
35
+ **Failure to handle existing hours will result in:**
36
+ - Duplicate time slots in the dashboard
37
+ - Conflicting availability schedules
38
+ - Unexpected booking behavior
39
+
40
+ ### CRITICAL API DISCOVERY
41
+
42
+ **❌ WRONG API**: Site Properties API (`/site-properties/v4/properties/business-schedule`)
43
+ - This sets general site business schedule, NOT Bookings default hours
44
+
45
+ **✅ CORRECT API**: Calendar Events V3 API (`/calendar/v3/events`)
46
+ - Creates `WORKING_HOURS` events on the business schedule
47
+ - Each `MASTER` event creates one time slot in the dashboard
48
+ - Uses fixed business resource ID: `4e0579a5-491e-4e70-a872-d097eed6e520`
49
+
50
+ ### Key Discovery: Universal Business Schedule External ID
51
+
52
+ **VERIFIED**: The business schedule external ID `"4e0579a5-491e-4e70-a872-d097eed6e520"` is **universal across all Wix sites**.
53
+
54
+ This has been tested and confirmed on multiple different Wix sites:
55
+ - All sites have a business schedule with this exact external ID
56
+ - The schedule name is consistently `"business"`
57
+ - While the internal schedule `id` varies per site, the `externalId` is constant
58
+ - This makes the recipe reliable without requiring site-specific discovery
59
+
60
+ ### IMPORTANT NOTES
61
+
62
+ * **Universal External ID**: The business schedule external ID `"4e0579a5-491e-4e70-a872-d097eed6e520"` is verified to work across all Wix sites
63
+ * **Default Hours Always Exist**: Every Wix Bookings installation creates default hours automatically
64
+ * **Event Scheduling Flexibility**: Businesses can create multiple time slots per day or complex schedules as needed - there are no restrictions on number of events per day
65
+ * **MASTER vs INSTANCE Events**: Based on observed behavior, MASTER events appear to generate INSTANCE events automatically, but always verify current event state when working with recurring events
66
+ * **Query Patterns**: Use `"recurrenceType": ["MASTER"]` to focus on the primary recurring event definitions
67
+ * **Revision Numbers**: Calendar events require current revision numbers for updates - always get fresh revision before bulk operations
68
+
69
+ ---
70
+
71
+ ## Steps
72
+
73
+ ### 1. Find Business Schedule
74
+
75
+ Query the business schedule that controls default hours using the fixed external ID.
76
+
77
+ **Endpoint**: `POST https://www.wixapis.com/calendar/v3/schedules/query`
78
+
79
+ Use `querySchedules` API ([REST](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/query-schedules)) with filter:
80
+ - `externalId`: `"4e0579a5-491e-4e70-a872-d097eed6e520"`
81
+
82
+ Keep the returned `schedule.id` for creating events.
83
+
84
+ ### 2. Query Existing Working Hours (MANDATORY)
85
+
86
+ **🚨 CRITICAL STEP**: You MUST query for existing `WORKING_HOURS` events because Wix Bookings automatically creates default hours upon installation.
87
+
88
+ **Endpoint**: `POST https://www.wixapis.com/calendar/v3/events/query`
89
+
90
+ Use `queryEvents` API ([REST](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/query-events)):
91
+
92
+ Query pattern:
93
+ ```json
94
+ {
95
+ "recurrenceType": ["MASTER"],
96
+ "query": {
97
+ "filter": {
98
+ "scheduleId": "business-schedule-id",
99
+ "type": "WORKING_HOURS"
100
+ }
101
+ }
102
+ }
103
+ ```
104
+
105
+ **Important**: Always query for MASTER events specifically to see actual recurring schedules.
106
+
107
+ **Expected Result**: You will typically find 5 existing MASTER events (Monday through Friday, 9 AM - 5 PM) from the default Bookings installation.
108
+
109
+ ### 3. Choose Your Strategy: Update OR Replace
110
+
111
+ Based on the existing hours found in Step 2, choose one approach:
112
+
113
+ #### Strategy A: Update Existing Hours (Recommended)
114
+ If you want to modify the times but keep the same days, update the existing events.
115
+
116
+ #### Strategy B: Replace All Hours
117
+ If you want completely different days/times, delete existing events and create new ones.
118
+
119
+ ### 4A. Update Existing Business Hours (Strategy A)
120
+
121
+ **Endpoint**: `POST https://www.wixapis.com/calendar/v3/bulk/events/update`
122
+
123
+ Use `bulkUpdateEvents` API ([REST](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-update-event)) with `fieldmask` pattern:
124
+
125
+ Update fields:
126
+ - `start`/`end`: New times
127
+ - `revision`: Current revision number (from Step 2 query)
128
+ - `fieldmask`: `"start,end"`
129
+
130
+ **Example**: Change Monday hours from 9 AM-5 PM to 12 AM-4 PM:
131
+ ```json
132
+ {
133
+ "events": [{
134
+ "event": {
135
+ "id": "existing-monday-event-id",
136
+ "start": {"localDate": "2025-06-16T00:00:00"},
137
+ "end": {"localDate": "2025-06-16T16:00:00"},
138
+ "revision": "current-revision-number"
139
+ }
140
+ }],
141
+ "fieldmask": "start,end"
142
+ }
143
+ ```
144
+
145
+ ### 4B. Replace All Business Hours (Strategy B)
146
+
147
+ #### Step 4B.1: Delete Existing Hours
148
+ Cancel existing MASTER events using `bulkCancelEvents` API (`POST https://www.wixapis.com/calendar/v3/bulk/events/cancel`) ([REST](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-cancel-event)):
149
+
150
+ ```json
151
+ {
152
+ "eventIds": ["event-id-1", "event-id-2", "event-id-3", "event-id-4", "event-id-5"]
153
+ }
154
+ ```
155
+
156
+ #### Step 4B.2: Create New Business Hours
157
+ Create `WORKING_HOURS` events for each day using `bulkCreateEvents` API (`POST https://www.wixapis.com/calendar/v3/bulk/events/create`) ([REST](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-create-event)).
158
+
159
+ **Each event pattern**:
160
+ - `type`: `"WORKING_HOURS"`
161
+ - `scheduleId`: Business schedule ID from step 1
162
+ - `scheduleOwnerId`: `"4e0579a5-491e-4e70-a872-d097eed6e520"`
163
+ - `externalScheduleId`: `"4e0579a5-491e-4e70-a872-d097eed6e520"`
164
+ - `recurrenceRule`: Weekly recurring with single day
165
+ - `start`/`end`: Business hours times
166
+
167
+ **Note**: Create separate events for each day of the week (Monday, Tuesday, etc.).
168
+
169
+ ### 5. Verify Final Configuration
170
+
171
+ Query the business schedule events again to confirm:
172
+ 1. No duplicate time slots exist
173
+ 2. Each desired day has exactly one MASTER event
174
+ 3. Times match your requirements
175
+
176
+ ### IMPORTANT NOTES
177
+
178
+ * **Future dates required**: Recurring events must start today or in the future
179
+ * **Revision management**: Always use current revision numbers when updating events
180
+ * **MASTER vs INSTANCE**: Based on observed behavior, MASTER events appear to control recurring patterns while INSTANCE events are auto-generated, but always verify current event state
181
+ * **Default Hours Impact**: Remember that these hours will be inherited by any new staff members created after this configuration
182
+
183
+ ### Troubleshooting Common Issues
184
+
185
+ **"App not installed" Error (428):**
186
+ - Install Wix Bookings app using Apps Installer API
187
+ - Verify installation by querying existing services
188
+
189
+ **Duplicate time slots in dashboard:**
190
+ - **Root Cause**: You created new events without handling existing default hours
191
+ - **Solution**: Query MASTER events to find duplicates and cancel unwanted ones
192
+ - Each day should have only one MASTER event unless split hours are needed
193
+
194
+ **Updates not reflecting in dashboard:**
195
+ - Verify you're updating MASTER events, not INSTANCE events
196
+ - Check that revision numbers are current
197
+ - Confirm `fieldmask` includes the fields you're changing
198
+
199
+ **Cannot create events in the past:**
200
+ - Set `start.localDate` to current date or future
201
+ - Recurring events automatically generate past INSTANCE events
202
+
203
+ **Business schedule not found:**
204
+ - Query schedules using the fixed external ID: `4e0579a5-491e-4e70-a872-d097eed6e520`
205
+ - Ensure Wix Bookings is installed (schedule is created when Bookings is installed)
206
+
207
+ **Working hours not affecting staff/services:**
208
+ - Default hours only apply to staff using `usesDefaultWorkingHours: true`
209
+ - Services with custom schedules ignore default business hours
210
+ - Staff with assigned custom schedules override default hours
211
+
212
+ ### Common Gotchas
213
+
214
+ 1. **Skipping the Query Step**: Never assume no hours exist - always query first
215
+ 2. **Creating Without Cleaning**: Adding new hours without removing defaults creates duplicates
216
+ 3. **Wrong Event Type**: Using INSTANCE instead of MASTER events for queries/updates
217
+ 4. **Missing Revision Numbers**: Updates require current revision numbers from the query response
218
+
219
+ ## API Documentation References
220
+
221
+ * [Query Schedules](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/query-schedules)
222
+ * [Query Events](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/query-events)
223
+ * [Bulk Create Events](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-create-event)
224
+ * [Bulk Update Events](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-update-event)
225
+ * [Bulk Cancel Events](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-cancel-event)
226
+ * [Apps Installer API](https://dev.wix.com/docs/api-reference/business-management/app-installation/install-app)