@wix/agent-skills 1.8.0 → 1.10.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 (66) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +2 -1
  3. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +14 -0
  4. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +11 -6
  5. package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +3 -17
  6. package/skills/wix-app/references/editor-react-component/SSR.md +119 -0
  7. package/skills/wix-design-system/SKILL.md +1 -1
  8. package/skills/wix-headless/references/BUILD-astro.md +5 -7
  9. package/skills/wix-headless/references/DESIGN_SYSTEM.md +6 -16
  10. package/skills/wix-headless/references/SETUP.md +1 -1
  11. package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +41 -333
  12. package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +77 -428
  13. package/skills/wix-headless/references/astro/cms/FAQ_KNOWLEDGE_BASE.md +2 -2
  14. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +7 -10
  15. package/skills/wix-headless/references/astro/ecom/CART_WIRING.md +2 -2
  16. package/skills/wix-headless/references/astro/ecom/COMPONENTS_CSS.md +3 -3
  17. package/skills/wix-headless/references/astro/gift-cards/COMPONENTS.md +2 -2
  18. package/skills/wix-headless/references/astro/stores/BACK_IN_STOCK.md +7 -7
  19. package/skills/wix-headless/references/astro/stores/COMPONENTS_CSS.md +4 -4
  20. package/skills/wix-headless/references/astro/stores/PRODUCT_PAGES.md +2 -2
  21. package/skills/wix-headless/references/astro/templates/Footer.astro +4 -4
  22. package/skills/wix-headless/references/astro/templates/Navigation.astro +4 -4
  23. package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +298 -142
  24. package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +104 -162
  25. package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +35 -14
  26. package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +11 -2
  27. package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +23 -85
  28. package/skills/wix-headless/references/astro/templates/bookings/bookingDriver.ts +245 -0
  29. package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +209 -198
  30. package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +114 -19
  31. package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +131 -15
  32. package/skills/wix-headless/references/astro/templates/ecom/CartView.tsx +3 -3
  33. package/skills/wix-headless/references/astro/templates/ecom/cart.astro +3 -3
  34. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +17 -17
  35. package/skills/wix-headless/references/astro/templates/ecom/thank-you.astro +3 -3
  36. package/skills/wix-headless/references/astro/templates/gift-cards/_home-teaser-snippet.astro +4 -4
  37. package/skills/wix-headless/references/astro/templates/gift-cards/components-gift-cards.css +19 -18
  38. package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.astro +3 -3
  39. package/skills/wix-headless/references/astro/templates/global.css +17 -15
  40. package/skills/wix-headless/references/astro/templates/index.astro +4 -4
  41. package/skills/wix-headless/references/astro/templates/stores/components-stores.css +31 -31
  42. package/skills/wix-headless/references/astro/templates/stores/products/[slug].astro +4 -4
  43. package/skills/wix-headless/references/bookings/FLOW.md +246 -0
  44. package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +65 -76
  45. package/skills/wix-headless/references/bookings/SERVICES_DATA.md +60 -0
  46. package/skills/wix-headless/references/custom/bookings/WIRING.md +169 -60
  47. package/skills/wix-headless/references/shared/DESIGN_MD.md +2 -3
  48. package/skills/wix-headless/references/shared/IMPLEMENTER.md +4 -4
  49. package/skills/wix-headless/references/shared/STYLING.md +15 -18
  50. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +2 -2
  51. package/skills/wix-headless/references/verticals/bookings.md +9 -9
  52. package/skills/wix-headless/scripts/compose.mjs +4 -19
  53. package/skills/wix-headless/scripts/emit-design-tokens.mjs +0 -3
  54. package/skills/wix-manage/SKILL.md +12 -0
  55. package/skills/wix-manage/references/app-installation/install-wix-apps.md +3 -27
  56. package/skills/wix-manage/references/bookings/create-appointment-service.md +254 -0
  57. package/skills/wix-manage/references/bookings/create-booking-service-from-prompt.md +37 -0
  58. package/skills/wix-manage/references/bookings/create-class-service.md +233 -0
  59. package/skills/wix-manage/references/bookings/create-course-service.md +237 -0
  60. package/skills/wix-manage/references/cms/cms-data-items-crud.md +2 -1
  61. package/skills/wix-manage/references/cms/cms-schema-management.md +1 -1
  62. package/skills/wix-manage/references/stores/create-product-from-image.md +154 -2
  63. package/skills/wix-headless/references/astro/templates/bookings/ManageBooking.tsx +0 -84
  64. package/skills/wix-headless/references/astro/templates/bookings/api/confirm-booking.ts +0 -34
  65. package/skills/wix-headless/references/astro/templates/bookings/api/waitlist.ts +0 -74
  66. package/skills/wix-headless/references/astro/templates/bookings/manage-booking.astro +0 -76
