@wix/agent-skills 1.8.0 → 1.9.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.
- package/package.json +1 -1
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +2 -1
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +14 -0
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +11 -6
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +3 -17
- package/skills/wix-app/references/editor-react-component/SSR.md +119 -0
- package/skills/wix-design-system/SKILL.md +1 -1
- package/skills/wix-headless/references/BUILD-astro.md +5 -7
- package/skills/wix-headless/references/SETUP.md +1 -1
- package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +41 -333
- package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +58 -428
- package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +4 -7
- package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +158 -143
- package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +104 -162
- package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +17 -13
- package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +16 -78
- package/skills/wix-headless/references/astro/templates/bookings/bookingDriver.ts +245 -0
- package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +122 -179
- package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +61 -9
- package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +10 -2
- package/skills/wix-headless/references/bookings/FLOW.md +185 -0
- package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +60 -76
- package/skills/wix-headless/references/custom/bookings/WIRING.md +123 -65
- package/skills/wix-headless/references/verticals/bookings.md +6 -8
- package/skills/wix-manage/SKILL.md +12 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +3 -27
- package/skills/wix-manage/references/bookings/create-appointment-service.md +266 -0
- package/skills/wix-manage/references/bookings/create-booking-service-from-prompt.md +37 -0
- package/skills/wix-manage/references/bookings/create-class-service.md +245 -0
- package/skills/wix-manage/references/bookings/create-course-service.md +249 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +2 -1
- package/skills/wix-manage/references/cms/cms-schema-management.md +1 -1
- package/skills/wix-manage/references/stores/create-product-from-image.md +154 -2
- package/skills/wix-headless/references/astro/templates/bookings/ManageBooking.tsx +0 -84
- package/skills/wix-headless/references/astro/templates/bookings/api/confirm-booking.ts +0 -34
- package/skills/wix-headless/references/astro/templates/bookings/api/waitlist.ts +0 -74
- package/skills/wix-headless/references/astro/templates/bookings/manage-booking.astro +0 -76
|
@@ -0,0 +1,245 @@
|
|
|
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: Navigate to Service Form
|
|
168
|
+
|
|
169
|
+
Use the **RUN_IN_BROWSER** tool to navigate the user to the service form for final review:
|
|
170
|
+
|
|
171
|
+
```javascript
|
|
172
|
+
window.location.href = `/bookings/services/form/${serviceId}?fromAria=true`;
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
This executes in the user's browser and redirects them to the service editing page.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Step 5: Summary Message
|
|
180
|
+
|
|
181
|
+
Provide a summary including:
|
|
182
|
+
|
|
183
|
+
1. **What was created** — service name, price per session, capacity
|
|
184
|
+
2. **Assumptions made** — list defaults used (e.g., "I set the capacity to 10 participants since you didn't specify")
|
|
185
|
+
3. **Schedule note** — remind the user that class sessions still need to be scheduled
|
|
186
|
+
4. **Next steps** — "Click Save to finalize, then set up the class schedule"
|
|
187
|
+
5. **Offer to adjust** — "Want me to change the price, capacity, or description?"
|
|
188
|
+
|
|
189
|
+
**Example:**
|
|
190
|
+
|
|
191
|
+
> I created **"Vinyasa Yoga Class"**:
|
|
192
|
+
>
|
|
193
|
+
> - **Type**: Class (group session)
|
|
194
|
+
> - **Price**: $25 per session
|
|
195
|
+
> - **Capacity**: 10 participants
|
|
196
|
+
> - **Category**: Fitness
|
|
197
|
+
>
|
|
198
|
+
> I assumed a capacity of 10 since you didn't specify. You can review and adjust the details in the service form.
|
|
199
|
+
>
|
|
200
|
+
> **Next step:** You'll need to set up the class schedule (days and times) in the service form.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Error Handling
|
|
205
|
+
|
|
206
|
+
| Error | Cause | Action |
|
|
207
|
+
|---|---|---|
|
|
208
|
+
| 428 "App not installed" | Bookings not installed | Install using [Install Wix Apps](../app-installation/install-wix-apps.md) |
|
|
209
|
+
| 400 "INVALID_PAYMENT_OPTIONS" | Payment misconfigured | Free: `inPerson: true`, `online: false`. Paid: price > 0 |
|
|
210
|
+
| 403 | Permission denied | Inform user they lack permission |
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Payment Validation Quick Reference
|
|
215
|
+
|
|
216
|
+
| rateType | `options.online` | `options.inPerson` | Valid? |
|
|
217
|
+
|----------|------------------|-------------------|--------|
|
|
218
|
+
| FIXED | true | false | ✓ |
|
|
219
|
+
| FIXED | false | true | ✓ |
|
|
220
|
+
| FIXED | true | true | ✓ |
|
|
221
|
+
| NO_FEE | false | true | ✓ |
|
|
222
|
+
| NO_FEE | true | false | ✗ |
|
|
223
|
+
| Any | false | false | ✗ |
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## What This Skill Does NOT Cover
|
|
228
|
+
|
|
229
|
+
- **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.
|
|
230
|
+
- **Pricing plans** — memberships and class packs are separate. See [Create and Update Pricing Plans](../pricing-plans/create-and-update-pricing-plans.md)
|
|
231
|
+
- **Instructor assignment** — `staffMemberIds` is ignored for CLASS. Staff association is managed through calendar events.
|
|
232
|
+
- **Service images** — requires Media Manager API (see [create-and-update-booking-services.md](./create-and-update-booking-services.md))
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## API Documentation Reference
|
|
237
|
+
|
|
238
|
+
- [Bulk Create Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/bulk-create-services)
|
|
239
|
+
- [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services)
|
|
240
|
+
- [Query Categories](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/query-categories)
|
|
241
|
+
- [Create Category](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/create-category)
|
|
242
|
+
- [Bulk Create Events](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-create-event)
|
|
243
|
+
- [Site Properties](https://dev.wix.com/docs/api-reference/business-management/site-management/site-properties/properties/read)
|
|
244
|
+
- [About Service Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-types)
|
|
245
|
+
- [About Service Payments](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments)
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Create Course Service"
|
|
3
|
+
description: "Create a course booking service — e.g. 'create a 6-week photography workshop', 'set up a training program', 'add a bootcamp course for $300', 'create a teacher training course'. Handles group capacity, full-course pricing, and fixed series defaults via bulkCreateServices API. Staff assignment is not used for courses."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create Course Service from Prompt
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- User wants to create a multi-session course: "create a training program", "set up a 6-week workshop", "add a bootcamp course", "create a teacher training course"
|
|
11
|
+
- The service type is COURSE — a fixed series with pre-defined start and end dates
|
|
12
|
+
- Customers must book the entire course (all sessions), unlike CLASS where they can pick individual sessions
|
|
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 COURSE services since `staffMemberIds` is ignored by the API. However, querying staff can still be useful for context (e.g., mentioning the instructor in the description).
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Step 2: Apply Course Defaults
|
|
60
|
+
|
|
61
|
+
For any fields the user did not explicitly specify:
|
|
62
|
+
|
|
63
|
+
| Field | Default | Notes |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| Capacity | 10 | `defaultCapacity` — required for COURSE |
|
|
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"` (for the entire course)
|
|
72
|
+
- If user says "free" → `rateType: "NO_FEE"`, `options.inPerson: true`, `options.online: false`
|
|
73
|
+
- If no price mentioned → infer from context (workshops ~$100-300, training programs ~$200-500, bootcamps ~$150-400) or default to free
|
|
74
|
+
- **Course pricing is for the full course**, not per session — remind the user of this in the summary
|
|
75
|
+
|
|
76
|
+
### Capacity (if not specified)
|
|
77
|
+
|
|
78
|
+
- Default: 10 participants
|
|
79
|
+
- If user mentions group size → use their number
|
|
80
|
+
- Typical ranges: intensive 5-10, standard 10-20, lecture-style 20-50
|
|
81
|
+
|
|
82
|
+
### Category
|
|
83
|
+
|
|
84
|
+
- If categories exist → assign the most relevant one (e.g., "Training", "Workshops")
|
|
85
|
+
- If no categories exist → create one:
|
|
86
|
+
```bash
|
|
87
|
+
curl -X POST 'https://www.wixapis.com/bookings/v2/categories' \
|
|
88
|
+
-H 'Authorization: <AUTH>' \
|
|
89
|
+
-H 'Content-Type: application/json' \
|
|
90
|
+
-d '{ "category": { "name": "General" } }'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Service Name & Description
|
|
94
|
+
|
|
95
|
+
- Use the user's wording for the service name
|
|
96
|
+
- Generate a brief, professional description (1-2 sentences) mentioning it's a multi-session course
|
|
97
|
+
- If the user specified the number of sessions or duration, include that in the description
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Step 3: Create the Course Service
|
|
102
|
+
|
|
103
|
+
**CRITICAL: COURSE services do NOT use `staffMemberIds` or `sessionDurations`.** These fields are ignored. Use `defaultCapacity` instead.
|
|
104
|
+
|
|
105
|
+
**Paid course:**
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/create' \
|
|
109
|
+
-H 'Authorization: <AUTH>' \
|
|
110
|
+
-H 'Content-Type: application/json' \
|
|
111
|
+
-d '{
|
|
112
|
+
"services": [{
|
|
113
|
+
"name": "<SERVICE_NAME>",
|
|
114
|
+
"description": "<GENERATED_DESCRIPTION>",
|
|
115
|
+
"type": "COURSE",
|
|
116
|
+
|
|
117
|
+
"onlineBooking": { "enabled": true },
|
|
118
|
+
"defaultCapacity": <CAPACITY>,
|
|
119
|
+
"payment": {
|
|
120
|
+
"rateType": "FIXED",
|
|
121
|
+
"options": { "online": true, "inPerson": false },
|
|
122
|
+
"fixed": {
|
|
123
|
+
"price": { "value": "<PRICE>", "currency": "<CURRENCY>" }
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"category": {
|
|
127
|
+
"id": "<CATEGORY_ID>"
|
|
128
|
+
}
|
|
129
|
+
}]
|
|
130
|
+
}'
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Free course:**
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/create' \
|
|
137
|
+
-H 'Authorization: <AUTH>' \
|
|
138
|
+
-H 'Content-Type: application/json' \
|
|
139
|
+
-d '{
|
|
140
|
+
"services": [{
|
|
141
|
+
"name": "<SERVICE_NAME>",
|
|
142
|
+
"description": "<GENERATED_DESCRIPTION>",
|
|
143
|
+
"type": "COURSE",
|
|
144
|
+
|
|
145
|
+
"onlineBooking": { "enabled": true },
|
|
146
|
+
"defaultCapacity": <CAPACITY>,
|
|
147
|
+
"payment": {
|
|
148
|
+
"rateType": "NO_FEE",
|
|
149
|
+
"options": { "online": false, "inPerson": true }
|
|
150
|
+
},
|
|
151
|
+
"category": {
|
|
152
|
+
"id": "<CATEGORY_ID>"
|
|
153
|
+
}
|
|
154
|
+
}]
|
|
155
|
+
}'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### COURSE-Specific Reminders
|
|
159
|
+
|
|
160
|
+
- Do **NOT** include `staffMemberIds` — it is ignored for COURSE services
|
|
161
|
+
- Do **NOT** include `schedule.availabilityConstraints.sessionDurations` — not used for COURSE
|
|
162
|
+
- `defaultCapacity` is **required** — sets max participants for the entire course
|
|
163
|
+
- Customers must book the **entire course** (all sessions), not individual sessions
|
|
164
|
+
- After creation, course 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))
|
|
165
|
+
|
|
166
|
+
Save the `serviceId` from the response: `results[0].item.service.id`
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Step 4: Navigate to Service Form
|
|
171
|
+
|
|
172
|
+
Use the **RUN_IN_BROWSER** tool to navigate the user to the service form for final review:
|
|
173
|
+
|
|
174
|
+
```javascript
|
|
175
|
+
window.location.href = `/bookings/services/form/${serviceId}?fromAria=true`;
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
This executes in the user's browser and redirects them to the service editing page.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Step 5: Summary Message
|
|
183
|
+
|
|
184
|
+
Provide a summary including:
|
|
185
|
+
|
|
186
|
+
1. **What was created** — service name, total course price, capacity
|
|
187
|
+
2. **Assumptions made** — list defaults used (e.g., "I set the capacity to 10 participants since you didn't specify")
|
|
188
|
+
3. **Pricing clarification** — note that the price is for the entire course, not per session
|
|
189
|
+
4. **Schedule note** — remind the user that course sessions (dates and times) still need to be set up
|
|
190
|
+
5. **Next steps** — "Click Save to finalize, then set up the course schedule"
|
|
191
|
+
6. **Offer to adjust** — "Want me to change the price, capacity, or description?"
|
|
192
|
+
|
|
193
|
+
**Example:**
|
|
194
|
+
|
|
195
|
+
> I created **"Yoga Teacher Training"**:
|
|
196
|
+
>
|
|
197
|
+
> - **Type**: Course (customers book the full program)
|
|
198
|
+
> - **Price**: $300 for the full course
|
|
199
|
+
> - **Capacity**: 10 participants
|
|
200
|
+
> - **Category**: Training
|
|
201
|
+
>
|
|
202
|
+
> I assumed a capacity of 10 since you didn't specify. The price of $300 covers the entire course — customers pay once for all sessions. You can review and adjust the details in the service form.
|
|
203
|
+
>
|
|
204
|
+
> **Next step:** You'll need to set up the course schedule (specific session dates and times) in the service form.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Error Handling
|
|
209
|
+
|
|
210
|
+
| Error | Cause | Action |
|
|
211
|
+
|---|---|---|
|
|
212
|
+
| 428 "App not installed" | Bookings not installed | Install using [Install Wix Apps](../app-installation/install-wix-apps.md) |
|
|
213
|
+
| 400 "INVALID_PAYMENT_OPTIONS" | Payment misconfigured | Free: `inPerson: true`, `online: false`. Paid: price > 0 |
|
|
214
|
+
| 403 | Permission denied | Inform user they lack permission |
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Payment Validation Quick Reference
|
|
219
|
+
|
|
220
|
+
| rateType | `options.online` | `options.inPerson` | Valid? |
|
|
221
|
+
|----------|------------------|-------------------|--------|
|
|
222
|
+
| FIXED | true | false | ✓ |
|
|
223
|
+
| FIXED | false | true | ✓ |
|
|
224
|
+
| FIXED | true | true | ✓ |
|
|
225
|
+
| NO_FEE | false | true | ✓ |
|
|
226
|
+
| NO_FEE | true | false | ✗ |
|
|
227
|
+
| Any | false | false | ✗ |
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## What This Skill Does NOT Cover
|
|
232
|
+
|
|
233
|
+
- **Course schedule setup** — individual session events (dates/times) must be configured separately via Calendar Events API. See [Create and Update Booking Services](./create-and-update-booking-services.md) Step 3.
|
|
234
|
+
- **Pricing plans** — memberships or installment payments are separate. See [Create and Update Pricing Plans](../pricing-plans/create-and-update-pricing-plans.md)
|
|
235
|
+
- **Instructor assignment** — `staffMemberIds` is ignored for COURSE. Staff association is managed through calendar events.
|
|
236
|
+
- **Service images** — requires Media Manager API (see [create-and-update-booking-services.md](./create-and-update-booking-services.md))
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## API Documentation Reference
|
|
241
|
+
|
|
242
|
+
- [Bulk Create Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/bulk-create-services)
|
|
243
|
+
- [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services)
|
|
244
|
+
- [Query Categories](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/query-categories)
|
|
245
|
+
- [Create Category](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/create-category)
|
|
246
|
+
- [Bulk Create Events](https://dev.wix.com/docs/api-reference/business-management/calendar/events-v3/bulk-create-event)
|
|
247
|
+
- [Site Properties](https://dev.wix.com/docs/api-reference/business-management/site-management/site-properties/properties/read)
|
|
248
|
+
- [About Service Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-types)
|
|
249
|
+
- [About Service Payments](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments)
|
|
@@ -10,7 +10,7 @@ This recipe covers basic Create, Read, Update, Delete (CRUD) operations for Wix
|
|
|
10
10
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
|
-
1. Wix CMS enabled on the site
|
|
13
|
+
1. Wix CMS enabled on the site (appDefId: `e593b0bd-b783-45b8-97c2-873d42aacaf4`)
|
|
14
14
|
2. Collections already created (see [CMS Schema Management](cms-schema-management.md))
|
|
15
15
|
3. API access with CMS permissions
|
|
16
16
|
|
|
@@ -439,6 +439,7 @@ curl -X DELETE \
|
|
|
439
439
|
| `WDE0007` | Bulk update: wrong ID field name | Use `id` not `_id` at element level |
|
|
440
440
|
| `WDE0080` | Validation failed (multiple causes) | Bulk update: don't include `_id` in `data`; Bulk patch: use `patches` array not `dataItems` |
|
|
441
441
|
| `WDE0303` | Can't set multi-reference field via data operations | Use reference endpoints: `insert-references`, `replace-references` |
|
|
442
|
+
| `WDE0110` | Wix CMS (Wix Data) application is not installed | Install application with appDefId: `e593b0bd-b783-45b8-97c2-873d42aacaf4` |
|
|
442
443
|
|
|
443
444
|
---
|
|
444
445
|
|
|
@@ -10,7 +10,7 @@ This recipe covers managing the structure (schema) of Wix CMS collections using
|
|
|
10
10
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
|
-
1. Wix CMS
|
|
13
|
+
1. Wix CMS application installed on the site (appDefId: `e593b0bd-b783-45b8-97c2-873d42aacaf4`)
|
|
14
14
|
2. API access with CMS permissions (Manage Data Collections scope)
|
|
15
15
|
|
|
16
16
|
## Required APIs
|