About the Resource Types API

The Resource Types API is an integral part of the Wix Bookings app, designed to manage and interact with resource types, such as room, equipment or vehicle. Defining resource types enables consistent classification of resources and is essential for making them bookable and avoiding double bookings.

The Resource Types API provides functionality to manage resource types, including creating, updating, deleting, and querying resource types.

Before you begin

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

  • Ensure that the Wix Bookings app is installed and configured on the site before using this API.
  • Resource Types API is part of the Resource Management feature in Wix Bookings. Learn more about managing your resources.
  • A resource must be connected to a resource type in order for it to be bookable and to avoid double bookings. Learn more about Resources. In turn, the resource type must be connected to the relevant services. Learn more about Services.
  • For resources that are associated to staff members, the Wix Bookings app automatically prevents double bookings. The availability of a staff member can be managed by changing the events in the associated working hours schedule. Learn more about Staff Members and Events API.

Use Cases

Terminology

  • Resource Type: A classification of resources. A resource must be associated with a resource type to be bookable.
  • Resource: An asset or entity that can be reserved or booked for a specified period within Wix Bookings.
  • Staff Member: An individual who provides booking services on the site.

For a comprehensive glossary of Wix Bookings terms, see Terminology

See also

Did this help?

Resource Types API: Sample Use Cases and Flows

This article presents possible use cases that your app could support, along with sample flows to implement each use case. These examples can serve as a helpful starting point as you plan your app's functionality.

Setting up a custom resource type with bookable resources

This use case demonstrates the process of creating a custom resource type with bookable resources such that their availability will be automatically managed by the Bookings app.

To create a custom resource type with bookable resources:

  1. Use Create Resource Type to create a resource type by providing a descriptive name. Save the resource type ID.

  2. Use Create Resource or Bulk Create Resources to create individual resources. Be sure to include the ID of the created resource type to make each resource bookable.

  3. Use Query Services to retrieve the IDs of the services that require a resource of this type to booked.

  4. Use Update Service to connect the resource type for each service providing the ID of the service and the ID of the 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

Query endpoints allow you to filter and sort results based on resource type properties. This article covers field support for filtering and sorting.

Filtering

Specify the filter object in the following format:

Copy
{ "filter": { "fieldName": { "$eq": "value" } } }

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

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

Sorting

Results are sorted by the id field in ascending order by default.

To sort by a different field, use the sort object in the following format:

Copy
{ "sort": [ { "fieldName": "name", "order": "DESC" } ] }

Related content:

Did this help?

Resource Type Object


A resource type is a classification of resources, e.g. room, equipment or vehicle.

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

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


updatedDatestringRead-onlyformat date-time

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


namestringmaxLength 40minLength 1

The name of this 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
{ "resourceType": { "id": "28221941-9d0d-4c91-806b-e2a08073d37a", "revision": "1", "createdDate": "2024-11-14T13:32:36.462Z", "updatedDate": "2024-11-14T13:32:36.462Z", "name": "Meeting room" } }
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 be created.

Response Object
resourceTypeResourceType

The created resource type.

Create a resource type.
Request
cURL
curl -X POST \ 'https://www.wixapis.com/bookings/v2/resources/resource-types' \ -H 'Authorization: <AUTH>' \ -d '{ "resourceType": { "name": "Meeting room" } }'
Response
JSON
{ "resourceType": { "id": "28221941-9d0d-4c91-806b-e2a08073d37a", "revision": "1", "createdDate": "2024-11-14T13:32:36.462Z", "updatedDate": "2024-11-14T13:32:36.462Z", "name": "Meeting room" } }
Event TriggersThis method triggers the following events:
Did this help?

GET

Get 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.

Retrieves a resource type by ID.

Permissions
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Public Data
Read Bookings - Including Participants
Manage Bookings Services and Settings
Read bookings calendar - including participants
Read Bookings Calendar
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/bookings/v2/resources/resource-types/{resourceTypeId}

Path Params
resourceTypeIdstringRequired

ID of the resource type to retrieve.

Response Object
resourceTypeResourceType

The requested resource type.

Retrieve a resource type.
Request
cURL
curl -X GET \ 'https://www.wixapis.com/bookings/v2/resources/resource-types/28221941-9d0d-4c91-806b-e2a08073d37a' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "resourceType": { "id": "28221941-9d0d-4c91-806b-e2a08073d37a", "revision": "2", "createdDate": "2024-11-14T13:32:36.462Z", "updatedDate": "2024-11-14T13:39:20.409Z", "name": "Meeting room with conference system" } }
Did this help?

DELETE

Delete 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.

Deletes a resource type.

Deleting a resource type will automatically delete all resources of this 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
DELETE
https://www.wixapis.com/bookings/v2/resources/resource-types/{resourceTypeId}

Path Params
resourceTypeIdstringRequired

ID of the resource type to delete.

Response Object
Returns an empty object.
Delete a resource type.
Request
cURL
curl -X DELETE \ 'https://www.wixapis.com/bookings/v2/resources/resource-types/28221941-9d0d-4c91-806b-e2a08073d37a' \ -H 'Authorization: <AUTH>'
Response
JSON
{}
Event TriggersThis method triggers the following events:
Did this help?

PATCH

Update 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.

Updates a resource type.

Each time the resource type is updated, revision increments by 1. You must include current revision of the resource type when updating it. This ensures you're working with the latest service information and prevents unintended overwrites.

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
PATCH
https://www.wixapis.com/bookings/v2/resources/resource-types/{resourceType.id}

Path Params
resourceType.idstringRequired

Resource type ID.

Body Params
resourceTypeResourceTypeRequired

Resource type to update.

Response Object
resourceTypeResourceType

Updated resource type.

Update a resource type.

To update a resource type the fields id and revision are required. Partial updates are supported.

Request
cURL
curl -X PATCH \ 'https://www.wixapis.com/bookings/v2/resources/resource-types/28221941-9d0d-4c91-806b-e2a08073d37a' \ -H 'Authorization: <AUTH>' \ -d '{ "resourceType": { "id": "28221941-9d0d-4c91-806b-e2a08073d37a", "revision": "1", "name": "Meeting room with conference system" } }'
Response
JSON
{ "resourceType": { "id": "28221941-9d0d-4c91-806b-e2a08073d37a", "revision": "2", "createdDate": "2024-11-14T13:32:36.462Z", "updatedDate": "2024-11-14T13:39:20.409Z", "name": "Meeting room with conference system" } }
Event TriggersThis method triggers the following events:
Did this help?

POST

Query Resource Types


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Queries resource types, given the provided paging, filtering, and sorting.

Up to 100 resource types can be returned per request. For field support for filters, see Resource types: Filtering and Sorting. To learn how to query resource types, see API Query Language.

Permissions
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Public Data
Read Bookings - Including Participants
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/bookings/v2/resources/resource-types/query

Body Params
queryQuery

WQL expression.

Response Object
resourceTypesArray <ResourceType>

The retrieved resource types.


pagingMetadataPagingMetadata

Paging metadata, including offset and count.

Query resource types, providing a limit to the number of results returned.

Request
cURL
curl -X POST \ 'https://www.wixapis.com/bookings/v2/resources/resource-types/query' \ -H 'Authorization: <AUTH>' \ -d '{ "query": { "cursorPaging": { "cursor": null, "limit": 10 } } }'
Response
JSON
{ "resourceTypes": [ { "id": "28221941-9d0d-4c91-806b-e2a08073d37a", "revision": "2", "createdDate": "2024-11-14T13:32:36.462Z", "updatedDate": "2024-11-14T13:39:20.409Z", "name": "Meeting room with conference system" }, { "id": "51dde79f-0ce3-420e-b5dc-bb3f98533ae9", "revision": "1", "createdDate": "2024-11-14T13:46:58.237Z", "updatedDate": "2024-11-14T13:46:58.237Z", "name": "Beamer" } ], "pagingMetadata": { "count": 2, "cursors": {}, "hasNext": false } }
Did this help?

POST

Count Resource Types


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Counts resource types according to given criteria.

For field support for filters, see Resource types: Filtering and Sorting. Use WQL filter to define the criteria.

Permissions
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Public Data
Read Bookings - Including Participants
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/bookings/v2/resources/resource-types/count

Body Params
filterstruct

Filter to apply on resource types to count.

Response Object
countinteger

The number of resource types matching the given filter.

Request
cURL
curl -X POST \ 'https://www.wixapis.com/bookings/v2/resources/resource-types/count' \ -H 'Authorization: <AUTH>' \ -d '{}'
Response
JSON
{ "count": 2 }
Did this help?

Resource Type Created


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a resource type is created.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.bookings.resources.v2.resource_type.


slugstring

Event name. Expected created.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


createdEventCreatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.bookings.resources.v2.resource_type_created", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

ResourceTypeCreated
JSON
{ "id": "14754b5a-7905-4b29-bff3-dd1c7a3071c0", "entityFqdn": "wix.bookings.resources.v2.resource_type", "slug": "created", "entityId": "32883beb-d747-4e61-8a74-1f1f43a7d11d", "createdEvent": { "entity": { "id": "32883beb-d747-4e61-8a74-1f1f43a7d11d", "revision": "1", "createdDate": "2024-11-27T16:15:05.563Z", "updatedDate": "2024-11-27T16:15:05.563Z", "name": "Laptop" } }, "eventTime": "2024-11-27T16:15:05.586954667Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "1" }
Did this help?

Resource Type Deleted


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a resource type is deleted.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.bookings.resources.v2.resource_type.


slugstring

Event name. Expected deleted.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


deletedEventstruct

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.bookings.resources.v2.resource_type_deleted", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

ResourceTypeDeleted
JSON
{ "id": "eb94c557-9599-482c-8b2c-bb1ebca6e140", "entityFqdn": "wix.bookings.resources.v2.resource_type", "slug": "deleted", "entityId": "32883beb-d747-4e61-8a74-1f1f43a7d11d", "deletedEvent": { "movedToTrash": true }, "eventTime": "2024-11-27T16:21:39.268557862Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "12" }
Did this help?

Resource Type Updated


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Triggered when a resource type is updated.

Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.bookings.resources.v2.resource_type.


slugstring

Event name. Expected updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


updatedEventUpdatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.bookings.resources.v2.resource_type_updated", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

ResourceTypeUpdated
JSON
{ "id": "a5277ada-60d9-4538-8495-6b955a94df2d", "entityFqdn": "wix.bookings.resources.v2.resource_type", "slug": "updated", "entityId": "32883beb-d747-4e61-8a74-1f1f43a7d11d", "updatedEvent": { "currentEntity": { "id": "32883beb-d747-4e61-8a74-1f1f43a7d11d", "revision": "2", "createdDate": "2024-11-27T16:15:05.563Z", "updatedDate": "2024-11-27T16:18:50.149Z", "name": "Laptop Windows", "appId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97" } }, "eventTime": "2024-11-27T16:18:50.185050444Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "2" }
Did this help?