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.

The FULL fieldset can only be retrieved by users with the READ RESERVATION LOCATIONS (FULL) or MANAGE RESERVATION LOCATIONS permission scopes.

Permissions
Read Reservation Locations (Basic)
Read Reservation Locations (Full)
Manage Reservation Locations
Learn more about app permissions.
Method Declaration
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>
JavaScript
import { reservationLocations } from "wix-table-reservations-v2"; // Sample reservationLocationId value: 'fab8cc1f-31cf-462f-b5bb-392594624bf2' reservationLocations .getReservationLocation(reservationLocationId) .then((retrievedReservationLocation) => { const isDefault = retrievedReservationLocation.default; const minNotice = retrievedReservationLocation.configuration.onlineReservations .minimumReservationNotice; console.log( "Success! Retrieved reservation location:", retrievedReservationLocation, ); return retrievedReservationLocation; }) .catch((error) => { console.error(error); // Handle the error }); /* Promise resolves to: * { * "location": { * "name": "Nemal Tel Aviv Street", * "fax": "", * "timeZone": "Europe/Dublin", * "email": "", * "phone": "", * "address": { * "formatted": "Tel Aviv Port, Nemal Tel Aviv Street, Tel Aviv, Israel", * "location": { * "latitude": 32.0972612, * "longitude": 34.77376549999999 * }, * "streetAddress": { * "name": "Nemal Tel Aviv Street", * "number": "", * "apt": "" * }, * "city": "Tel Aviv-Yafo", * "country": "IL" * }, * "businessSchedule": { * "periods": [ * { * "openDay": "SUNDAY", * "openTime": "00:00", * "closeDay": "MONDAY", * "closeTime": "00:00" * }, * { * "openDay": "THURSDAY", * "openTime": "00:00", * "closeDay": "SUNDAY", * "closeTime": "00:00" * } * ], * "specialHourPeriod": [] * }, * "_id": "f1f59093-6842-45a4-b9d1-106429ec8313" * }, * "configuration": { * "onlineReservations": { * "partiesSize": { * "min": 1, * "max": 6 * }, * "minimumReservationNotice": { * "number": 30, * "unit": "MINUTES" * }, * "turnoverTimeRules": [], * "turnoverRules": [], * "businessSchedule": { * "periods": [ * { * "openDay": "SUNDAY", * "openTime": "00:00", * "closeDay": "TUESDAY", * "closeTime": "00:00" * }, * { * "openDay": "WEDNESDAY", * "openTime": "00:00", * "closeDay": "THURSDAY", * "closeTime": "00:00" * }, * { * "openDay": "FRIDAY", * "openTime": "00:00", * "closeDay": "SUNDAY", * "closeTime": "00:00" * } * ], * "specialHourPeriod": [] * }, * "onlineReservationsEnabled": true * }, * "reservationForm": { * "customFieldDefinitions": [ * { * "name": "Allergies", * "required": false, * "_id": "f4283b2d-6340-4cf9-bae7-8769e6b62127" * } * ] * }, * "myReservationsFields": [] * }, * "default": true, * "archived": false, * "_id": "fab8cc1f-31cf-462f-b5bb-392594624bf2" * } */
Errors

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

Did this help?