Subchapter 8.13
references/bookings/create-appointment-service.mdMarkdown9 KBView on GitHub
Run these queries to collect site data for informed defaults.
curl -X POST 'https://www.wixapis.com/bookings/v1/staff-members/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"query": {},
"fields": ["RESOURCE_DETAILS"]
}'Save each staff member’s resourceId (not id). Note which one has default: true.
APPOINTMENT services REQUIRE at least one staff member. If no staff members exist, create one first using Bookings Staff Setup.
curl -X POST 'https://www.wixapis.com/bookings/v2/categories/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{ "query": {} }'curl -X POST 'https://www.wixapis.com/bookings/v2/services/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{ "query": { "paging": { "limit": 100 } } }'Warn the user if a service with a similar name already exists.
For any fields the user did not explicitly specify:
| Field | Default | Notes |
|---|---|---|
| Duration | 60 minutes | Set via schedule.availabilityConstraints.sessionDurations |
| Capacity | 1 | Appointments are typically 1-on-1 |
| Staff | Auto-assign | Use default: true staff, or first available |
| Online booking | Enabled | onlineBooking.enabled: true |
rateType: "FIXED"rateType: "NO_FEE", options.inPerson: true, options.online: falseresourceIddefault: true, or the first onecurl -X POST 'https://www.wixapis.com/bookings/v2/categories' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{ "category": { "name": "General" } }'Paid appointment:
curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/create' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"services": [{
"name": "<SERVICE_NAME>",
"description": "<GENERATED_DESCRIPTION>",
"type": "APPOINTMENT",
"onlineBooking": { "enabled": true },
"staffMemberIds": ["<RESOURCE_ID>"],
"schedule": {
"availabilityConstraints": {
"sessionDurations": [<DURATION_MINUTES>]
}
},
"payment": {
"rateType": "FIXED",
"options": { "online": true, "inPerson": false },
"fixed": {
"price": { "value": "<PRICE>" }
}
},
"category": {
"id": "<CATEGORY_ID>"
}
}]
}'Free appointment:
curl -X POST 'https://www.wixapis.com/bookings/v2/bulk/services/create' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"services": [{
"name": "<SERVICE_NAME>",
"description": "<GENERATED_DESCRIPTION>",
"type": "APPOINTMENT",
"onlineBooking": { "enabled": true },
"staffMemberIds": ["<RESOURCE_ID>"],
"schedule": {
"availabilityConstraints": {
"sessionDurations": [<DURATION_MINUTES>]
}
},
"payment": {
"rateType": "NO_FEE",
"options": { "online": false, "inPerson": true }
},
"category": {
"id": "<CATEGORY_ID>"
}
}]
}'staffMemberIds is required — uses resourceId values, not staff member idschedule.availabilityConstraints.sessionDurations sets the appointment lengthSave the serviceId from the response: results[0].item.service.id
Provide a summary including:
Example:
I created “Strategy Consultation”:
- Type: Appointment (1-on-1)
- Price: $75 per session
- Duration: 60 minutes
- Staff: Assigned to Sarah Johnson
- Category: Consulting
I assumed a 60-minute duration since you didn’t specify. You can review and adjust the details in the service form.
| Error | Cause | Action |
|---|---|---|
| 400 “staffMemberIds required” | No staff assigned | Query staff; if none exist, create one via Bookings Staff Setup |
| 400 “INVALID_PAYMENT_OPTIONS” | Payment misconfigured | Free: inPerson: true, online: false. Paid: price > 0 |
| 403 | Permission denied | Inform user they lack permission |
| rateType | options.online | options.inPerson | Valid? |
|---|---|---|---|
| FIXED | true | false | ✓ |
| FIXED | false | true | ✓ |
| FIXED | true | true | ✓ |
| NO_FEE | false | true | ✓ |
| NO_FEE | true | false | ✗ |
| Any | false | false | ✗ |