wix_bookings_create_update_service id: wix_bookings_create_update_service Content

Technical Step-by-Step Instructions: Creating or Updating a Wix Bookings Service (Real-World, API-First)

Description

Below are the recommended steps to successfully create or update a Wix Bookings service (or several at once) on Wix, with real-world troubleshooting and fixes for common API issues.

Article URL

https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/wix_bookings_create_update_service


Prerequisites

Required App Installations

Before creating services, ensure Wix Bookings is installed on the site:

  1. Wix Bookings - Core app for booking functionality

App Installation Process

If you encounter app-related errors, install the required apps using the Apps Installer API.

Steps:

  1. Identify the missing app from error messages (typically 428 "App not installed")
  2. Use the Apps Installer API to install the required app
  3. Verify installation by testing basic functionality

For detailed app installation procedures, refer to:

Overview

A Bookings service defines a time based offering and includes the following considerations:

CRITICAL: Staff Assignment Behavior by Service Type

APPOINTMENT Services:

CLASS and COURSE Services:

This is a critical API limitation that affects service planning and staff resource management.

IMPORTANT NOTES

Service Categories - CRITICAL for UI Visibility

IMPORTANT: Services without categories may not appear in category-based UI filters, which are commonly used in booking interfaces.

Service Category Considerations:

Category Management Steps:

  1. Query existing categories using Query Categories to see available options
  2. Create new category if needed using Create Category
  3. Assign category during service creation by including category.id in the service object
  4. Update existing services using Update Service to add missing categories

Common Category Filter Patterns:

{
  "filter": {
    "category.id": {
      "$exists": true
    }
  }
}

This filter will only show services with assigned categories, making uncategorized services invisible to users.

Querying Existing Services

You can retrieve a list of existing booking services using the Query Services endpoint. This allows you to filter, sort, and page through up to 100 services at a time, making it easy to find and manage your current offerings.


Steps

0. Query and Setup Categories (CRITICAL FIRST STEP)

  1. Query existing categories using queryCategories API (REST) to identify available categories
  2. Create category if needed using createCategory API (REST) if no suitable category exists
  3. Record category ID for use in service creation - this prevents services from being hidden in UI filters

1. Define staff member to use

  1. Either create a staff member or select from the existing ones using the staff member APIs.
  2. For new one, create a staff member using createStaffMember API (SDK | REST) and keep the response staffMember.id (staff member ID) and resourceId (to be used in service.staffMemberIds in APPOINTMENT service)
  3. If you wish to update the working hours of the staff member use the staff member ID (just created or known from previous calls) to call getStaffMember API (SDK | REST) in order to their resource.eventsSchedule.id (schedule ID).
  4. If you wish to use an existing staff member but ID is unknown use queryStaffMembers API (SDK | REST), specifying RESOURCE_DETAILS in the fields parameter. Save the relevant staff member ID, resourceId (for service.staffMemberIds) and their resource.eventsSchedule.id.

Note for Service Type Planning:

2. Creating or Updating a service

Based on the information gathered above, use the relevant API based on the desired outcome, In case you wish to create a service (one or more) use the bulkCreateServices endpoint (SDK | REST), in order to update a service, you can update several services at once, using bulkUpdateServices (SDK | REST) and if you wish to update serval services by a criteria (without even retrieving them) you can use bulkUpdateServicesByFilter (SDK | REST).

CRITICAL: Include Category Assignment

{
  "service": {
    "name": "Your Service Name",
    "type": "APPOINTMENT",
    "category": {
      "id": "your-category-id-here"
    },
    // ... other service properties
  }
}

Service Type Specific Considerations:

3. Set the availability of the service

Once the service and staff member are available, you can define when the service is available,

  1. Define the schedule to use based on the service type.
  1. use bulkCreateEvents (SDK | REST) to create the events that dictates the availability or bulkUpdateEvents (SDK | REST) to update existing schedule events.

Troubleshooting Common Issues

Services Not Appearing in UI Filters:

Staff Assignment Not Working for CLASS/COURSE Services:

App Not Installed Errors:

Resource ID vs Staff ID Confusion:

Service Schedule vs Staff Schedule Confusion:

IMPORTANT NOTES

Booking REST API Documentation Reference