@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,278 @@
1
+ ---
2
+ name: "End-to-End Booking Flow"
3
+ description: Complete booking flow from service discovery to payment. Query services, check availability with Time Slots V2, create bookings, and process payment via eCommerce checkout.
4
+ ---
5
+
6
+ # End-to-End Booking Flow (REST)
7
+
8
+ Step-by-step flow for implementing a complete booking experience using REST APIs.
9
+
10
+ ## Prerequisites
11
+
12
+ - **Wix Bookings app installed** (App ID: `13d21c63-b5ec-5912-8397-c3a5ddb27a97`)
13
+ - For paid services: Wix Payments or eCommerce configured
14
+
15
+ > **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.
16
+
17
+ ## Required APIs
18
+
19
+ - **Services API**: [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services)
20
+ - **Time Slots V2 API**: [List Availability Time Slots](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-availability-time-slots)
21
+ - **Bookings API**: [Create Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/create-booking), [Confirm Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/confirm-booking)
22
+ - **eCommerce API**: [Create Checkout](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/checkout/create-checkout)
23
+
24
+ ---
25
+
26
+ ## Step 1: Query Available Services
27
+
28
+ **Endpoint**: `POST https://www.wixapis.com/bookings/v2/services/query`
29
+
30
+ ```json
31
+ {
32
+ "query": {
33
+ "filter": {
34
+ "type": "APPOINTMENT"
35
+ },
36
+ "paging": {
37
+ "limit": 20
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ **Service Types**:
44
+
45
+ - `APPOINTMENT` — One-on-one sessions with a staff member
46
+ - `CLASS` — Group sessions at scheduled times
47
+ - `COURSE` — Multi-session series (customers book the entire course)
48
+
49
+ **Save from the response**:
50
+
51
+ - `id` — service ID
52
+ - `schedule.id` — schedule ID (needed for appointment bookings and course bookings)
53
+ - `type` — determines the booking flow (slot vs schedule)
54
+ - `staffMemberIds` — resource IDs of assigned staff (for appointments)
55
+
56
+ ---
57
+
58
+ ## Step 2: Check Availability
59
+
60
+ **Endpoint**: `POST https://www.wixapis.com/_api/service-availability/v2/time-slots`
61
+
62
+ > **Important**: The old Availability Calendar API (`/bookings/v2/availability/query`) is deprecated. Always use Time Slots V2.
63
+
64
+ ```json
65
+ {
66
+ "serviceId": "<SERVICE_ID>",
67
+ "fromLocalDate": "2024-06-15T08:00:00",
68
+ "toLocalDate": "2024-06-16T18:00:00",
69
+ "timeZone": "America/New_York",
70
+ "bookable": true,
71
+ "includeResourceTypeIds": ["<RESOURCE_TYPE_ID>"]
72
+ }
73
+ ```
74
+
75
+ ### Date format
76
+
77
+ Dates **must** be in `YYYY-MM-DDThh:mm:ss` format (local datetime). Plain dates like `2024-06-15` will be rejected with a 400 error.
78
+
79
+ ### Parameters
80
+
81
+ | Parameter | Required | Description |
82
+ | ------------------------ | -------- | ----------------------------------------------------------------------- |
83
+ | `serviceId` | Yes | From Step 1 |
84
+ | `fromLocalDate` | Yes | Start of range in `YYYY-MM-DDThh:mm:ss` format |
85
+ | `toLocalDate` | Yes | End of range in `YYYY-MM-DDThh:mm:ss` format |
86
+ | `timeZone` | Yes | IANA timezone (e.g. `America/New_York`) |
87
+ | `bookable` | No | Set `true` to only get bookable slots |
88
+ | `includeResourceTypeIds` | No | Array of resource type IDs — populates `availableResources` in response |
89
+
90
+ ### Save from each time slot
91
+
92
+ - `serviceId`, `scheduleId` — needed for Create Booking
93
+ - `localStartDate`, `localEndDate` — slot times
94
+ - `availableResources[].resources[].id` — resource ID (only populated if `includeResourceTypeIds` was provided)
95
+ - `location.locationType` — **warning**: returns `BUSINESS` but Create Booking requires `OWNER_BUSINESS` (see Step 3)
96
+
97
+ ### For Classes
98
+
99
+ Use [List Event Time Slots](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-event-time-slots) instead. Each class session has an `eventId` — save it for the booking.
100
+
101
+ ---
102
+
103
+ ## Step 3: Create the Booking
104
+
105
+ **Endpoint**: `POST https://www.wixapis.com/_api/bookings-service/v2/bookings`
106
+
107
+ ### For Appointments (use `slot`)
108
+
109
+ ```json
110
+ {
111
+ "booking": {
112
+ "bookedEntity": {
113
+ "slot": {
114
+ "serviceId": "<SERVICE_ID>",
115
+ "scheduleId": "<SCHEDULE_ID>",
116
+ "startDate": "2024-06-15T14:00:00",
117
+ "endDate": "2024-06-15T15:00:00",
118
+ "timezone": "America/New_York",
119
+ "resource": {
120
+ "id": "<RESOURCE_ID>"
121
+ },
122
+ "location": {
123
+ "locationType": "OWNER_BUSINESS"
124
+ }
125
+ }
126
+ },
127
+ "contactDetails": {
128
+ "firstName": "John",
129
+ "lastName": "Doe",
130
+ "email": "john@example.com"
131
+ },
132
+ "totalParticipants": 1
133
+ }
134
+ }
135
+ ```
136
+
137
+ All slot fields are **required** for appointments when no `eventId` is provided:
138
+
139
+ | Field | Source | Notes |
140
+ | ----------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
141
+ | `serviceId` | Step 1 | Service GUID |
142
+ | `scheduleId` | Step 2 | From the time slot response |
143
+ | `startDate` / `endDate` | Step 2 | `YYYY-MM-DDThh:mm:ss` format |
144
+ | `timezone` | Step 2 | IANA tz format |
145
+ | `resource.id` | Step 2 | From `availableResources` in time slot response |
146
+ | `location.locationType` | — | Must be `OWNER_BUSINESS`, `OWNER_CUSTOM`, or `CUSTOM`. Time Slots returns `BUSINESS` but that value is **not accepted** here |
147
+
148
+ ### For Classes (use `slot` with `eventId`)
149
+
150
+ ```json
151
+ {
152
+ "booking": {
153
+ "bookedEntity": {
154
+ "slot": {
155
+ "serviceId": "<SERVICE_ID>",
156
+ "eventId": "<EVENT_ID>"
157
+ }
158
+ },
159
+ "contactDetails": {
160
+ "firstName": "Jane",
161
+ "lastName": "Doe",
162
+ "email": "jane@example.com"
163
+ },
164
+ "totalParticipants": 1
165
+ }
166
+ }
167
+ ```
168
+
169
+ When you provide `eventId`, all other slot fields (`startDate`, `endDate`, `timezone`, `resource`, `location`) are **auto-derived** from the event. You only need `serviceId` + `eventId`.
170
+
171
+ ### For Courses (use `schedule`)
172
+
173
+ ```json
174
+ {
175
+ "booking": {
176
+ "bookedEntity": {
177
+ "schedule": {
178
+ "scheduleId": "<SCHEDULE_ID>",
179
+ "serviceId": "<SERVICE_ID>",
180
+ "timezone": "America/New_York",
181
+ "location": {
182
+ "locationType": "OWNER_BUSINESS"
183
+ }
184
+ }
185
+ },
186
+ "contactDetails": {
187
+ "firstName": "Bob",
188
+ "lastName": "Test",
189
+ "email": "bob@example.com"
190
+ },
191
+ "totalParticipants": 1
192
+ }
193
+ }
194
+ ```
195
+
196
+ ### Participants
197
+
198
+ Specify exactly one of:
199
+
200
+ - `totalParticipants` — for services with fixed pricing and no variants
201
+ - `participantsChoices` — for services with [variants and options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction)
202
+
203
+ ### Result
204
+
205
+ Booking is created with `status: CREATED`. This is **not yet visible** in the booking calendar. You must either:
206
+
207
+ - **Confirm it** (Step 4, for offline/free payments), or
208
+ - **Process payment** (Step 4, for online payments) — confirmation happens automatically after checkout
209
+
210
+ ---
211
+
212
+ ## Step 4: Confirm or Process Payment
213
+
214
+ ### For free or offline-payment bookings: Confirm directly
215
+
216
+ **Endpoint**: `POST https://www.wixapis.com/_api/bookings-service/v2/bookings/<BOOKING_ID>/confirm`
217
+
218
+ ```json
219
+ {
220
+ "revision": "<REVISION>",
221
+ "paymentStatus": "EXEMPT"
222
+ }
223
+ ```
224
+
225
+ Use the `id` and `revision` from the Create Booking response. Set `paymentStatus` to `EXEMPT` for free services or `NOT_PAID` for pay-at-location.
226
+
227
+ **Result**: Booking status changes to `CONFIRMED` and is visible in the booking calendar.
228
+
229
+ ### For online payments: Create checkout
230
+
231
+ **4a. Create Checkout**
232
+
233
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/checkouts`
234
+
235
+ ```json
236
+ {
237
+ "lineItems": [
238
+ {
239
+ "catalogReference": {
240
+ "catalogItemId": "<BOOKING_ID>",
241
+ "appId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97"
242
+ },
243
+ "quantity": 1
244
+ }
245
+ ],
246
+ "channelType": "WEB"
247
+ }
248
+ ```
249
+
250
+ Use the booking ID as `catalogItemId` with the Wix Bookings app ID.
251
+
252
+ **4b. Get Checkout URL**
253
+
254
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/checkouts/{checkoutId}/getCheckoutUrl`
255
+
256
+ Redirect the user to the returned `checkoutUrl`. After payment, the booking is automatically confirmed.
257
+
258
+ **4c. Create Order (alternative, server-to-server)**
259
+
260
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/checkouts/{checkoutId}/createOrder`
261
+
262
+ Creates an order directly without redirect.
263
+
264
+ ---
265
+
266
+ ## Service Type Summary
267
+
268
+ | Service Type | `bookedEntity` | Availability API | Key Difference |
269
+ | ------------ | ------------------------------------- | ------------------------------------------ | ---------------------------------------------------------- |
270
+ | APPOINTMENT | `slot` (all fields required) | Time Slots V2 | Single session, specific time, needs resource + scheduleId |
271
+ | CLASS | `slot` (only `serviceId` + `eventId`) | Event Time Slots | Group session, auto-derives fields from event |
272
+ | COURSE | `schedule` | Check capacity via Query Extended Bookings | Multi-session, books entire schedule |
273
+
274
+ ## See Also
275
+
276
+ - [Flow: Single-Service Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/flow-single-service-booking)
277
+ - [Create Booking Sample Flows](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/sample-flows)
278
+ - [Time Slots V2 Sample Flows](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/sample-flows)
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: "External Calendar Integration"
3
+ description: OAuth-based integration with Google Calendar, Microsoft Outlook, and Apple Calendar. Covers authentication flows, sync configuration, and bidirectional event management.
4
+ ---
5
+ # Technical Step-by-Step Instructions: Connecting External Calendars (Google, Microsoft, Apple) to Wix Bookings (Real-World, API-First)
6
+
7
+ ## Description
8
+
9
+ Below are the recommended steps to successfully connect and sync external calendars (Google Calendar, Microsoft Outlook, Apple Calendar) with Wix Bookings, with real-world troubleshooting and fixes for common API issues. This recipe covers the complete OAuth flow, sync configuration, and verification procedures.
10
+
11
+
12
+ ---
13
+
14
+ ## Prerequisites
15
+
16
+ ### Required Features and Apps
17
+
18
+ Before connecting external calendars, ensure the following requirements are met:
19
+
20
+ 1. **Wix Bookings** - Core app must be installed and configured
21
+ 2. **Premium Plan** - External calendar integration requires premium features enabled
22
+ 3. **Active Staff or Business Schedule** - Target schedule must exist for connection
23
+
24
+ ### Premium Feature Validation
25
+
26
+ **CRITICAL**: External calendar integration is a **premium feature**. If not enabled, you'll receive a 403 error with `"PREMIUM_FEATURE_NOT_ENABLED"` code.
27
+
28
+ **Verification Steps:**
29
+ 1. Attempt to list providers - should return Google, Microsoft, Apple
30
+ 2. If 403 error occurs, upgrade plan or enable premium features
31
+ 3. Contact Wix support if premium features aren't accessible after upgrade
32
+
33
+ ### App Installation Process
34
+
35
+ If you encounter app-related errors, install the required apps using the Apps Installer API.
36
+
37
+ **For detailed app installation procedures, refer to:**
38
+ - [Apps Installer API Documentation](https://dev.wix.com/docs/api-reference/business-management/app-installation/install-app)
39
+ - Business setup recipes for comprehensive app installation workflows
40
+
41
+ ## Overview
42
+
43
+ Wix External Calendar integration allows bidirectional sync between Wix schedules and external calendar providers. The system supports:
44
+
45
+ - **Google Calendar** - OAuth authentication, primary calendar sync
46
+ - **Microsoft Outlook/365** - OAuth authentication, specific calendar selection
47
+ - **Apple Calendar** - Credential authentication, dedicated calendar creation
48
+
49
+ ### CRITICAL API DISCOVERY
50
+
51
+ **❌ COMMON ENDPOINT MISTAKES**:
52
+ - `/bookings/v2/external-calendar/providers` (missing 's' in calendars)
53
+ - `/calendar/v3/external-calendars/` (wrong namespace)
54
+
55
+ **✅ CORRECT ENDPOINTS**:
56
+ - List Providers: `/bookings/v2/external-calendars/providers`
57
+ - Connect OAuth: `/bookings/v2/external-calendars/connections:connectByOAuth`
58
+ - List Connections: `/bookings/v2/external-calendars/connections`
59
+
60
+ ### Key Discovery: Schedule Selection Strategy
61
+
62
+ **Schedule Types Available:**
63
+ - **Business Schedule**: Universal external ID `4e0579a5-491e-4e70-a872-d097eed6e520`
64
+ - **Staff Schedules**: Individual staff member schedules with unique IDs
65
+
66
+ **Recommendation:**
67
+ - Use **Staff Schedules** for personal calendar sync (individual staff members)
68
+ - Use **Business Schedule** for company-wide calendar integration
69
+ - **Never connect the same external calendar to multiple schedules** - causes conflicts
70
+
71
+ ### IMPORTANT NOTES
72
+
73
+ * **Premium Feature Gate**: Always verify premium features are enabled before attempting connections
74
+ * **OAuth Flow Complexity**: The OAuth process requires user interaction - cannot be fully automated
75
+ * **Sync Configuration**: Default settings may not match your needs - always review `syncConfig` after connection
76
+ * **Provider-Specific Behaviors**: Google only syncs primary calendar, Microsoft allows specific calendar selection
77
+ * **Connection Ownership**: If schedule ownership changes, external calendar connection is automatically disconnected
78
+ * **Real-Time Limitations**: External Calendar API doesn't provide webhooks or real-time event notifications
79
+ * **Revision Numbers**: External calendar connections don't use revision numbers like other calendar entities
80
+
81
+ ---
82
+
83
+ ## Steps
84
+
85
+ ### 1. Verify Premium Features and List Providers
86
+
87
+ First, confirm external calendar features are available and identify supported providers.
88
+
89
+ Use `listProviders` API ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/list-providers)):
90
+
91
+ **Expected Response Structure:**
92
+ - **Google Provider**: `name: "Google"`, `features.connectMethods: ["OAUTH"]`
93
+ - **Microsoft Provider**: `name: "Outlook or Office 365"`, `features.connectMethods: ["OAUTH"]`
94
+ - **Apple Provider**: `name: "Apple"`, `features.connectMethods: ["CREDENTIALS"]`
95
+
96
+ Save the `providerId` for your desired provider and note the required `connectMethods`.
97
+
98
+ ### 2. Query Available Schedules
99
+
100
+ Identify which schedule to connect the external calendar to using `querySchedules` API ([REST](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/query-schedules)):
101
+
102
+ **Schedule Selection Guide:**
103
+ - **Staff Schedule**: Use for individual staff member calendar sync
104
+ - **Business Schedule**: Use for company-wide availability sync
105
+ - **Multiple Schedules**: Create separate connections for each schedule if needed
106
+
107
+ Save the `scheduleId` for your chosen schedule.
108
+
109
+ ### 3. Initiate OAuth Connection (Google/Microsoft)
110
+
111
+ For OAuth providers (Google, Microsoft), create a connection using `connectByOAuth` API ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/connect-by-o-auth)):
112
+
113
+ **Required Parameters:**
114
+ - `providerId`: From step 1
115
+ - `scheduleId`: From step 2
116
+ - `redirectUrl`: Where user returns after authorization (can be placeholder)
117
+
118
+ **Response Contains:**
119
+ - `oauthUrl`: URL to redirect user for authorization
120
+
121
+ **User Authorization Flow:**
122
+ 1. Direct user to the `oauthUrl`
123
+ 2. User completes Google/Microsoft authorization
124
+ 3. User is redirected to `redirectUrl` with `connectionId` parameter
125
+ 4. Extract `connectionId` from redirect URL query parameters
126
+
127
+ ### 4. Alternative: Connect by Credentials (Apple)
128
+
129
+ For credential-based providers (Apple), use `connectByCredentials` API ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/connect-by-credentials)):
130
+
131
+ **Required Parameters:**
132
+ - `providerId`: Apple provider ID
133
+ - `scheduleId`: Target schedule ID
134
+ - `email`: Apple ID email
135
+ - `password`: Apple ID password
136
+
137
+ **Important**: This method requires collecting sensitive credentials from users.
138
+
139
+ ### 5. Verify Connection and Configure Sync
140
+
141
+ After successful connection, verify the connection status and configure sync settings:
142
+
143
+ **Check Connection:**
144
+ Use `getConnection` API ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/get-connection)) with the `connectionId`.
145
+
146
+ **Review Sync Configuration:**
147
+ - **Connection Status**: Should show `"CONNECTED"` when successful
148
+ - **Import Settings**: `syncConfig.listEventFromCalendars.enabled` controls importing external events to Wix
149
+ - **Export Settings**: `syncConfig.syncToCalendar.enabled` controls exporting Wix events to external calendar
150
+
151
+ **Update Sync Settings (if needed):**
152
+ Use `updateSyncConfig` API ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/update-sync-config)) to modify import/export behavior.
153
+
154
+ ### 6. Test Connection and List Events
155
+
156
+ Verify the integration is working by listing external calendar events:
157
+
158
+ Use `listEvents` API ([REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/list-events)) with date range filters:
159
+
160
+ **Required Parameters:**
161
+ - `from`: Start date (required)
162
+ - `to`: End date (required)
163
+ - `scheduleIds`: Optional filter by specific schedules
164
+
165
+ This should return events from the connected external calendar.
166
+
167
+ ### IMPORTANT NOTES
168
+
169
+ * **OAuth Completion**: OAuth flow requires actual user interaction - cannot be automated
170
+ * **Connection Persistence**: Connections remain active until manually disconnected or ownership changes
171
+ * **Sync Timing**: Event synchronization is not real-time - may take several minutes
172
+ * **Calendar Permissions**: External calendar must grant appropriate read/write permissions
173
+ * **Multiple Connections**: Each schedule can connect to multiple external calendar providers
174
+ * **Error Recovery**: Failed OAuth attempts can be retried with new `connectByOAuth` calls
175
+
176
+ ### Troubleshooting Common Issues
177
+
178
+ **"PREMIUM_FEATURE_NOT_ENABLED" Error (403):**
179
+ - Verify site has premium plan enabled
180
+ - Contact Wix support to enable external calendar features
181
+ - Cannot proceed without premium feature access
182
+
183
+ **"Not Found" Error (404) on Providers:**
184
+ - Check endpoint URL has 's' in 'calendars': `/external-calendars/providers`
185
+ - Verify Wix Bookings app is installed
186
+ - Ensure using correct API version (v2)
187
+
188
+ **OAuth Authorization Fails:**
189
+ - Check `redirectUrl` is accessible and properly formatted
190
+ - Verify user has appropriate permissions for external calendar
191
+ - Try incognito/private browsing to avoid cached authorization issues
192
+ - Check external calendar provider status (Google/Microsoft outages)
193
+
194
+ **OAuth Internal Server Errors:**
195
+ - **"Internal Server Error" during Google OAuth**: Common issue that can occur after account selection
196
+ - **Immediate retry strategy**: Try the same OAuth flow again - temporary server issues often resolve
197
+ - **Alternative schedule approach**: If business schedule fails, try connecting to a staff schedule instead (or vice versa)
198
+ - **Browser troubleshooting**: Clear cookies/cache for the calendar provider's domain, or use incognito/private mode
199
+ - **Different redirect URL**: Try using a different `redirectUrl` parameter (e.g., `https://www.wix.com` instead of custom URLs)
200
+ - **Account-specific issues**: Try a different Google/Microsoft account if available for testing
201
+ - **Timing-based retry**: Wait 5-10 minutes between failed attempts - OAuth rate limiting may be involved
202
+
203
+ **OAuth Flow Recovery Steps:**
204
+ 1. **First attempt fails** → Retry immediately with same parameters
205
+ 2. **Second attempt fails** → Try alternative schedule type (business ↔ staff)
206
+ 3. **Third attempt fails** → Clear browser data and use incognito mode
207
+ 4. **Fourth attempt fails** → Try different redirect URL parameter
208
+ 5. **All attempts fail** → Switch to different calendar provider (Google → Microsoft → Apple)
209
+
210
+ **Connection Shows "DISCONNECTED" Status:**
211
+ - Schedule ownership may have changed
212
+ - External calendar permissions may have been revoked
213
+ - User may have disconnected from external calendar provider side
214
+ - Recreate connection with fresh OAuth flow
215
+
216
+ **Events Not Syncing:**
217
+ - Check `syncConfig` settings match intended behavior
218
+ - Verify date range filters in `listEvents` calls
219
+ - Allow 5-10 minutes for sync to complete
220
+ - Check external calendar permissions and sharing settings
221
+
222
+ **Multiple Calendar Connections Conflict:**
223
+ - Avoid connecting same external calendar to multiple Wix schedules
224
+ - Use specific calendar selection for Microsoft Outlook connections
225
+ - Document which staff schedules connect to which external calendars
226
+
227
+ **Apple Calendar Credential Issues:**
228
+ - Verify Apple ID supports third-party app access
229
+ - Check if two-factor authentication requires app-specific passwords
230
+ - Test credentials in Apple Calendar app before API calls
231
+
232
+ ### Provider-Specific Notes
233
+
234
+ **Google Calendar:**
235
+ - Only syncs with primary calendar
236
+ - Requires Google account with calendar access
237
+ - OAuth scope: `https://www.googleapis.com/auth/calendar`
238
+
239
+ **Microsoft Outlook/365:**
240
+ - Allows specific calendar selection
241
+ - Supports both personal and business accounts
242
+ - May require additional organizational permissions
243
+
244
+ **Apple Calendar:**
245
+ - Uses credential authentication (email/password)
246
+ - Creates dedicated calendar for Wix events
247
+ - May require app-specific password if 2FA enabled
248
+
249
+ ## API Documentation References
250
+
251
+ * [List Providers](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/list-providers)
252
+ * [Connect By OAuth](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/connect-by-o-auth)
253
+ * [Connect By Credentials](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/connect-by-credentials)
254
+ * [Get Connection](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/get-connection)
255
+ * [Update Sync Config](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/update-sync-config)
256
+ * [List Events](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/list-events)
257
+ * [Query Schedules](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/query-schedules)
258
+ * [Apps Installer API](https://dev.wix.com/docs/api-reference/business-management/app-installation/install-app)