The Resource Types V2 API allows you to classify resources that a business needs to provide services to customers. This classification ensures that Wix Bookings can automatically check availability and help avoid double bookings. Examples of resource types include rooms, equipment, vehicles, or any other custom asset type requiring scheduling and availability management.
With the Resource Types V2 API, you can create, retrieve, count, and update resource types.
To manage staff, use the Staff Members API (SDK | REST). Wix Bookings automatically classifies staff members in a resource type, which can't be managed with the Resource Types V2 API.
It’s important to note the following points before starting to code:
For a comprehensive glossary of Wix Bookings terms, see Terminology (SDK | REST).
This article presents a possible use case that you could support, along with a sample flow to implement it. This examples can serve as a helpful starting point as you plan your implementation.
You can create a custom resource type with bookable resources, allowing Wix Bookings to automatically check availability and avoid double bookings.
To create a custom resource type with bookable resources:
name
. Save the resource type ID.This article outlines error messages that might be issued when calling endpoints of the Resource Types API.
The Create Resource Type might issue the following error messages:
HTTP status | Error code | Error message | Troubleshooting |
---|---|---|---|
ALREADY_EXISTS (400) | RESOURCE_TYPE_ALREADY_EXISTS_FOR_NAME | ResourceType with name <name> already exists. | Make sure that the name of the resource type is unique within the site you are creating it. |
RESOURCE_EXHAUSTED (429) | MAX_NUMBER_OF_RESOURCE_TYPES_REACHED | The maximum number of <limit> resource types has been reached. | Delete unused resource types or upgrade your premium subscription. |
The Update Resource Type endpoint might issue the following error messages:
HTTP status | Error code | Error message | Troubleshooting |
---|---|---|---|
ALREADY_EXISTS (400) | RESOURCE_TYPE_ALREADY_EXISTS_FOR_NAME | ResourceType with name <name> already exists. | Make sure that the name of the resource type is unique within the site you are creating it. |
This article covers field support for filtering in Query Resource Types (SDK | REST) and Count Resource Types (SDK | REST).
Specify the filter
object in the following format:
The following table shows field support for filters and sorting for the
resourceType
object:
Field | Supported Filters | Sortable |
---|---|---|
id | $eq , $ne , $exists , $in , $nin , $startsWith | Sortable |
name | $eq , $ne , $exists , $in , $nin , $startsWith , $isEmpty | Sortable |
Results in Query Resource Types
(SDK | REST)
are sorted by id
in ascending order by default.
To sort by a different field, use the sort
object in the following format:
A resource type is a classification of resources. For example room, equipment, or vehicle. Customers can only book services (SDK | REST) if at least 1 resource (SDK | REST) for every resource type connected to the service is available during the requested time.
Resource type ID.
Revision number, which increments by 1 each time the resource type is updated. To prevent conflicting changes, the current revision must be passed when updating the resource type.
Time in YYYY-MM-DDThh:mm:ss.sssZ
format the resource type was created.
Time in YYYY-MM-DDThh:mm:ss.sssZ
format the resource type was last updated.
Name of the resource type. For example, meeting room
. The name must be
unique per site.
Extensions enabling users to save custom data related to the resource type.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a new resource type.
You can only call this method when authenticated as a Wix app or Wix user identity.
Resource type to create.
Created resource type.
There is 1 error with this status code.
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.