@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,416 @@
1
+ ---
2
+ name: "Booking System Integration Gaps"
3
+ description: Documents undocumented API patterns for booking payments. Covers Bookings→Ecommerce integration, booking ID transformation to catalog items, and async payment confirmation flows.
4
+ ---
5
+ # Technical Step-by-Step Instructions: Wix Bookings System Integration Gaps - Complete API Documentation Analysis
6
+
7
+ ## Description
8
+
9
+ This recipe addresses **critical undocumented API patterns and business integration gaps** across the entire Wix Bookings ecosystem. While Wix extensively documents individual booking creation APIs, there exist fundamental undocumented integration patterns that are essential for any payment-enabled booking business but completely absent from all official documentation sources.
10
+
11
+
12
+ ---
13
+
14
+ ## Prerequisites
15
+
16
+ ### Required App Installations
17
+
18
+ Before implementing any booking integration, ensure the following requirements are met:
19
+
20
+ 1. **Wix Bookings** - Core app must be installed and configured
21
+ 2. **Wix Ecommerce** - Required for payment processing (undocumented dependency)
22
+ 3. **Services Created** - At least one bookable service must exist on the site
23
+ 4. **Staff Resources** - Staff members must be available for service delivery
24
+ 5. **Business Schedule** - Operating hours must be configured
25
+
26
+ ### App Installation Process
27
+
28
+ If you encounter service-related errors, install the required apps using the Apps Installer API.
29
+
30
+ **For detailed app installation procedures, refer to:**
31
+ - [Apps Installer API Documentation](https://dev.wix.com/docs/api-reference/business-management/app-installation/install-app)
32
+ - Business setup recipes for comprehensive app installation workflows
33
+
34
+ ## Overview
35
+
36
+ The Wix Bookings system contains **fundamental undocumented integration patterns** that affect every booking scenario requiring payment processing. These gaps create confusion and implementation barriers across all booking types:
37
+
38
+ - **Single Appointment Bookings**: How booking payments actually work
39
+ - **Class Bookings**: Payment processing for group services
40
+ - **Course Bookings**: Complex dual-API requirements for scheduling
41
+ - **Multi-Service Packages**: Completely undocumented unified booking endpoint
42
+
43
+ ### CRITICAL API DOCUMENTATION GAPS
44
+
45
+ **The Universal Undocumented Pattern**: **Bookings→Ecommerce Integration Architecture**
46
+
47
+ **Documentation Status Across ALL Booking Types**:
48
+ - ❌ **NOT** documented how booking IDs become catalog items
49
+ - ❌ **NOT** documented that ecom system handles all pricing/tax calculations
50
+ - ❌ **NOT** documented async payment confirmation patterns
51
+ - ❌ **NOT** documented booking status vs order status separation
52
+ - ❌ **NOT** documented service properties preservation in checkout
53
+ - ❌ **NO** mention of `BACKOFFICE_MERCHANT` channel requirement
54
+ - ❌ **NO** explanation of why checkout/order APIs are needed for bookings
55
+
56
+ **Additional Service-Specific Gaps**:
57
+ - ❌ **Courses**: Dual API requirement (booking + calendar events) completely undocumented
58
+ - ❌ **Multi-Service**: Entire endpoint missing from all documentation
59
+ - ❌ **Payment Flow**: Universal integration pattern affects all booking types
60
+
61
+ ### Key Discovery: Universal Architecture Gap
62
+
63
+ **What Developers Expect** (Based on Documentation):
64
+ - Create booking → Booking system handles payment → Done
65
+ - Payment status managed within booking system
66
+ - Booking APIs contain all necessary functionality
67
+
68
+ **Actual Undocumented Architecture**:
69
+ - Create booking → Booking system creates reservation only
70
+ - Use booking ID as catalog item in ecom system
71
+ - Ecom system handles all pricing, tax, discount calculations
72
+ - Create checkout and order for actual payment processing
73
+ - Async messaging system handles payment confirmation
74
+ - Booking status (CONFIRMED) independent of payment status
75
+
76
+ **Reality Check**:
77
+ ```
78
+ Standard Documentation Shows: Booking API → Payment ✓
79
+ Actual Required Flow: Booking API → Ecom Integration → Payment ✓
80
+ ```
81
+
82
+ ### Business Impact of These Gaps
83
+
84
+ **Without Understanding Universal Integration Patterns:**
85
+ - Developers assume booking creation includes payment processing
86
+ - No knowledge that ecom system handles all financial calculations
87
+ - Missing understanding of async payment confirmation architecture
88
+ - Confusion about booking status vs payment status separation
89
+ - Unknown relationship between booking system and ecommerce system
90
+
91
+ **Without Service-Specific Knowledge:**
92
+ - Course businesses cannot create functioning course delivery schedules
93
+ - Package-based businesses cannot create unified booking experiences
94
+ - Payment implementation becomes trial-and-error process
95
+ - Integration projects fail due to missing critical steps
96
+
97
+ **Current Developer Confusion Patterns:**
98
+ - "Why do I need ecommerce APIs for booking payments?"
99
+ - "How do booking payments actually work?"
100
+ - "Why are my course bookings invisible on the calendar?"
101
+ - "How do I create spa day packages?"
102
+ - "What's the difference between booking status and payment status?"
103
+
104
+ ### IMPORTANT NOTES
105
+
106
+ * **Universal Integration Gap**: Every booking requiring payment uses undocumented ecom integration
107
+ * **Service Type Complexity**: Different booking structures but same payment patterns
108
+ * **Async Architecture**: Payment confirmation decoupled from booking creation
109
+ * **Status Separation**: Booking confirmation independent of payment processing
110
+ * **Hidden Dependencies**: Ecommerce system required for all booking payments
111
+ * **Business Model Impact**: Documentation gaps prevent entire business models
112
+
113
+ ---
114
+
115
+ ## Steps
116
+
117
+ ### 1. Understand Universal Booking→Payment Architecture
118
+
119
+ **CRITICAL DISCOVERY**: All Wix booking payments flow through undocumented ecommerce integration.
120
+
121
+ **The Hidden Architecture**:
122
+ - **Booking System**: Handles time slot reservations, service coordination, scheduling
123
+ - **Ecommerce System**: Handles pricing, tax calculations, discount processing, payment collection
124
+ - **Integration Bridge**: Booking IDs automatically become catalog item IDs
125
+
126
+ **Universal Pattern** (Works for ALL Service Types):
127
+ ```
128
+ Create Booking → Extract Booking ID → Use as Catalog Item ID → Create Checkout → Create Order → Process Payment
129
+ ```
130
+
131
+ ### 2. Identify Service Type-Specific Booking Patterns
132
+
133
+ Different service types use different booking structures but same payment integration:
134
+
135
+ **Appointments**: Use `bookedEntity.slot` with all required fields
136
+ ```json
137
+ {
138
+ "booking": {
139
+ "bookedEntity": {
140
+ "slot": {
141
+ "serviceId": "<SERVICE_ID>",
142
+ "scheduleId": "<SCHEDULE_ID>",
143
+ "startDate": "2024-06-14T14:00:00",
144
+ "endDate": "2024-06-14T15:15:00",
145
+ "timezone": "America/New_York",
146
+ "resource": { "id": "<RESOURCE_ID>" },
147
+ "location": { "locationType": "OWNER_BUSINESS" }
148
+ }
149
+ },
150
+ "contactDetails": {
151
+ "firstName": "John",
152
+ "email": "john@example.com"
153
+ },
154
+ "totalParticipants": 1
155
+ }
156
+ }
157
+ ```
158
+
159
+ > **Critical**: All slot fields (`scheduleId`, `resource.id`, `location.locationType`, `timezone`) are **required** for appointments. Omitting any of them returns a 400 error. The `locationType` must be `OWNER_BUSINESS` (not `BUSINESS` which is what Time Slots V2 returns).
160
+
161
+ **Classes**: Use `bookedEntity.slot` with `eventId` (auto-derives other fields)
162
+ ```json
163
+ {
164
+ "booking": {
165
+ "bookedEntity": {
166
+ "slot": {
167
+ "serviceId": "<SERVICE_ID>",
168
+ "eventId": "<EVENT_ID>"
169
+ }
170
+ },
171
+ "contactDetails": {
172
+ "firstName": "Jane",
173
+ "email": "jane@example.com"
174
+ },
175
+ "totalParticipants": 1
176
+ }
177
+ }
178
+ ```
179
+
180
+ **Courses**: Use `bookedEntity.schedule` structure + require separate calendar events
181
+ ```json
182
+ {
183
+ "booking": {
184
+ "bookedEntity": {
185
+ "schedule": {
186
+ "scheduleId": "<SCHEDULE_ID>",
187
+ "serviceId": "<SERVICE_ID>",
188
+ "timezone": "America/New_York",
189
+ "location": { "locationType": "OWNER_BUSINESS" }
190
+ }
191
+ },
192
+ "contactDetails": {
193
+ "firstName": "Bob",
194
+ "email": "bob@example.com"
195
+ },
196
+ "totalParticipants": 1
197
+ }
198
+ }
199
+ ```
200
+
201
+ ### 3. Create Booking Using Appropriate Service Pattern
202
+
203
+ Use standard booking creation APIs with service-specific structures:
204
+
205
+ **Standard Booking Endpoint**: `POST https://www.wixapis.com/_api/bookings-service/v2/bookings` ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/create-booking))
206
+
207
+ **Critical Parameters for All Types**:
208
+ - `booking.contactDetails` — at minimum `firstName` and `email`
209
+ - `booking.totalParticipants` — number of participants
210
+ - `selectedPaymentOption: "OFFLINE"` — for ecom integration flows
211
+ - `flowControlSettings.skipBusinessConfirmation: true` — for administrative bookings
212
+ - Service-appropriate `bookedEntity` structure (see Step 2 above)
213
+
214
+ ### 4. Handle Course-Specific Calendar Requirements
215
+
216
+ **MAJOR DISCOVERY**: Courses require dual API implementation - booking alone is insufficient.
217
+
218
+ **Course Booking Problem**: Creating course booking without calendar sessions results in:
219
+ - Participant enrollment and payment processing works
220
+ - No visible sessions on business calendar
221
+ - Staff unaware of when/where to conduct sessions
222
+ - Course delivery schedule missing
223
+
224
+ **Required Additional Step for Courses**:
225
+ Create calendar events using `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)):
226
+ ```json
227
+ {
228
+ "events": [{
229
+ "event": {
230
+ "type": "COURSE",
231
+ "scheduleId": "<COURSE_SCHEDULE_ID>",
232
+ "externalScheduleId": "<STAFF_RESOURCE_ID>",
233
+ "start": { "localDate": "2025-06-16T09:00:00" },
234
+ "end": { "localDate": "2025-06-16T10:00:00" },
235
+ "resources": [{ "id": "<STAFF_RESOURCE_ID>" }],
236
+ "recurrenceRule": {
237
+ "frequency": "WEEKLY",
238
+ "interval": 1,
239
+ "days": ["MONDAY"],
240
+ "until": { "localDate": "2025-08-11T23:59:59" }
241
+ }
242
+ }
243
+ }]
244
+ }
245
+ ```
246
+
247
+ > **Critical**: Each element in the `events` array must be wrapped in `{ "event": {...} }`. The `resources` array with at least one resource ID is **required** for CLASS/COURSE events — without it the API returns 400. `start`/`end` fields and `externalScheduleId` are also required.
248
+
249
+ ### 5. Implement Multi-Service Package Bookings (Advanced)
250
+
251
+ **CRITICAL UNDOCUMENTED ENDPOINT**: For businesses requiring unified package experiences.
252
+
253
+ **Endpoint**: `POST https://manage.wix.com/_api/bookings-service/v2/multi_service_bookings`
254
+
255
+ **Business Use Cases**:
256
+ - Spa packages (massage + facial + manicure as single booking)
257
+ - Beauty services (cut + color + styling as unified experience)
258
+ - Wellness programs (consultation + treatment + follow-up coordination)
259
+
260
+ **Undocumented Requirements**:
261
+ - Identical contact information across all services in package
262
+ - Sequential service timing coordination (second service start = first service end)
263
+ - `skipAvailabilityValidation: true` for back-to-back scheduling
264
+
265
+ ### 6. Process Payment Through Universal Ecom Integration
266
+
267
+ **MAJOR DISCOVERY**: ALL booking payments use identical ecommerce integration pattern.
268
+
269
+ **Step 6A: Create Checkout with Booking ID as Catalog Item**
270
+
271
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/checkouts` ([REST](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/checkout/create-checkout))
272
+
273
+ ```json
274
+ {
275
+ "lineItems": [{
276
+ "catalogReference": {
277
+ "catalogItemId": "<BOOKING_ID>",
278
+ "appId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97"
279
+ },
280
+ "quantity": 1
281
+ }],
282
+ "channelType": "WEB"
283
+ }
284
+ ```
285
+
286
+ **Step 6B: Create Order for Payment Processing**
287
+
288
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/checkouts/{checkoutId}/createOrder`
289
+
290
+ **Critical Architecture Discoveries**:
291
+ - **Automatic ID Transformation**: Booking IDs automatically valid as catalog item IDs
292
+ - **Service Properties Preserved**: Booking context (scheduledDate, numberOfParticipants) maintained
293
+ - **Pricing Calculation**: Ecom system handles all financial calculations (not booking system)
294
+ - **Item Type Assignment**: `"preset": "SERVICE"` automatically applied
295
+
296
+ ### 7. Understand Async Payment Confirmation Architecture
297
+
298
+ **Payment Processing Architecture**:
299
+ ```
300
+ Booking (CONFIRMED) → Checkout → Order → Payment Processing (async)
301
+ ↓
302
+ Messaging System
303
+ ↓
304
+ Final Status Updates
305
+ ```
306
+
307
+ **Status Management Patterns**:
308
+ - **Booking Status**: CONFIRMED (reserves time slot regardless of payment)
309
+ - **Order Status**: PAID/NOT_PAID (reflects payment processing outcome)
310
+ - **Business Logic**: Time slot reservation independent of payment success
311
+
312
+ **Operational Benefits**:
313
+ - Payment failures don't lose reserved time slots
314
+ - Supports multiple payment models (prepaid, deposits, invoicing)
315
+ - Retry payment without recreating complex booking coordination
316
+
317
+ ### 8. Implement Business-Specific Integration Patterns
318
+
319
+ **Single Appointments**: Basic booking + ecom integration
320
+ **Group Classes**: Booking with participant count + ecom integration
321
+ **Course Programs**: Booking + calendar events + ecom integration
322
+ **Service Packages**: Multi-service booking + ecom integration
323
+
324
+ **Universal Integration Considerations**:
325
+ - All service types use same checkout/order creation pattern
326
+ - Pricing calculations always handled by ecom system
327
+ - Async payment confirmation applies to all booking types
328
+ - Service properties preserved across all integration points
329
+
330
+ ### IMPORTANT NOTES
331
+
332
+ * **Universal Integration Required**: Every booking payment flows through ecommerce system
333
+ * **Service-Specific Booking Creation**: Different booking structures for different service types
334
+ * **Courses Require Dual APIs**: Booking system + calendar events system
335
+ * **Multi-Service Endpoint Undocumented**: Complete gap for package-based businesses
336
+ * **Async Payment Architecture**: Payment confirmation decoupled from booking creation
337
+ * **Status Independence**: Booking confirmation separate from payment processing
338
+ * **Hidden Ecommerce Dependency**: Not mentioned in any booking documentation
339
+
340
+ ### Troubleshooting Universal Integration Issues
341
+
342
+ **Booking ID Not Working as Catalog Item**:
343
+ - Verify booking was created successfully and has valid ID
344
+ - Ensure using correct Wix Bookings app ID in catalog reference
345
+ - Check that booking status is CONFIRMED before attempting checkout
346
+
347
+ **Course Bookings Not Visible on Calendar**:
348
+ - Course bookings handle enrollment only, not session scheduling
349
+ - Must create calendar events separately using calendar API
350
+ - Session scheduling independent of participant enrollment
351
+
352
+ **Payment Status Confusion**:
353
+ - Booking status (CONFIRMED) indicates time slot reservation
354
+ - Order status (PAID/NOT_PAID) indicates payment processing outcome
355
+ - These statuses operate independently through async messaging
356
+
357
+ **Multi-Service Booking Failures**:
358
+ - Contact details must be identical across all services in package
359
+ - Service timing must be precisely coordinated (end time = next start time)
360
+ - Resource allocation requires manual verification with `skipAvailabilityValidation`
361
+
362
+ **Ecommerce Integration Errors**:
363
+ - Verify ecommerce app is installed and enabled
364
+ - Ensure using `"BACKOFFICE_MERCHANT"` channel type for owner flows
365
+ - Check that service pricing is properly configured in booking system
366
+
367
+ ### Cross-Platform Implementation Challenges
368
+
369
+ **Headless Implementation**:
370
+ - No documented SDK methods for booking→ecom integration
371
+ - Manual API orchestration required for payment processing
372
+ - Frontend developers must understand backend integration patterns
373
+
374
+ **Mobile Integration**:
375
+ - Booking creation patterns differ across service types
376
+ - Payment flow design requires understanding async confirmation
377
+ - Course management requires dual API coordination
378
+
379
+ **Third-Party Integration**:
380
+ - Booking export may not include payment status information
381
+ - External calendar systems may not receive course session details
382
+ - CRM integration requires understanding booking vs payment status separation
383
+
384
+ ### Business Architecture Considerations
385
+
386
+ **Payment Model Planning**:
387
+ - Booking system reserves capacity, ecom system processes payments
388
+ - Multiple payment models supported (full prepaid, deposits, invoicing)
389
+ - Refund processing requires coordination between both systems
390
+
391
+ **Service Type Planning**:
392
+ - Appointments: Immediate booking and payment
393
+ - Classes: Group bookings with participant management
394
+ - Courses: Long-term enrollment with session scheduling
395
+ - Packages: Unified experience across multiple services
396
+
397
+ **Scaling Considerations**:
398
+ - Integration complexity increases with service variety
399
+ - Payment processing load handled by ecommerce system
400
+ - Booking coordination managed by booking system
401
+ - Analytics require data from both systems
402
+
403
+ ## API Documentation References
404
+
405
+ **Documented APIs** (That Don't Explain Integration Requirements):
406
+ * [Standard Booking Flow](https://dev.wix.com/docs/api-reference/business-solutions/bookings/flow-single-service-booking) - Missing payment integration
407
+ * [Create Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/create-booking) - No payment processing guidance
408
+ * [Service Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-types) - Missing integration patterns
409
+ * [Ecommerce Checkout](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/introduction) - No booking integration mention
410
+
411
+ **Completely Undocumented**:
412
+ * **Booking→Ecom Integration**: Universal pattern affecting all booking payments
413
+ * **Multi-Service Bookings**: `https://manage.wix.com/_api/bookings-service/v2/multi_service_bookings`
414
+ * **Course Calendar Requirements**: Dual API necessity for course functionality
415
+ * **Async Payment Confirmation**: Messaging system architecture
416
+ * **Status Separation Patterns**: Booking vs payment status independence
@@ -0,0 +1,255 @@
1
+ ---
2
+ name: "Bookings Staff Setup"
3
+ description: "Creates staff members and configures custom working hours using Staff API + Calendar Events API. Critical two-step process: create staff → assign schedule → create working hours events."
4
+ ---
5
+ # Technical Step-by-Step Instructions: Setting Up Wix Bookings Staff Members with Custom Working Hours (Real-World, API-First)
6
+
7
+ ## Description
8
+
9
+ Below are the recommended steps to successfully set up Wix Bookings staff members and configure their custom working schedules on Wix, with real-world troubleshooting and fixes for common API issues.
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
+ ---
20
+
21
+ ## Overview
22
+
23
+ A Wix Bookings staff member setup involves multiple interconnected steps that must be executed in the correct sequence. This recipe covers the complete workflow from foundation setup to custom working hours configuration.
24
+
25
+ ### 🚨 CRITICAL: Staff Inheritance Timing
26
+
27
+ **STAFF INHERIT BUSINESS HOURS AT CREATION TIME**: When you create a new staff member, they immediately inherit whatever business hours exist at that moment. This inheritance is NOT dynamic - it's a one-time copy during creation.
28
+
29
+ **Order of Operations Matters**:
30
+ 1. **Option A (Recommended)**: Fix business hours FIRST, then create staff (staff inherit correct hours)
31
+ 2. **Option B**: Create staff first, then detach them from default hours and configure custom schedules
32
+
33
+ **Understanding the Impact**:
34
+ - If you create staff when business hours are 9 AM - 5 PM, staff inherit 9 AM - 5 PM
35
+ - If you later change business hours to 8 AM - 6 PM, existing staff STILL have 9 AM - 5 PM
36
+ - New staff created after the change would inherit 8 AM - 6 PM
37
+
38
+ Staff schedule configuration includes:
39
+ - **Default behavior**: Staff inherit business hours and are available at all business locations
40
+ - **Custom schedules**: Staff can have individual working hours different from business defaults
41
+ - **Working hours creation**: Custom hours are created as events with `"type": "WORKING_HOURS"` and recurrence rules
42
+
43
+ ### Key Concepts
44
+
45
+ * **Staff Member**: An individual providing services within Wix Bookings. Each staff member has an associated resource with schedules for working hours and events.
46
+ * **Working Hours Schedule**: Defines when a staff member is available to provide services. Can be either business default hours or custom hours.
47
+ * **Event Schedule**: The actual calendar events that define specific working time blocks (WORKING_HOURS events).
48
+ * **Resource ID**: Each staff member has a `resourceId` that links them to their schedules and availability.
49
+ * **Inheritance Timestamp**: The exact moment when a staff member is created determines which business hours they inherit.
50
+
51
+ ### Critical Workflow Requirements
52
+
53
+ The complete custom working hours setup requires understanding three distinct ID types and their relationships:
54
+ - **Staff Member ID**: Used for staff updates and schedule assignment
55
+ - **Resource ID**: Used for linking to services and events (`externalScheduleId` and `resources` array)
56
+ - **Events Schedule ID**: Used for creating working hours events (`scheduleId`)
57
+
58
+ The most common mistake is confusing which ID to use in which API call, leading to "Resource not found" or "Invalid scheduleId" errors.
59
+
60
+ ### 🚨 INHERITANCE WARNINGS
61
+
62
+ * **One-Time Inheritance**: Business hours are copied (not linked) to staff at creation time
63
+ * **Creation Order Impact**: The state of business hours when you create staff determines their initial schedule
64
+ * **Retroactive Changes**: Changing business hours does NOT affect existing staff schedules
65
+ * **Multiple Staff Issue**: If you create multiple staff at different times, they may inherit different business hours
66
+
67
+ ### IMPORTANT NOTES
68
+
69
+ * **Two-Step Requirement**: Custom working hours requires both `assignWorkingHoursSchedule` AND creating `WORKING_HOURS` events. Only doing the first step results in staff with no actual working hours.
70
+ * **Foundation Dependencies**: Staff operations require Wix Bookings app installation and proper business schedule configuration. "Business schedule not found" errors indicate missing foundation setup.
71
+ * **Event Field Requirements**: When creating `WORKING_HOURS` events, several fields that appear optional in documentation are actually required: `externalScheduleId`, `adjustedStart`, `adjustedEnd`, `resources` array, and `appId`.
72
+ * **Revision Numbers**: Event updates ALWAYS require the current revision number. Fetch current event details before any update operation.
73
+ * **Time Format Precision**: All date/time fields must use precise ISO 8601 format (`YYYY-MM-DDTHH:mm:ss`) without timezone indicators.
74
+ * **Separate Events for Each Day**: Each working day requires a separate event with single-day recurrence rules. You cannot specify multiple days in one event's `recurrenceRule.days` array.
75
+
76
+ ---
77
+
78
+ ## Steps
79
+
80
+ ### Step 0: Choose Your Strategy (CRITICAL DECISION)
81
+
82
+ Before proceeding, decide your approach based on business hour requirements:
83
+
84
+ #### Strategy A: Fix Business Hours First (Recommended)
85
+ **When to use**: All staff will have the same working hours or similar schedules
86
+ 1. Configure correct business hours (see business hours recipe)
87
+ 2. Create staff members (they inherit correct hours automatically)
88
+ 3. Only customize specific staff if needed
89
+
90
+ **Advantages**:
91
+ - Staff inherit correct hours immediately
92
+ - Minimal post-creation configuration
93
+ - Consistent scheduling across staff
94
+
95
+ #### Strategy B: Create Staff First, Configure Later
96
+ **When to use**: Each staff member needs completely different schedules
97
+ 1. Create staff with whatever business hours exist
98
+ 2. Detach each staff from business hours
99
+ 3. Configure individual custom schedules for each
100
+
101
+ **Disadvantages**:
102
+ - Requires more API calls per staff member
103
+ - Risk of forgetting to configure some staff
104
+ - Temporary period with incorrect availability
105
+
106
+ ### 1. Verify Foundation Setup (Prerequisites - Optional if Already Configured)
107
+
108
+ **Note**: If your site already has Wix Bookings properly configured with business schedules, you can skip this step and go directly to Step 2.
109
+
110
+ Before creating staff members, ensure the foundation is properly configured:
111
+
112
+ **Check Wix Bookings Installation**: Query staff members (`POST https://www.wixapis.com/bookings/v1/staff-members/query`) to test if Bookings is installed. If you receive "Business schedule not found" errors, the foundation needs setup.
113
+
114
+ **Install Wix Bookings App** (if needed): Use the App Installer API with Wix Bookings app ID: `13d21c63-b5ec-5912-8397-c3a5ddb27a97`.
115
+
116
+ **Configure Business Schedule**: Set up site properties with business operating hours using the Site Properties API.
117
+
118
+ **Create Calendar Schedule and Working Hours**: Create a calendar schedule for Wix Bookings integration and populate it with business `WORKING_HOURS` events.
119
+
120
+ ### 2. Verify Current Business Hours (CRITICAL)
121
+
122
+ Before creating any staff, query the current business hours (`POST https://www.wixapis.com/calendar/v3/events/query`) to understand what staff will inherit:
123
+
124
+ ```json
125
+ {
126
+ "recurrenceType": ["MASTER"],
127
+ "query": {
128
+ "filter": {
129
+ "scheduleId": "business-schedule-id",
130
+ "type": "WORKING_HOURS"
131
+ }
132
+ }
133
+ }
134
+ ```
135
+
136
+ **Document the current hours** - this is what your staff will inherit!
137
+
138
+ ### 3A. Strategy A: Configure Business Hours First
139
+
140
+ If following Strategy A, ensure business hours are set correctly BEFORE creating staff:
141
+ 1. Update or replace existing business hours (follow business hours recipe)
142
+ 2. Verify the final business hours configuration
143
+ 3. Proceed to create staff (they'll inherit these correct hours)
144
+
145
+ ### 3B. Strategy B: Create Staff with Current Hours
146
+
147
+ If following Strategy B, accept that staff will inherit current (possibly incorrect) hours and plan to configure them individually later.
148
+
149
+ ### 4. Create Staff Members
150
+
151
+ Create staff members using the Staff API (`POST https://www.wixapis.com/bookings/v1/staff-members`) with required information:
152
+ - Name (required)
153
+ - Email (optional but recommended)
154
+ - Phone (optional)
155
+ - Description/Professional bio (optional)
156
+
157
+ **⚠️ INHERITANCE MOMENT**: The moment this API call completes, the staff member inherits the current business hours. There's no "undo" for this inheritance.
158
+
159
+ **Save Critical IDs from Response**:
160
+ - `staffMember.id` for updates and schedule assignment
161
+ - `staffMember.resourceId` for services and event resources
162
+ - `staffMember.resource.eventsSchedule.id` for working hours events
163
+ - `staffMember.resource.usesDefaultWorkingHours` (should be `true` initially)
164
+
165
+ ### 5. Set Up Custom Working Hours (Two-Step Process)
166
+
167
+ **Only needed if**: You want staff to have different hours than what they inherited, OR you followed Strategy B.
168
+
169
+ **Step 5A: Assign Custom Working Hours Schedule**
170
+
171
+ Get staff member details (`GET https://www.wixapis.com/bookings/v1/staff-members/<STAFF_MEMBER_ID>?fields=RESOURCE_DETAILS`) to extract the events schedule ID. Call `assignWorkingHoursSchedule` (`POST https://www.wixapis.com/bookings/v1/staff-members/<STAFF_MEMBER_ID>/assign-working-hours-schedule`) using the staff member ID and their events schedule ID. This detaches the staff member from business default hours.
172
+
173
+ Verify the response shows `"usesDefaultWorkingHours": false`.
174
+
175
+ **Step 5B: Create WORKING_HOURS Events**
176
+
177
+ Use the Events API (`POST https://www.wixapis.com/calendar/v3/bulk/events/create`) to create working hours events for each working day. Each event must include:
178
+ - `scheduleId`: Staff member's events schedule ID
179
+ - `externalScheduleId`: Staff member's resource ID
180
+ - `type`: `"WORKING_HOURS"`
181
+ - `resources` array: Staff member's resource ID
182
+ - `appId`: Wix Bookings app ID
183
+ - Proper recurrence rules with single-day specification
184
+
185
+ Create separate events for each day of the week the staff member works.
186
+
187
+ ### 6. Verify Setup
188
+
189
+ Query the staff member to confirm:
190
+ - `"usesDefaultWorkingHours": false` (if you set custom hours)
191
+ - Query working hours events to verify proper creation with correct `type` and resource associations
192
+ - Test booking availability to ensure hours are applied correctly
193
+
194
+ ### IMPORTANT NOTES
195
+
196
+ * **ID Relationship Critical**: Use staff member ID for assignment, events schedule ID for event `scheduleId`, and resource ID for `externalScheduleId` and `resources` array
197
+ * **Foundation First**: Complete foundation setup before staff operations to avoid "Business schedule not found" errors
198
+ * **Complete Two-Step Process**: Both schedule assignment AND event creation are mandatory for custom working hours
199
+ * **Event Field Requirements**: Include all required fields even if they appear optional in basic documentation
200
+ * **Revision Management**: Always fetch current revision numbers before updating events
201
+ * **Date Format Strict**: Use precise ISO 8601 format without timezone indicators
202
+ * **Inheritance is Permanent**: Once inherited, business hours changes don't affect existing staff
203
+
204
+ ### Troubleshooting Common Issues
205
+
206
+ **"Business schedule not found" Error**:
207
+ Execute systematic diagnosis: check app installation, site properties, calendar schedule, and working hours events in sequence. Fix the first failed component before proceeding.
208
+
209
+ **Staff Member Still Shows Default Hours**:
210
+ Completed assignment but missing event creation. Create `WORKING_HOURS` events using the Bulk Create Events API.
211
+
212
+ **Staff Inherited Wrong Hours**:
213
+ - **Root Cause**: Business hours were incorrect when staff was created
214
+ - **Solution**: Either update business hours first (affects future staff) or configure each existing staff member individually
215
+
216
+ **Multiple Staff Have Different Inherited Hours**:
217
+ - **Root Cause**: Business hours changed between staff creation times
218
+ - **Solution**: Standardize by configuring custom hours for all staff, or recreate staff after fixing business hours
219
+
220
+ **"Invalid scheduleId" or "Resource not found" Errors**:
221
+ Using wrong ID type in API calls. Verify you're using events schedule ID for `scheduleId`, resource ID for `externalScheduleId` and `resources` array, and staff member ID for updates.
222
+
223
+ **Event Update Fails with Revision Error**:
224
+ Get current event details first and include the revision number in update requests.
225
+
226
+ **Cannot Create Events for Past Dates**:
227
+ Use current or future dates for recurring event start dates.
228
+
229
+ **Events Not Linked to Staff Member**:
230
+ Ensure `resources` array contains staff member's resource ID and `externalScheduleId` is properly set.
231
+
232
+ ### Working with Existing Staff
233
+
234
+ If working with existing staff members, first retrieve their details using `queryStaffMembers` with `RESOURCE_DETAILS` fieldmask to get the necessary IDs for schedule configuration. This allows you to configure custom working hours for staff members that were created previously.
235
+
236
+ **Check Their Current Inheritance**:
237
+ - Look at `usesDefaultWorkingHours` field
238
+ - If `true`: They're still using business hours they inherited at creation
239
+ - If `false`: They have custom hours (may have been configured previously)
240
+
241
+ ### Common Gotchas
242
+
243
+ 1. **Wrong Order**: Creating staff before fixing business hours leads to incorrect inheritance
244
+ 2. **Inheritance Assumption**: Thinking business hour changes affect existing staff
245
+ 3. **Incomplete Custom Setup**: Only doing schedule assignment without creating events
246
+ 4. **Mixed Timing**: Creating staff at different times when business hours are changing
247
+ 5. **ID Confusion**: Using wrong ID types in API calls
248
+
249
+ ## API Documentation References
250
+
251
+ * [Create Staff Member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/create-staff-member)
252
+ * [Query Staff Members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/query-staff-members)
253
+ * [Assign Working Hours Schedule](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/assign-working-hours-schedule)
254
+ * [Schedules and Sessions API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/schedules-and-sessions/schedule-and-sessions/introduction)
255
+ * [Apps Created by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix)