Introduction
The Reservations Locations API allows you to configure reservation settings for a restaurant location.
A reservation location represents a physical restaurant and holds the ID of a location
object. The location object holds the address that corresponds to the on-site location of that restaurant (except when the restaurant has no on-site location). Each reservation location has its own calendar, scheduling rules, table management settings, and other attributes that can be set and modified by the API.
With the Reservations Locations API, you can:
- Query or list reservation locations.
- Update the configuration of existing reservation locations.
Note: Reservation locations can only be created and archived through a Wix site Dashboard, or using the Locations API.
Once a reservation location has been configured, you can:
- Retrieve time slots for the location using the Time Slots API.
- Make reservations for the location using a Wix site, or the Reservations API.
Before you begin
It’s important to note the following points before starting to code:
- The site or project owner must install the Wix Table Reservations app.
Permissions information
The following functions may require additional permissions to run depending on which fields are included, or the value of certain fields.
getReservationLocation()
Calling getReservationLocation()
with fieldsets
set to FULL
requires additional permissions:
- In an app, the
FULL
fieldset requires either theREAD RESERVATION LOCATIONS (FULL)
orMANAGE RESERVATION LOCATIONS
permission scope. - On a headless site, retrieving the
FULL
fieldset requires API key authorization with appropriate permissions.
listReservationLocations()
Calling listReservationLocations()
with fieldsets
set to FULL
requires additional permissions:
- In an app, the
FULL
fieldset requires either theREAD RESERVATION LOCATIONS (FULL)
orMANAGE RESERVATION LOCATIONS
permission scope. - On a headless site, retrieving the
FULL
fieldset requires API key authorization with appropriate permissions.
queryReservationLocations()
Calling queryReservationLocations()
with fieldsets
set to FULL
requires additional permissions:
- In an app, the
FULL
fieldset requires either theREAD RESERVATION LOCATIONS (FULL)
orMANAGE RESERVATION LOCATIONS
permission scope. - On a headless site, retrieving the
FULL
fieldset requires API key authorization with appropriate permissions.
Terminology
For a comprehensive glossary of Table Reservations terms, see Terminology.
Setup
To use the ReservationLocations API, install the @wix/table-reservations
package using npm or Yarn:
1npm install @wix/table-reservations
or
1yarn add @wix/table-reservations
Then import { reservationLocations }
from @wix/table-reservations
:
1import { reservationLocations } from '@wix/table-reservations'
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a reservation location by ID.
The FULL
fieldset can only be retrieved by users with the READ RESERVATION LOCATIONS (FULL)
or MANAGE RESERVATION LOCATIONS
permission scopes.
Permission Scopes
For app development, you must have one of the following permission scopes:function getReservationLocation(reservationLocationId: string, options: GetReservationLocationOptions): Promise<ReservationLocation>
ID of the ReservationLocation to retrieve.
An object representing the available options for retrieving a reservation location.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of up to 100 reservation locations.
The FULL
fieldset can only be retrieved by users with the READ RESERVATION LOCATIONS (FULL)
or MANAGE RESERVATION LOCATIONS
permission scopes.
Permission Scopes
For app development, you must have one of the following permission scopes:function listReservationLocations(options: ListReservationLocationsOptions): Promise<ListReservationLocationsResponse>
An object representing the available options for listing reservation locations.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a query to retrieve a list of reservation locations.
The queryReservationLocations()
function builds a query to retrieve a list of reservation locations and returns a ReservationLocationsQueryBuilder
object.
The returned object contains the query definition, which is used to run the query using the find() function.
You can refine the query by chaining ReservationLocationsQueryBuilder
functions onto the query. ReservationLocationsQueryBuilder
functions enable you to filter, sort, and control the results that queryReservationLocations()
returns.
queryReservationLocations()
runs with the following ReservationLocationsQueryBuilder
defaults, which you can override:
The following ReservationLocationsQueryBuilder
functions are supported for queryReservationLocations()
. For a full description of the reservation location object, see the object returned for the items
property in ReservationLocationsQueryResult
.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,in() |
Permission Scopes
For app development, you must have one of the following permission scopes:function queryReservationLocations(options: QueryReservationLocationsOptions): ReservationLocationsQueryBuilder
An object representing the available options for querying reservation locations.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates a reservation location. Supports partial updates.
Each time the reservation location is updated, revision
increments by 1. The existing revision must be included when updating the reservation location. This ensures you're working with the latest reservation location information, and it prevents unintended overwrites.
You cannot use this endpoint to change a reservation location's location
object. Attempting to do so will cause the server to return an application error.
Permission Scopes
For app development, you must have one of the following permission scopes:function updateReservationLocation(_id: string, reservationLocation: UpdateReservationLocation): Promise<ReservationLocation>
Reservation location ID.
Reservation location information to update.