getLocation( )


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

Permissions
Manage Bookings Services and Settings
Manage Bookings
Manage Calendars
Manage Bookings - all permissions
Read Bookings - all read permissions
Read Bookings - Including Participants
Read bookings calendar - including participants
Manage Locations
Manage Portfolio
Manage Restaurants - all permissions
Read Locations
Learn more about app permissions.
Method Declaration
Copy
function getLocation(_id: string): Promise<Location>;
Method Parameters
_idstringRequired

ID of the location to retrieve.

Returns
Return Type:Promise<Location>
JavaScript
import { locations } from "wix-business-tools.v2"; import { elevate } from "wix-auth"; /* Sample _id value: '0a965e36-4071-4df0-905b-75458817430a' */ export async function myGetLocationFunction(_id) { try { const elevatedGetLocation = elevate(locations.getLocation); const myLocation = await elevatedGetLocation(_id); console.log("Here are the details of the location:", myLocation); return myLocation; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "_id": "0a965e36-4071-4df0-905b-75458817430a", * "address": { * "streetAddress": { * "apt": "", * "name": "Calle Miguel Hidalgo", * "number": "15" * }, * "city": "La Reforma", * "postalCode": "22000" * }, * "archived": false, * "default": false, * "description": "Our brand new, budget store in the heart of Mexico City!", * "email": "store@example.com", * "phone": "+52 55 1234 5678", * "name": "Mexico Store", * "revision": "2", * "status": "ACTIVE", * "timeZone": "America/Mexico_City" * } */
Errors

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

Did this help?