Subchapter 8.20
references/bookings/multi-resource-service-creation.mdMarkdown13 KBView on GitHub
Below are the recommended steps to successfully create Wix Bookings services that require multiple resource types (e.g., Room + Equipment + Instructor). This recipe covers the gaps in individual API documentation: resource architecture planning, entity relationship patterns, availability dependencies, and real-world coordination challenges that aren’t clear from reading individual API references.
Before creating multi-resource services, ensure the following requirements are met:
If you encounter resource-related errors, install the required apps using the Apps Installer API.
For detailed app installation procedures, refer to:
Multi-resource services allow businesses to create bookings that require multiple types of resources simultaneously. Common examples:
The system involves three independent entity types that can be connected:
Key Architecture Principle: Resources and Services are separate, independent entities. Resources exist independently but their availability depends on business location hours (for non-staff resources) or working hour schedules (for staff resources). Services can optionally connect to resource types (not individual resources) to require resource allocation during booking, but this connection is loose and flexible.
❌ COMMON ARCHITECTURE MISTAKES (Not Clear in Individual Docs):
✅ CORRECT RESOURCE ARCHITECTURE:
resourceType.id, not individual resource IDsResource Availability Behavior:
eventsSchedule for tracking bookingsworkingHoursSchedules is configured, it takes precedence over location hoursSchedule Sharing Patterns:
shared: false = Dedicated schedule per resource (recommended for most cases)shared: true = Multiple resources use same working hours scheduleshared: true among staffService Configuration Pattern:
"serviceResources": [
{"resourceType": {"id": "room-type-id"}},
{"resourceType": {"id": "equipment-type-id"}},
{"resourceType": {"id": "staff-type-id"}}
]Critical: Services specify resource types, not individual resources. This creates a loose coupling where:
availableInAllLocations: true is simplest; specific location configuration is complex and often unnecessaryBefore creating anything, plan your resource type structure. Each type should represent a category of resources that can be substituted for each other in bookings.
Common Resource Type Patterns:
Design Principle: If resources are interchangeable for a service, they belong to the same type.
Create resource types using createResourceType API (POST https://www.wixapis.com/bookings/v2/resources/resource-types) (REST (opens in a new tab)):
Key Requirements:
name must be unique across the sitename descriptive but concise (appears in booking interface)resourceType.id for resource creationImportant: Cannot change name after creation if conflicts occur - plan carefully.
For each resource type, create the individual resource instances using createResource API (POST https://www.wixapis.com/bookings/v2/resources) (REST (opens in a new tab)):
Gap Not in Docs: The docs don’t clearly explain that availableInAllLocations: true is the simplest approach and that specific location configuration is complex and often unnecessary.
Advanced Configuration (Gap):
specificLocationOptions (complex - avoid unless required)Critical: Each resource automatically gets its own eventsSchedule for booking management (this is documented but the implications for multi-resource coordination aren’t clear).
Create the service that optionally connects to multiple resource types using bulkCreateServices API (REST (opens in a new tab)):
Service Resource Configuration:
"serviceResources": [
{"resourceType": {"id": "room-type-id"}},
{"resourceType": {"id": "equipment-type-id"}},
{"resourceType": {"id": "instructor-type-id"}}
]Key Principle: This creates a loose connection where the service requests resource allocation during booking, but resources remain independent entities with their own lifecycle and management.
Pricing Strategy: Multi-resource services typically command premium pricing due to coordination complexity.
The docs don’t explain how multi-resource allocation actually works during booking. Key behaviors to understand:
Architecture Implication: Plan resource quantities based on expected concurrent demand across all services.
“Resource type not found” Error:
typeId exactly matches the resource type idname when id is required“Resource type name already exists” Error (409):
Service doesn’t show resource requirements:
serviceResources array includes all required resource typesResources showing as unavailable:
workingHoursSchedules is too restrictivelocationOptions matches your business location setupavailableInAllLocations: true to eliminate location issuesResource updates failing:
Complex location availability issues:
availableInAllLocations: true for all resourcesResource deletion concerns:
Resource Type Design:
Resource Naming:
Availability Strategy:
Service Design: