Setup

To use the ReservationLocations API, install the @wix/table-reservations package using npm or Yarn:

Copy
1
npm install @wix/table-reservations

or

Copy
1
yarn add @wix/table-reservations

Then import { reservationLocations } from @wix/table-reservations:

Copy
1
import { reservationLocations } from '@wix/table-reservations'
Was this helpful?
Yes
No

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:

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.

Terminology

For a comprehensive glossary of Table Reservations terms, see Terminology.

Was this helpful?
Yes
No

getReservationLocation( )

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 reservation location by ID.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Reservation Locations (Basic)
Read Reservation Locations (Full)
Manage Reservation Locations
Learn more about permission scopes.
Copy
function getReservationLocation(reservationLocationId: string, options: GetReservationLocationOptions): Promise<ReservationLocation>
Method Parameters
reservationLocationIdstringRequired
ID of the ReservationLocation to retrieve.

optionsGetReservationLocationOptions
An object representing the available options for retrieving a reservation location.
Returns
Return Type:Promise<ReservationLocation>
Was this helpful?
Yes
No

listReservationLocations( )

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 list of up to 100 reservation locations.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Reservation Locations (Basic)
Read Reservation Locations (Full)
Manage Reservation Locations
Learn more about permission scopes.
Copy
function listReservationLocations(options: ListReservationLocationsOptions): Promise<ListReservationLocationsResponse>
Method Parameters
optionsListReservationLocationsOptions
An object representing the available options for listing reservation locations.
Returns
Return Type:Promise<ListReservationLocationsResponse>
Was this helpful?
Yes
No

queryReservationLocations( )

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

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),in()

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Reservation Locations (Basic)
Read Reservation Locations (Full)
Manage Reservation Locations
Learn more about permission scopes.
Copy
function queryReservationLocations(options: QueryReservationLocationsOptions): ReservationLocationsQueryBuilder
Method Parameters
optionsQueryReservationLocationsOptions
An object representing the available options for querying reservation locations.
Returns
Return Type:ReservationLocationsQueryBuilder
Was this helpful?
Yes
No

updateReservationLocation( )

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 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:
Manage Reservation Locations
Learn more about permission scopes.
Copy
function updateReservationLocation(_id: string, reservationLocation: UpdateReservationLocation): Promise<ReservationLocation>
Method Parameters
_idstringRequired
Reservation location ID.

reservationLocationUpdateReservationLocationRequired
Reservation location information to update.
Returns
Return Type:Promise<ReservationLocation>
Was this helpful?
Yes
No