POST

Create Resource


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.

A new events schedule is automatically created specific to this resource. This schedule will contain information on when the resource is booked in order to prevent double bookings. See Schedules API for more information.

  • If the request does not include the field locationOptions, then the service will create this field and set availableInAllLocations in this structure to true.
  • If the request includes one or more business location IDs in the locationOptions.specificLocationOptions.businessLocations field, then the field locationOptions.specificLocationOptions.availableInBusinessLocations must be set to true.
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

Body Params
resourceResourceRequired

Resource to create.

Response Object
resourceResource

The created resource.

This is a minimal example of creating a resource. By default this resource is available in all locations. Only when the type field is provided can the resource be used for bookings.

Request
cURL
curl -X POST \ 'https://www.wixapis.com/bookings/v2/resources' \ -H 'Authorization: <AUTH>' \ -d '{ "resource": { "name": "Some name" } }'
Response
JSON
{ "resource": { "id": "77c7a7d1-0045-47eb-bef7-f1bcac5f68e1", "revision": "1", "createdDate": "2024-11-22T13:28:29.869Z", "updatedDate": "2024-11-22T13:28:29.869Z", "name": "Some name", "locationOptions": { "availableInAllLocations": true }, "eventsSchedule": { "scheduleId": "c0091359-7007-4288-be59-dccade075472" } } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

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