> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: getReservation(reservationId: string, options: GetReservationOptions) # Method package: wixTableReservationsV2 # Method menu location: wixTableReservationsV2 --> reservations --> getReservation # Method Link: https://dev.wix.com/docs/velo/apis/wix-table-reservations-v2/reservations/get-reservation.md # Method Description: Retrieves a reservation. Calling this method with `fieldsets` set to `FULL` requires additional permissions. See this API's Introduction article for more information. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get a reservation (page code) ```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" * } */ ``` ## Get a reservation with options (backend) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { reservations } from 'wix-table-reservations.v2'; import { elevate } from 'wix-auth'; /* Sample reservationId value: "1e3db995-5614-4748-8903-cbe7c74c5753" * * Sample options value: * { * "fieldsets": ["FULL"] * } */ export const myGetReservationFunction = webMethod(Permissions.Anyone, async (reservationId, options) => { const elevatedGetReservation = elevate(reservations.getReservation); try { const result = await elevatedGetReservation(reservationId, options); return result; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "status": "RESERVED", * "source": "ONLINE", * "details": { * "reservationLocationId": "fab8cc1f-31cf-462f-b5bb-392594624bf2", * "tableIds": [ * "1ed802ae-708f-4da6-9177-54c3df5d3dd5" * ], * "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", * "_updatedDate": "2024-01-22T07:25:51.008Z" * } */ ``` ---