Â
Â
Note: This module is universal. Functions in this module can run on both the backend and frontend, unless specified otherwise.
The Bookings Resources API provides functionality for creating and managing resources.
A resource is a business asset like a staff member, or equipment needed to provide a service. Each resource owns a schedule. The schedule defines the resource's availability using the business's default working hours. Resources have tags that you can use for grouping. For example, add a "room"
tag for classroom resources, and an "equipment"
tag for resources like computers and projectors.
With the Resources API, you can:
To use the Resources API, import { resources }
from the wix-bookings.v1
module:
It's important to note the following points before starting to code:
"staff"
: Resources with the "staff"
tag appear in the Bookings app's Staff page."business"
: The Bookings app creates a resource with a name and tag value of "business"
. This resource owns a schedule that contains the operating hours of the business and cannot be deleted. This schedule is used when creating resources that use the business’s operating hours for the resource's working hours."INDIVIDUAL"
, "GROUP"
, and "COURSE"
.Functions in the Bookings Resources API are restricted and only run if you elevate permissions using the wix-auth
elevate()
function.
Warning: Elevating a function allows it to be called by any site visitor. Exercise caution to prevent security vulnerabilities.