About the Resource Types V2 API

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.

Before you begin

It’s important to note the following points before starting to code:

  • Wix Bookings must be installed on a site before you can use the Resource Types API.
  • To ensure a resource (SDK | REST) is bookable and to prevent double bookings, it must be linked to a resource type. Customers can only book a service (SDK | REST) if at least 1 resource of each required type is available during the selected time.
  • Wix Bookings automatically manages a resource type for every staff member (SDK | REST). To avoid data conflicts, don't use the Resources V2 (SDK | REST) and Resource Types V2 (SDK | REST) APIs to manage staff.

Use Cases

  • Create a resource type with bookable resources (SDK | REST).

Terminology

  • Resource: An asset or entity that a business needs to provide services to customers. For example, a specific meeting room or piece of equipment.
  • Resource type: A classification that links resources, making them bookable.
  • Staff member: An individual providing a service within Wix Bookings.

For a comprehensive glossary of Wix Bookings terms, see Terminology (SDK | REST).

See also

Did this help?

Resource Types API: Sample Use Cases and Flows

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.

Create a resource type with bookable resources

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:

  1. Call Create Resource Type (SDK | REST), specifying a descriptive name. Save the resource type ID.
  2. Call Create Resource (SDK | REST), or Bulk Create Resources (SDK | REST) to create individual resources. Make sure to include the ID of the created resource type to make each resource bookable.
  3. Call Query Services (SDK | REST). Identify the IDs of the services that require a resource of this type to be booked.
  4. For each identified service, call Update Service (SDK | REST). Specify the service ID and the ID of the created resource type.
Did this help?

Resource Types Errors

This article outlines error messages that might be issued when calling endpoints of the Resource Types API.

Create Resource Type

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_NAMEResourceType 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_REACHEDThe maximum number of <limit> resource types has been reached.Delete unused resource types or upgrade your premium subscription.

Update Resource Type

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_NAMEResourceType with name <name> already exists.Make sure that the name of the resource type is unique within the site you are creating it.
Did this help?

Resource Types: Filtering and Sorting

This article covers field support for filtering in Query Resource Types (SDK | REST) and Count Resource Types (SDK | REST).

Filtering

Specify the filter object in the following format:

Copy

The following table shows field support for filters and sorting for the resourceType object:

FieldSupported FiltersSortable
id$eq, $ne, $exists, $in, $nin, $startsWithSortable
name$eq, $ne, $exists, $in, $nin, $startsWith, $isEmptySortable

Sorting

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:

Copy

See also

Did this help?

Resource Type Object


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.

Properties
idstringRead-onlyformat GUID

Resource type ID.


revisionintegerRead-onlyformat int64

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.


createdDatestringRead-onlyformat date-time

Time in YYYY-MM-DDThh:mm:ss.sssZ format the resource type was created.


updatedDatestringRead-onlyformat date-time

Time in YYYY-MM-DDThh:mm:ss.sssZ format the resource type was last updated.


namestringmaxLength 40minLength 1

Name of the resource type. For example, meeting room. The name must be unique per site.


extendedFieldsExtendedFields

Extensions enabling users to save custom data related to the resource type.

ResourceType
JSON
Did this help?

POST

Create Resource Type


Developer Preview

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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings - all permissions
Manage Bookings
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/bookings/v2/resources/resource-types

Body Params
resourceTypeResourceTypeRequired

Resource type to create.

Response Object
resourceTypeResourceType

Created resource type.

Create a resource type.
Request
cURL
Response
JSON
Errors
409Already Exists

There is 1 error with this status code.

429Resource Exhausted

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?