getReservation( )


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.

Calling this method with fieldsets set to FULL requires additional permissions. See this API's Introduction article for more information.

Permissions
Manage Reservations (Medium)
Manage Reservations (Full)
Manage Restaurants - all permissions
Manage Reservations (Basic)
Learn more about app permissions.
Method Declaration
Copy
function getReservation(
  reservationId: string,
  options: GetReservationOptions,
): Promise<Reservation>;
Method Parameters
reservationIdstringRequired

Reservation ID.


optionsGetReservationOptions
Returns
Return Type:Promise<Reservation>
JavaScript
import { reservations } from "wix-table-reservations.v2"; // Sample reservationId value: "1e3db995-5614-4748-8903-cbe7c74c5753" reservations .getReservation(reservationId) .then((retrievedReservation) => { const startDate = retrievedReservation.details.startDate; const partySize = retrievedReservation.details.partySize; console.log("Success! Retrieved reservation:", retrievedReservation); return retrievedReservation; }) .catch((error) => { console.error(error); // Handle the error }); /* Promise resolves to: * { * "status": "RESERVED", * "source": "UNKNOWN", * "details": { * "reservationLocationId": "fab8cc1f-31cf-462f-b5bb-392594624bf2", * "tableIds": [], * "startDate": "2024-12-04T12:30:00.000Z", * "endDate": "2024-12-04T14:00:00.000Z", * "partySize": 2 * }, * "revision": "1", * "migrationNotes": [], * "tablesWithReservationConflicts": [], * "_id": "1e3db995-5614-4748-8903-cbe7c74c5753", * "_createdDate": "2024-01-22T07:25:51.008Z" * } */
Errors

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

Did this help?