Creates a resource.
The createResource()
function returns a Promise that resolves to the created resource.
Bookings resources are created with a schedule. The schedule and its sessions determine the resource's availability. Note that the schedule must contain a start date in the availability.start
property.
For resources that are available during the business's default hours, add the business's schedule as a linked schedule in the resource's schedule. For resources that have their own hours, create sessions with type "WORKING_HOURS"
using the resource's schedule.
You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
When creating a resource using createResource()
, include the resource's schedule information. Set the schedule information as follows:
scheduleInfo.availability.linkedSchedules
array in the scheduleInfo
parameter. The default hours can bee found in the Dashboard under Settings in the Bookings section, on the Appointment hours page."WORKING_HOURS"
using the createSession()
function. Use the scheduleId
returned from createResource()
when creating the sessions. These session can be single sessions or recurring sessions.Notes:
WORKING_HOURS
sessions in the resource calendar.options.suppressAuth
parameter to true
.Notes:
Information to use when creating a resource.
List of schedules to be assigned to the created resource. Currently only a single schedule is allowed. If provided, any additional schedules in the resource object will be ignored.
An object representing the available options for creating a resource.