@@ -4,7 +4,7 @@ description: Installs Wix apps on a site using Apps Installer API. Covers enabli
4
4
  ---
5
5
  # Install Wix Apps on a Site
6
6
 
7
- This recipe guides you through installing Wix apps on a site using the Apps Installer REST API, including enabling Velo (Wix Code) when needed.
7
+ This recipe guides you through installing Wix apps on a site using the Apps Installer REST API.
8
8
 
9
9
  ## Prerequisites
10
10
 
@@ -51,30 +51,8 @@ Use the returned `appId` as the `appDefId` in Step 2.
51
51
  - The `appDefId` field in the install request and the `appId` field returned here are the same value
52
52
  - If multiple results come back, match on `basicInfo.name` to confirm you have the right app before installing
53
53
  - Only listings with `status: "PUBLISHED"` can be installed
54
- ## Step 1: Enable Velo (Wix Code) if Needed
55
54
 
56
- If you receive the error `WDE0110: Wix Code not enabled`, you must first enable Velo on the site.
57
-
58
- **Endpoint**: `POST https://www.wixapis.com/mcp-serverless/v1/velo/provision`
59
-
60
- **Request**:
61
- ```bash
62
- curl -X POST \
63
- 'https://www.wixapis.com/mcp-serverless/v1/velo/provision/' \
64
- -H 'Authorization: <AUTH>' \
65
- -H 'Content-Type: application/json' \
66
- -d '{}'
67
- ```
68
-
69
- **Response**: Empty body on success.
70
-
71
- ### IMPORTANT NOTES:
72
- - Only call this endpoint if you receive the `WDE0110` error
73
- - This is a one-time operation per site
74
-
75
- ---
76
-
77
- ## Step 2: Install the Wix App
55
+ ## Install the Wix App
78
56
 
79
57
  Use the Apps Installer API to install any Wix app on a site.
80
58
 
@@ -122,6 +100,7 @@ Some common apps:
122
100
  | Wix Blog | `14bcded7-0066-7c35-14d7-466cb3f09103` |
123
101
  | Wix Events | `140603ad-af8d-84a5-2c80-a0f60cb47351` |
124
102
  | Wix Pricing Plans | `1522827f-c56c-a5c9-2ac9-00f9e6ae12d3` |
103
+ | Wix CMS | `e593b0bd-b783-45b8-97c2-873d42aacaf4` |
125
104
 
126
105
  ### IMPORTANT NOTES:
127
106
  - NEVER guess the `appDefId`. For Wix-built apps, use the table above. For any other app, resolve the ID using Step 0 (Search Market Listings).
@@ -135,9 +114,6 @@ Some common apps:
135
114
  ### App Not Installed Error
136
115
  If you receive an error indicating a required app is not installed, use this recipe to install it before proceeding.
137
116
 
138
- ### WDE0110: Wix Code not enabled
139
- Call the Velo provision endpoint (Step 1) first, then retry the original operation.
140
-
141
117
  ---
142
118
 
143
119
  ## Next Steps
@@ -0,0 +1,254 @@
1
+ ---
2
+ name: "Create Appointment Service"
3
+ description: "Create an appointment booking service — e.g. 'set up consultations', 'create a 1-on-1 session', 'add a personal training appointment', 'create a meeting service for $25'. Handles staff assignment (required), session duration, pricing, and 1-on-1 capacity defaults via bulkCreateServices API."
4
+ ---
5
+
6
+ # Create Appointment Service from Prompt
7
+
8
+ ## When to Use
9
+
10
+ - User wants to create an appointment-based service: "set up consultations", "create a 1-on-1 session", "add a personal training appointment", "create a meeting service"
11
+ - The service type is APPOINTMENT — customer picks an available time slot during staff working hours
12
+ - For general service creation where the type is ambiguous, see [Create Booking Service from Prompt](./create-booking-service-from-prompt.md)
13
+
14
+ ## Prerequisites
15
+
16
+ - **Wix Bookings app installed** (App ID: `13d21c63-b5ec-5912-8397-c3a5ddb27a97`). Use [List Installed Apps](../app-installation/list-installed-apps.md) to verify, and [Install Wix Apps](../app-installation/install-wix-apps.md) to install if missing.
17
+ - For full API field definitions, validation rules, and troubleshooting, see [Create and Update Booking Services](./create-and-update-booking-services.md)
18
+
19
+ ---
20
+
21
+ ## Step 1: Gather Business Context
22
+
23
+ Run these queries to collect site data for informed defaults.
24
+
25
+ ### 1a. Query Staff Members (CRITICAL for Appointments)
26
+
27
+ ```bash
28
+ curl -X POST 'https://www.wixapis.com/bookings/v1/staff-members/query' \
29
+ -H 'Authorization: <AUTH>' \
30
+ -H 'Content-Type: application/json' \
31
+ -d '{
32
+ "query": {},
33
+ "fields": ["RESOURCE_DETAILS"]
34
+ }'
35
+ ```
36
+
37
+ Save each staff member's `resourceId` (not `id`). Note which one has `default: true`.
38
+
39
+ **APPOINTMENT services REQUIRE at least one staff member.** If no staff members exist, create one first using [Bookings Staff Setup](./bookings-staff-setup.md).
40
+
41
+ ### 1b. Query Service Categories
42
+
43
+ ```bash
44
+ curl -X POST 'https://www.wixapis.com/bookings/v2/categories/query' \
45
+ -H 'Authorization: <AUTH>' \
46
+ -H 'Content-Type: application/json' \
47
+ -d '{ "query": {} }'
48
+ ```
49
+
50
+ ### 1c. Get Site Currency
51
+
52
+ ```bash
53
+ curl -X GET 'https://www.wixapis.com/site-properties/v4/properties' \
54
+ -H 'Authorization: <AUTH>'
55
+ ```
56
+
57
+ Extract `properties.paymentCurrency`. Fall back to `USD` if unavailable.
58
+
59
+ ### 1d. Query Existing Services (Duplicate Check)
60
+
61
+ ```bash
62
+ curl -X POST 'https://www.wixapis.com/bookings/v2/services/query' \
63
+ -H 'Authorization: <AUTH>' \
64
+ -H 'Content-Type: application/json' \
65
+ -d '{ "query": { "paging": { "limit": 100 } } }'
66
+ ```
67
+
68
+ Warn the user if a service with a similar name already exists.
69
+
70
+ ---
71
+
72
+ ## Step 2: Apply Appointment Defaults
73
+
74
+ For any fields the user did not explicitly specify:
75
+
76
+ | Field | Default | Notes |
77
+ |---|---|---|
78
+ | Duration | 60 minutes | Set via `schedule.availabilityConstraints.sessionDurations` |
79
+ | Capacity | 1 | Appointments are typically 1-on-1 |
80
+ | Staff | Auto-assign | Use `default: true` staff, or first available |
81
+ | Online booking | Enabled | `onlineBooking.enabled: true` |
82
+
83
+ ### Pricing (if not specified)
84
+
85
+ - Use the site's currency from Step 1c
86
+ - If user specifies a price → `rateType: "FIXED"`
87
+ - If user says "free" → `rateType: "NO_FEE"`, `options.inPerson: true`, `options.online: false`
88
+ - If no price mentioned → infer from context (consultations ~$50-100, sessions ~$30-60) or default to free
89
+
90
+ ### Staff Assignment
91
+
92
+ - **1 staff member** → auto-assign using their `resourceId`
93
+ - **Multiple staff members** → use the one with `default: true`, or the first one
94
+ - **No staff members** → create one first using [Bookings Staff Setup](./bookings-staff-setup.md), then proceed
95
+
96
+ ### Category
97
+
98
+ - If categories exist → assign the most relevant one
99
+ - If no categories exist → create a "General" category:
100
+ ```bash
101
+ curl -X POST 'https://www.wixapis.com/bookings/v2/categories' \
102
+ -H 'Authorization: <AUTH>' \
103
+ -H 'Content-Type: application/json' \
104
+ -d '{ "category": { "name": "General" } }'
105
+ ```
106
+
107
+ ### Service Name & Description
108
+
109
+ - Use the user's wording for the service name
110
+ - Generate a brief, professional description (1-2 sentences)
111
+
112
+ ---
113
+
114
+ ## Step 3: Create the Appointment Service
115
+
116
+ **Paid appointment:**
117
+
118
+ ```bash
119
+ curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/create' \
120
+ -H 'Authorization: <AUTH>' \
121
+ -H 'Content-Type: application/json' \
122
+ -d '{
123
+ "services": [{
124
+ "name": "<SERVICE_NAME>",
125
+ "description": "<GENERATED_DESCRIPTION>",
126
+ "type": "APPOINTMENT",
127
+
128
+ "onlineBooking": { "enabled": true },
129
+ "staffMemberIds": ["<RESOURCE_ID>"],
130
+ "schedule": {
131
+ "availabilityConstraints": {
132
+ "sessionDurations": [<DURATION_MINUTES>]
133
+ }
134
+ },
135
+ "payment": {
136
+ "rateType": "FIXED",
137
+ "options": { "online": true, "inPerson": false },
138
+ "fixed": {
139
+ "price": { "value": "<PRICE>", "currency": "<CURRENCY>" }
140
+ }
141
+ },
142
+ "category": {
143
+ "id": "<CATEGORY_ID>"
144
+ }
145
+ }]
146
+ }'
147
+ ```
148
+
149
+ **Free appointment:**
150
+
151
+ ```bash
152
+ curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/create' \
153
+ -H 'Authorization: <AUTH>' \
154
+ -H 'Content-Type: application/json' \
155
+ -d '{
156
+ "services": [{
157
+ "name": "<SERVICE_NAME>",
158
+ "description": "<GENERATED_DESCRIPTION>",
159
+ "type": "APPOINTMENT",
160
+
161
+ "onlineBooking": { "enabled": true },
162
+ "staffMemberIds": ["<RESOURCE_ID>"],
163
+ "schedule": {
164
+ "availabilityConstraints": {
165
+ "sessionDurations": [<DURATION_MINUTES>]
166
+ }
167
+ },
168
+ "payment": {
169
+ "rateType": "NO_FEE",
170
+ "options": { "online": false, "inPerson": true }
171
+ },
172
+ "category": {
173
+ "id": "<CATEGORY_ID>"
174
+ }
175
+ }]
176
+ }'
177
+ ```
178
+
179
+ ### APPOINTMENT-Specific Reminders
180
+
181
+ - `staffMemberIds` is **required** — uses `resourceId` values, not staff member `id`
182
+ - `schedule.availabilityConstraints.sessionDurations` sets the appointment length
183
+ - Availability is based on the assigned staff member's working hours schedule
184
+
185
+ Save the `serviceId` from the response: `results[0].item.service.id`
186
+
187
+ ---
188
+
189
+ ## Step 4: Summary Message
190
+
191
+ Provide a summary including:
192
+
193
+ 1. **What was created** — service name, price, duration, assigned staff member
194
+ 2. **Assumptions made** — list defaults used (e.g., "I set the duration to 60 minutes since you didn't specify")
195
+ 3. **Next steps** — "Click Save to finalize, then set up your availability"
196
+ 4. **Offer to adjust** — "Want me to change the price, duration, or staff assignment?"
197
+
198
+ **Example:**
199
+
200
+ > I created **"Strategy Consultation"**:
201
+ >
202
+ > - **Type**: Appointment (1-on-1)
203
+ > - **Price**: $75 per session
204
+ > - **Duration**: 60 minutes
205
+ > - **Staff**: Assigned to Sarah Johnson
206
+ > - **Category**: Consulting
207
+ >
208
+ > I assumed a 60-minute duration since you didn't specify. You can review and adjust the details in the service form.
209
+
210
+ ---
211
+
212
+ ## Error Handling
213
+
214
+ | Error | Cause | Action |
215
+ |---|---|---|
216
+ | 428 "App not installed" | Bookings not installed | Install using [Install Wix Apps](../app-installation/install-wix-apps.md) |
217
+ | 400 "staffMemberIds required" | No staff assigned | Query staff; if none exist, create one via [Bookings Staff Setup](./bookings-staff-setup.md) |
218
+ | 400 "INVALID_PAYMENT_OPTIONS" | Payment misconfigured | Free: `inPerson: true`, `online: false`. Paid: price > 0 |
219
+ | 403 | Permission denied | Inform user they lack permission |
220
+
221
+ ---
222
+
223
+ ## Payment Validation Quick Reference
224
+
225
+ | rateType | `options.online` | `options.inPerson` | Valid? |
226
+ |----------|------------------|-------------------|--------|
227
+ | FIXED | true | false | ✓ |
228
+ | FIXED | false | true | ✓ |
229
+ | FIXED | true | true | ✓ |
230
+ | NO_FEE | false | true | ✓ |
231
+ | NO_FEE | true | false | ✗ |
232
+ | Any | false | false | ✗ |
233
+
234
+ ---
235
+
236
+ ## What This Skill Does NOT Cover
237
+
238
+ - **Schedule/availability setup** — staff working hours need separate configuration. See [Bookings Staff Setup](./bookings-staff-setup.md)
239
+ - **Pricing plans** — memberships and session packs are separate. See [Create and Update Pricing Plans](../pricing-plans/create-and-update-pricing-plans.md)
240
+ - **Service images** — requires Media Manager API (see [create-and-update-booking-services.md](./create-and-update-booking-services.md))
241
+
242
+ ---
243
+
244
+ ## API Documentation Reference
245
+
246
+ - [Bulk Create Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/bulk-create-services)
247
+ - [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services)
248
+ - [Query Categories](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/query-categories)
249
+ - [Create Category](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/create-category)
250
+ - [Query Staff Members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/query-staff-members)
251
+ - [Create Staff Member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/create-staff-member)
252
+ - [Site Properties](https://dev.wix.com/docs/api-reference/business-management/site-management/site-properties/properties/read)
253
+ - [About Service Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-types)
254
+ - [About Service Payments](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments)
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: "Create Booking Service from Prompt"
3
+ description: "Create a booking service from a user prompt — e.g. 'create a yoga class for $50', 'set up consultations for $75', 'add a personal training appointment', 'create a 6-week photography workshop'. Determines the service type (APPOINTMENT, CLASS, or COURSE) and delegates to the type-specific recipe."
4
+ ---
5
+
6
+ # Create Booking Service from Natural Language Prompt
7
+
8
+ ## When to Use
9
+
10
+ - User describes a service they want to create using natural language (e.g., "create a yoga class for $50", "set up consultation sessions", "add a personal training appointment")
11
+ - The intent is autonomous creation — fill in reasonable defaults rather than asking the user for every field
12
+
13
+ ## Prerequisites
14
+
15
+ - **Wix Bookings app installed** (App ID: `13d21c63-b5ec-5912-8397-c3a5ddb27a97`)
16
+ - If Bookings is not installed, use [Install Wix Apps](../app-installation/install-wix-apps.md) to install it first
17
+
18
+ ---
19
+
20
+ ## Step 1: Determine Service Type
21
+
22
+ | User mentions | Type | Recipe |
23
+ |---|---|---|
24
+ | consultation, appointment, meeting, 1-on-1, one-on-one, session | `APPOINTMENT` | [Create Appointment Service](./create-appointment-service.md) |
25
+ | class, yoga, pilates, group session, group workout, bootcamp class | `CLASS` | [Create Class Service](./create-class-service.md) |
26
+ | workshop, program, course, training program, multi-session | `COURSE` | [Create Course Service](./create-course-service.md) |
27
+ | (unclear or unspecified) | `APPOINTMENT` | [Create Appointment Service](./create-appointment-service.md) |
28
+
29
+ ## Step 2: Follow the Type-Specific Recipe
30
+
31
+ Once the service type is determined, follow the corresponding recipe linked above. Each recipe covers:
32
+
33
+ 1. Gathering business context (staff, categories, currency, duplicate check)
34
+ 2. Applying type-specific defaults (pricing, capacity, duration, staff assignment)
35
+ 3. Creating the service via `bulkCreateServices`
36
+ 4. Navigating to the service form for user review
37
+ 5. Providing a summary of what was created and assumptions made
@@ -0,0 +1,233 @@
1
+ ---
2
+ name: "Create Class Service"
3
+ description: "Create a class booking service — e.g. 'create a yoga class for $50', 'set up a pilates class', 'add a group fitness session', 'create a weekly meditation class'. Handles group capacity, recurring session defaults, and pricing via bulkCreateServices API. Staff assignment is not used for classes."
4
+ ---
5
+
6
+ # Create Class Service from Prompt
7
+
8
+ ## When to Use
9
+
10
+ - User wants to create a group class: "create a yoga class", "set up a pilates class", "add a group fitness session", "create a weekly meditation class"
11
+ - The service type is CLASS — a single event or recurring series that multiple customers can book
12
+ - Customers can sign up for one, several, or all sessions in a class series
13
+ - For general service creation where the type is ambiguous, see [Create Booking Service from Prompt](./create-booking-service-from-prompt.md)
14
+
15
+ ## Prerequisites
16
+
17
+ - **Wix Bookings app installed** (App ID: `13d21c63-b5ec-5912-8397-c3a5ddb27a97`). Use [List Installed Apps](../app-installation/list-installed-apps.md) to verify, and [Install Wix Apps](../app-installation/install-wix-apps.md) to install if missing.
18
+ - For full API field definitions, validation rules, and troubleshooting, see [Create and Update Booking Services](./create-and-update-booking-services.md)
19
+
20
+ ---
21
+
22
+ ## Step 1: Gather Business Context
23
+
24
+ Run these queries to collect site data for informed defaults.
25
+
26
+ ### 1a. Query Service Categories
27
+
28
+ ```bash
29
+ curl -X POST 'https://www.wixapis.com/bookings/v2/categories/query' \
30
+ -H 'Authorization: <AUTH>' \
31
+ -H 'Content-Type: application/json' \
32
+ -d '{ "query": {} }'
33
+ ```
34
+
35
+ ### 1b. Get Site Currency
36
+
37
+ ```bash
38
+ curl -X GET 'https://www.wixapis.com/site-properties/v4/properties' \
39
+ -H 'Authorization: <AUTH>'
40
+ ```
41
+
42
+ Extract `properties.paymentCurrency`. Fall back to `USD` if unavailable.
43
+
44
+ ### 1c. Query Existing Services (Duplicate Check)
45
+
46
+ ```bash
47
+ curl -X POST 'https://www.wixapis.com/bookings/v2/services/query' \
48
+ -H 'Authorization: <AUTH>' \
49
+ -H 'Content-Type: application/json' \
50
+ -d '{ "query": { "paging": { "limit": 100 } } }'
51
+ ```
52
+
53
+ Warn the user if a service with a similar name already exists.
54
+
55
+ > **Note:** Staff queries are optional for CLASS services since `staffMemberIds` is ignored by the API. However, querying staff can still be useful for context (e.g., mentioning instructors in the description).
56
+
57
+ ---
58
+
59
+ ## Step 2: Apply Class Defaults
60
+
61
+ For any fields the user did not explicitly specify:
62
+
63
+ | Field | Default | Notes |
64
+ |---|---|---|
65
+ | Capacity | 10 | `defaultCapacity` — required for CLASS |
66
+ | Online booking | Enabled | `onlineBooking.enabled: true` |
67
+
68
+ ### Pricing (if not specified)
69
+
70
+ - Use the site's currency from Step 1b
71
+ - If user specifies a price → `rateType: "FIXED"` (per session)
72
+ - If user says "free" → `rateType: "NO_FEE"`, `options.inPerson: true`, `options.online: false`
73
+ - If no price mentioned → infer from context (yoga/fitness classes ~$15-30, art/music ~$20-40) or default to free
74
+
75
+ ### Capacity (if not specified)
76
+
77
+ - Default: 10 participants
78
+ - If user mentions capacity (e.g., "small group of 6", "up to 20") → use their number
79
+ - Typical ranges: small group 4-8, standard 10-20, large 20-50
80
+
81
+ ### Category
82
+
83
+ - If categories exist → assign the most relevant one (e.g., "Fitness", "Wellness")
84
+ - If no categories exist → create one:
85
+ ```bash
86
+ curl -X POST 'https://www.wixapis.com/bookings/v2/categories' \
87
+ -H 'Authorization: <AUTH>' \
88
+ -H 'Content-Type: application/json' \
89
+ -d '{ "category": { "name": "General" } }'
90
+ ```
91
+
92
+ ### Service Name & Description
93
+
94
+ - Use the user's wording for the service name
95
+ - Generate a brief, professional description (1-2 sentences) mentioning it's a group class
96
+
97
+ ---
98
+
99
+ ## Step 3: Create the Class Service
100
+
101
+ **CRITICAL: CLASS services do NOT use `staffMemberIds` or `sessionDurations`.** These fields are ignored. Use `defaultCapacity` instead.
102
+
103
+ **Paid class:**
104
+
105
+ ```bash
106
+ curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/create' \
107
+ -H 'Authorization: <AUTH>' \
108
+ -H 'Content-Type: application/json' \
109
+ -d '{
110
+ "services": [{
111
+ "name": "<SERVICE_NAME>",
112
+ "description": "<GENERATED_DESCRIPTION>",
113
+ "type": "CLASS",
114
+
115
+ "onlineBooking": { "enabled": true },
116
+ "defaultCapacity": <CAPACITY>,
117
+ "payment": {
118
+ "rateType": "FIXED",
119
+ "options": { "online": true, "inPerson": false },
120
+ "fixed": {
121
+ "price": { "value": "<PRICE>", "currency": "<CURRENCY>" }
122
+ }
123
+ },
124
+ "category": {
125
+ "id": "<CATEGORY_ID>"
126
+ }
127
+ }]
128
+ }'
129
+ ```
130
+
131
+ **Free class:**
132
+
133
+ ```bash
134
+ curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/create' \
135
+ -H 'Authorization: <AUTH>' \
136
+ -H 'Content-Type: application/json' \
137
+ -d '{
138
+ "services": [{
139
+ "name": "<SERVICE_NAME>",
140
+ "description": "<GENERATED_DESCRIPTION>",
141
+ "type": "CLASS",
142
+
143
+ "onlineBooking": { "enabled": true },
144
+ "defaultCapacity": <CAPACITY>,
145
+ "payment": {
146
+ "rateType": "NO_FEE",
147
+ "options": { "online": false, "inPerson": true }
148
+ },
149
+ "category": {
150
+ "id": "<CATEGORY_ID>"
151
+ }
152
+ }]
153
+ }'
154
+ ```
155
+
156
+ ### CLASS-Specific Reminders
157
+
158
+ - Do **NOT** include `staffMemberIds` — it is ignored for CLASS services
159
+ - Do **NOT** include `schedule.availabilityConstraints.sessionDurations` — not used for CLASS
160
+ - `defaultCapacity` is **required** — sets max participants per session
161
+ - After creation, class sessions must be scheduled separately via `bulkCreateEvents` using the returned `service.schedule.id` (see [Create and Update Booking Services](./create-and-update-booking-services.md))
162
+
163
+ Save the `serviceId` from the response: `results[0].item.service.id`
164
+
165
+ ---
166
+
167
+ ## Step 4: Summary Message
168
+
169
+ Provide a summary including:
170
+
171
+ 1. **What was created** — service name, price per session, capacity
172
+ 2. **Assumptions made** — list defaults used (e.g., "I set the capacity to 10 participants since you didn't specify")
173
+ 3. **Schedule note** — remind the user that class sessions still need to be scheduled
174
+ 4. **Next steps** — "Click Save to finalize, then set up the class schedule"
175
+ 5. **Offer to adjust** — "Want me to change the price, capacity, or description?"
176
+
177
+ **Example:**
178
+
179
+ > I created **"Vinyasa Yoga Class"**:
180
+ >
181
+ > - **Type**: Class (group session)
182
+ > - **Price**: $25 per session
183
+ > - **Capacity**: 10 participants
184
+ > - **Category**: Fitness
185
+ >
186
+ > I assumed a capacity of 10 since you didn't specify. You can review and adjust the details in the service form.
187
+ >
188
+ > **Next step:** You'll need to set up the class schedule (days and times) in the service form.
189
+
190
+ ---
191
+
192
+ ## Error Handling
193
+
194
+ | Error | Cause | Action |
195
+ |---|---|---|
196
+ | 428 "App not installed" | Bookings not installed | Install using [Install Wix Apps](../app-installation/install-wix-apps.md) |
197
+ | 400 "INVALID_PAYMENT_OPTIONS" | Payment misconfigured | Free: `inPerson: true`, `online: false`. Paid: price > 0 |
198
+ | 403 | Permission denied | Inform user they lack permission |
199
+
200
+ ---
201
+
202
+ ## Payment Validation Quick Reference
203
+
204
+ | rateType | `options.online` | `options.inPerson` | Valid? |
205
+ |----------|------------------|-------------------|--------|
206
+ | FIXED | true | false | ✓ |
207
+ | FIXED | false | true | ✓ |
208
+ | FIXED | true | true | ✓ |
209
+ | NO_FEE | false | true | ✓ |
210
+ | NO_FEE | true | false | ✗ |
211
+ | Any | false | false | ✗ |
212
+
213
+ ---
214
+
215
+ ## What This Skill Does NOT Cover
216
+
217
+ - **Class schedule setup** — recurring events (days/times) must be configured separately via Calendar Events API. See [Create and Update Booking Services](./create-and-update-booking-services.md) Step 3.
218
+ - **Pricing plans** — memberships and class packs are separate. See [Create and Update Pricing Plans](../pricing-plans/create-and-update-pricing-plans.md)
219
+ - **Instructor assignment** — `staffMemberIds` is ignored for CLASS. Staff association is managed through calendar events.
220
+ - **Service images** — requires Media Manager API (see [create-and-update-booking-services.md](./create-and-update-booking-services.md))
221
+
222
+ ---
223
+
224
+ ## API Documentation Reference
225
+
226
+ - [Bulk Create Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/bulk-create-services)
227
+ - [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services)
228
+ - [Query Categories](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/query-categories)
229
+ - [Create Category](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/create-category)
230
+ - [Bulk Create Events](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-create-event)
231
+ - [Site Properties](https://dev.wix.com/docs/api-reference/business-management/site-management/site-properties/properties/read)
232
+ - [About Service Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-types)
233
+ - [About Service Payments](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments)