@wix/agent-skills 1.7.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/README.md +3 -7
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +2 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +2 -1
- package/skills/wix-app/references/STORES_VERSIONING.md +1 -0
- 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 +5 -1
- package/skills/wix-headless/SKILL.md +55 -32
- package/skills/wix-headless/references/BUILD-astro.md +244 -0
- package/skills/wix-headless/references/BUILD-own-build.md +167 -0
- package/skills/wix-headless/references/BUILD.md +50 -252
- package/skills/wix-headless/references/DESIGN_SYSTEM.md +94 -34
- package/skills/wix-headless/references/DISCOVERY-connect.md +55 -0
- package/skills/wix-headless/references/DISCOVERY-create.md +238 -0
- package/skills/wix-headless/references/DISCOVERY.md +41 -422
- package/skills/wix-headless/references/PLAN-connect.md +19 -0
- package/skills/wix-headless/references/PLAN-create.md +17 -0
- package/skills/wix-headless/references/PLAN.md +37 -27
- package/skills/wix-headless/references/SEED.md +27 -18
- package/skills/wix-headless/references/SETUP.md +32 -213
- package/skills/wix-headless/references/astro/blog/BLOG_PAGES.md +5 -4
- package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +45 -0
- package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +58 -0
- package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +5 -5
- package/skills/wix-headless/references/astro/cms/FAQ_KNOWLEDGE_BASE.md +10 -10
- package/skills/wix-headless/references/astro/cms/PORTFOLIO.md +12 -13
- package/skills/wix-headless/references/astro/cms/RESOURCE_LIBRARY.md +10 -12
- package/skills/wix-headless/references/astro/cms/TEAM_DIRECTORY.md +8 -8
- package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +47 -27
- package/skills/wix-headless/references/astro/ecom/CART_PAGES.md +7 -8
- package/skills/wix-headless/references/astro/ecom/CART_WIRING.md +5 -5
- package/skills/wix-headless/references/astro/ecom/COMPONENTS_CSS.md +3 -3
- package/skills/wix-headless/references/astro/forms/CONTACT_FORM.md +5 -19
- package/skills/wix-headless/references/astro/gift-cards/COMPONENTS.md +2 -2
- package/skills/wix-headless/references/astro/gift-cards/PAGES.md +1 -1
- package/skills/wix-headless/references/astro/stores/BACK_IN_STOCK.md +6 -6
- package/skills/wix-headless/references/astro/stores/CATEGORY_PAGES.md +4 -4
- package/skills/wix-headless/references/astro/stores/COMPONENTS_CSS.md +3 -3
- package/skills/wix-headless/references/astro/stores/HOME_AND_NAV.md +3 -3
- package/skills/wix-headless/references/astro/stores/PRODUCT_PAGES.md +9 -9
- package/skills/wix-headless/references/astro/stores/SHARED_WIRING.md +5 -4
- package/skills/wix-headless/references/astro/templates/Footer.astro +1 -1
- package/skills/wix-headless/references/astro/templates/Layout.astro +1 -1
- package/skills/wix-headless/references/astro/templates/Navigation.astro +1 -1
- package/skills/wix-headless/references/astro/templates/astro.config.mjs +1 -1
- package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +233 -0
- package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +136 -0
- package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +25 -0
- package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +54 -0
- package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +45 -0
- package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +49 -0
- package/skills/wix-headless/references/astro/templates/bookings/bookingDriver.ts +245 -0
- package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +356 -0
- package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +133 -0
- package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +73 -0
- package/skills/wix-headless/references/astro/templates/global.css +2 -2
- package/skills/wix-headless/references/astro/templates/index.astro +1 -1
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +19 -9
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +3 -3
- package/skills/wix-headless/references/bookings/FLOW.md +185 -0
- package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +90 -0
- package/skills/wix-headless/references/bookings/SERVICES_DATA.md +295 -0
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +4 -2
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +27 -1
- package/skills/wix-headless/references/commands/known-apps.json +2 -1
- package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +142 -0
- package/skills/wix-headless/references/custom/INSTRUCTIONS.md +71 -21
- package/skills/wix-headless/references/custom/blog/WIRING.md +52 -0
- package/skills/wix-headless/references/custom/bookings/WIRING.md +146 -0
- package/skills/wix-headless/references/custom/cms/WIRING.md +97 -0
- package/skills/wix-headless/references/custom/ecom/WIRING.md +67 -0
- package/skills/wix-headless/references/custom/forms/WIRING.md +101 -0
- package/skills/wix-headless/references/custom/stores/WIRING.md +80 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +5 -5
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +2 -2
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +3 -3
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +16 -15
- package/skills/wix-headless/references/seed-recipes.md +2 -2
- package/skills/wix-headless/references/shared/AGENTS_MD.md +47 -0
- package/skills/wix-headless/references/shared/AUTHENTICATION.md +3 -5
- package/skills/wix-headless/references/shared/DESIGN_MD.md +85 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +29 -28
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +87 -27
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +2 -2
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +24 -313
- package/skills/wix-headless/references/shared/STYLING.md +8 -18
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +39 -9
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +17 -14
- package/skills/wix-headless/references/verticals/_schema.json +1 -1
- package/skills/wix-headless/references/verticals/_schema.md +3 -3
- package/skills/wix-headless/references/verticals/blog.md +1 -1
- package/skills/wix-headless/references/verticals/bookings.md +39 -0
- package/skills/wix-headless/references/verticals/cms.md +1 -1
- package/skills/wix-headless/references/verticals/ecom.md +2 -2
- package/skills/wix-headless/references/verticals/gift-cards.md +1 -1
- package/skills/wix-headless/references/verticals/stores.md +1 -1
- package/skills/wix-headless/scripts/check-manifest.mjs +143 -6
- package/skills/wix-headless/scripts/compose.mjs +540 -0
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +128 -51
- package/skills/wix-headless/scripts/flatten.sh +61 -0
- package/skills/wix-headless/scripts/generate-images.mjs +242 -0
- package/skills/wix-headless/scripts/scaffold.sh +47 -16
- package/skills/wix-headless/scripts/write-decorative-json.mjs +62 -0
- package/skills/wix-manage/SKILL.md +13 -1
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +3 -27
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +1 -1
- 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 +3 -2
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +1 -1
- package/skills/wix-manage/references/cms/cms-schema-management.md +2 -2
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +10 -7
- package/skills/wix-manage/references/forms/create-form.md +49 -1
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1 -1
- package/skills/wix-manage/references/stores/create-product-from-image.md +154 -2
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +1 -1
- package/skills/wix-headless/references/astro/COMPOSE.md +0 -142
- package/skills/wix-headless/scripts/finalize-run-json.mjs +0 -141
- package/skills/wix-headless/scripts/init-site-json.mjs +0 -101
- package/skills/wix-headless/scripts/preview.sh +0 -45
- package/skills/wix-headless/scripts/release.sh +0 -73
|
@@ -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)
|
|
@@ -4,13 +4,13 @@ description: "Add, query, update, and delete items in CMS collections. Use this
|
|
|
4
4
|
---
|
|
5
5
|
# CMS Data Items CRUD
|
|
6
6
|
|
|
7
|
-
> **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only.
|
|
7
|
+
> **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only. Body-bearing requests also need `Content-Type: application/json`.
|
|
8
8
|
|
|
9
9
|
This recipe covers basic Create, Read, Update, Delete (CRUD) operations for Wix CMS data items.
|
|
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
|
|
|
@@ -4,7 +4,7 @@ description: "Add, replace, or remove items from MULTI_REFERENCE fields. Use ins
|
|
|
4
4
|
---
|
|
5
5
|
# CMS References & Relationships
|
|
6
6
|
|
|
7
|
-
> **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only.
|
|
7
|
+
> **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only. Body-bearing requests also need `Content-Type: application/json`.
|
|
8
8
|
|
|
9
9
|
This recipe covers linking CMS collections together using reference fields.
|
|
10
10
|
|
|
@@ -4,13 +4,13 @@ description: Create and modify CMS collection structures. Covers listing collect
|
|
|
4
4
|
---
|
|
5
5
|
# CMS Schema Management
|
|
6
6
|
|
|
7
|
-
> **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only.
|
|
7
|
+
> **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only. Body-bearing requests also need `Content-Type: application/json`.
|
|
8
8
|
|
|
9
9
|
This recipe covers managing the structure (schema) of Wix CMS collections using the REST API.
|
|
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
|
|
@@ -218,13 +218,18 @@ Replace `{domain}` with the chosen domain (e.g. `mybakery.com`).
|
|
|
218
218
|
```json
|
|
219
219
|
{
|
|
220
220
|
"domainRegistrationIntent": {
|
|
221
|
-
"registrantContact": {
|
|
221
|
+
"registrantContact": {
|
|
222
|
+
"firstName": "...", "lastName": "...", "email": "...", "phone": "...",
|
|
223
|
+
"streetAddress": "...", "city": "...", "country": "...", "postalCode": "..."
|
|
224
|
+
},
|
|
222
225
|
"adminContact": { ... },
|
|
223
226
|
"techContact": { ... }
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
229
|
```
|
|
227
230
|
|
|
231
|
+
> Address fields are **flat** on each contact (`streetAddress`, `city`, `country`, `postalCode`) — there is no nested `address` sub-object.
|
|
232
|
+
|
|
228
233
|
- **If contacts exist**: Show the info and explicitly ask "Should I use these details, or would you like to register with different info?" Wait for the user to confirm before proceeding to Step 3. Do NOT skip this confirmation.
|
|
229
234
|
- **If contacts are empty**: Ask the user for: first name, last name, email, phone number, street address, city, country, and postal code. The user can provide country as a full name (e.g. "Israel", "United States") -- convert it to the 2-letter ISO country code (e.g. "IL", "US") before sending to the API. Wait for them to provide all fields before proceeding.
|
|
230
235
|
|
|
@@ -249,12 +254,10 @@ Body:
|
|
|
249
254
|
"lastName": "Smith",
|
|
250
255
|
"email": "john@email.com",
|
|
251
256
|
"phone": "+1.5551234567",
|
|
252
|
-
"
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
"postalCode": "10001"
|
|
257
|
-
}
|
|
257
|
+
"streetAddress": "123 Main St",
|
|
258
|
+
"city": "New York",
|
|
259
|
+
"country": "US",
|
|
260
|
+
"postalCode": "10001"
|
|
258
261
|
},
|
|
259
262
|
"adminContact": { ... same as registrant ... },
|
|
260
263
|
"techContact": { ... same as registrant ... }
|
|
@@ -4,7 +4,7 @@ description: Creates a form with fields (name, email, etc.) using the Form Schem
|
|
|
4
4
|
---
|
|
5
5
|
# RECIPE: Create a Wix Form
|
|
6
6
|
|
|
7
|
-
> **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only.
|
|
7
|
+
> **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only. Body-bearing requests also need `Content-Type: application/json`.
|
|
8
8
|
|
|
9
9
|
Create a form on a Wix site that appears in the Forms & Submissions dashboard. The form collects visitor information (e.g., name, email) and can automatically upsert contacts on submission.
|
|
10
10
|
|
|
@@ -217,6 +217,7 @@ Verify the form in the dashboard: `https://manage.wix.com/dashboard/{siteId}/for
|
|
|
217
217
|
- **CRITICAL: The `identifier` must be a recognized Wix value.** Custom identifiers like `"product_name"` or `"color_preference"` will cause the field to be silently dropped from the form — no error is thrown. For any generic/custom text field, use `"TEXT_INPUT"` as the identifier and set the display name via the `label` property in `textInputOptions`.
|
|
218
218
|
- For plain text fields, use `"format": "UNKNOWN_FORMAT"`. For email fields, use `"format": "EMAIL"`. For phone fields, use `"format": "PHONE"`. Valid format values: `UNKNOWN_FORMAT`, `DATE`, `TIME`, `DATE_TIME`, `EMAIL`, `URL`, `UUID`, `PHONE`, `URI`, `HOSTNAME`, `COLOR_HEX`, `CURRENCY`, `LANGUAGE`, `DATE_OPTIONAL_TIME`.
|
|
219
219
|
- The submit button is a `DISPLAY` field with `identifier: "SUBMIT_BUTTON"`.
|
|
220
|
+
- **Build the complete form in one call — do not create throwaway "test" forms to probe field shapes.** A site has a **low form cap (~4 forms)**; iterative probing hits the cap (`maximum number of forms reached`), forcing you to `GET` the form list and `DELETE` the test forms before the real create can succeed. Assemble all fields (including any RADIO_GROUP/DROPDOWN per § "Choice fields") and POST once.
|
|
220
221
|
|
|
221
222
|
### Field Types Reference
|
|
222
223
|
|
|
@@ -228,9 +229,54 @@ Verify the form in the dashboard: `https://manage.wix.com/dashboard/{siteId}/for
|
|
|
228
229
|
| `CONTACTS_EMAIL` | `TEXT_INPUT` | `EMAIL` | Contact email |
|
|
229
230
|
| `CONTACTS_PHONE` | `TEXT_INPUT` | `PHONE` | Contact phone |
|
|
230
231
|
| `SUBMIT_BUTTON` | N/A (`DISPLAY` field) | N/A | Submit button |
|
|
232
|
+
| `TEXT_INPUT` | `RADIO_GROUP` | `UNKNOWN_FORMAT` | Single-choice from a fixed list (radio buttons) — see § "Choice fields" |
|
|
233
|
+
| `TEXT_INPUT` | `DROPDOWN` | `UNKNOWN_FORMAT` | Single-choice from a fixed list (dropdown) — same shape as RADIO_GROUP |
|
|
231
234
|
|
|
232
235
|
> **Note:** `LONG_TEXT_INPUT` is not supported as a `componentType` via REST — it throws `INVALID_ARGUMENT`. Use `TEXT_INPUT` for all text fields.
|
|
233
236
|
|
|
237
|
+
### Choice fields (RADIO_GROUP / DROPDOWN)
|
|
238
|
+
|
|
239
|
+
A single-choice field (radio buttons or a dropdown — e.g. an RSVP "Will you attend?") is a **`STRING` input field**, not a separate field type. It uses `identifier: "TEXT_INPUT"`, `inputType: "STRING"`, and sets `componentType` to `RADIO_GROUP` (or `DROPDOWN`) **inside `stringOptions`**. Two things must agree or the field breaks:
|
|
240
|
+
|
|
241
|
+
1. **`stringOptions.validation.enum`** must list every option `value` (an empty `enum` is for free-text only).
|
|
242
|
+
2. **`stringOptions.radioGroupOptions.options[]`** carries the rendered choices — each option needs its own **UUID `id`**, a `value`, and a `label`. (For `DROPDOWN`, use `dropdownOptions` with the same `{id, value, label}` shape.)
|
|
243
|
+
|
|
244
|
+
> **CRITICAL — silent fallback to TEXT_INPUT.** If `radioGroupOptions` is missing/malformed (wrong key like `choices` instead of `options`, an option missing its `id`, or an empty `validation.enum`), the API does **not** error — it silently creates the field as a plain `TEXT_INPUT`. If a choice field renders as a text box, this is why. Build it correctly on the first call; do not probe.
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"id": "a1b2c3d4-1002-4e00-8001-000000000002",
|
|
249
|
+
"hidden": false,
|
|
250
|
+
"identifier": "TEXT_INPUT",
|
|
251
|
+
"fieldType": "INPUT",
|
|
252
|
+
"inputOptions": {
|
|
253
|
+
"target": "attending_0002",
|
|
254
|
+
"pii": false,
|
|
255
|
+
"required": true,
|
|
256
|
+
"inputType": "STRING",
|
|
257
|
+
"readOnly": false,
|
|
258
|
+
"stringOptions": {
|
|
259
|
+
"validation": {
|
|
260
|
+
"format": "UNKNOWN_FORMAT",
|
|
261
|
+
"enum": ["Joyfully accepts", "Regretfully declines"]
|
|
262
|
+
},
|
|
263
|
+
"componentType": "RADIO_GROUP",
|
|
264
|
+
"radioGroupOptions": {
|
|
265
|
+
"label": "Will you attend?",
|
|
266
|
+
"showLabel": true,
|
|
267
|
+
"numberOfColumns": "ONE",
|
|
268
|
+
"options": [
|
|
269
|
+
{ "id": "c3d4e5f6-3001-4a00-8001-000000000001", "value": "Joyfully accepts", "label": "Joyfully accepts" },
|
|
270
|
+
{ "id": "c3d4e5f6-3001-4a00-8001-000000000002", "value": "Regretfully declines", "label": "Regretfully declines" }
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
`numberOfColumns` is a string enum (`"ONE"`, `"TWO"`, `"THREE"`) controlling the radio layout — omit it and the field still works (defaults to one column).
|
|
279
|
+
|
|
234
280
|
### Layout
|
|
235
281
|
|
|
236
282
|
The `steps[].layout.large.items` array controls how fields are positioned:
|
|
@@ -252,6 +298,8 @@ The Wix Forms app (appDefId: `14ce1214-b278-a7e4-1373-00cebd1bef7c`) must be ins
|
|
|
252
298
|
|---|---|---|
|
|
253
299
|
| `Unrecognized value passed for enum` | Invalid `componentType` value (e.g., `LONG_TEXT_INPUT`) | Use only `componentType` values from the schema: `TEXT_INPUT`, `RADIO_GROUP`, `DROPDOWN`, `DATE_TIME`, `PHONE_INPUT`, `DATE_INPUT`, `TIME_INPUT`, `DATE_PICKER`, `PASSWORD` |
|
|
254
300
|
| Field silently missing from created form | Custom `identifier` value (e.g., `"product_name"`) | Use a recognized identifier like `TEXT_INPUT` and set display name via `label` |
|
|
301
|
+
| Choice field rendered as a plain text box | `radioGroupOptions`/`dropdownOptions` malformed (wrong key, option missing `id`, empty `validation.enum`) — API silently falls back to `TEXT_INPUT` | Match the § "Choice fields" shape exactly: `componentType` in `stringOptions`, `options[]` each with a UUID `id`, and `validation.enum` listing all option values |
|
|
302
|
+
| `maximum number of forms reached` / form-cap error | Sites cap at ~4 forms; reached by creating throwaway test forms | `GET form-schema-service/v4/forms` then `DELETE` the unwanted forms; build the real form in one call (don't probe) |
|
|
255
303
|
| `Permissions for given namespace not found` | `wix.form_app.form` namespace not active | Ensure the Wix Forms app is installed; try creating a form through the UI first to activate the namespace |
|
|
256
304
|
| `missing installed app` | Wix Forms app not installed | Install app `14ce1214-b278-a7e4-1373-00cebd1bef7c` via the [Install Wix Apps](../app-installation/install-wix-apps.md) recipe |
|
|
257
305
|
|