This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a current snapshot of a site's properties.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function getSiteProperties(
options: GetSitePropertiesOptions,
): Promise<PropertiesReadResponse>;
Field options.
elevate()
, which enables site visitors to call functions without the required permissions. Exercise caution when using elevate()
to prevent security vulnerabilities.import { siteProperties } from "wix-business-tools.v2";
import { elevate } from "wix-auth";
export async function myGetSitePropertiesFunction() {
try {
const elevatedGetSiteProperties = elevate(siteProperties.getSiteProperties);
const mySiteProperties = await elevatedGetSiteProperties();
console.log("Success! Site properties:", mySiteProperties);
return mySiteProperties;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "properties": {
* "address": {
* "apartmentNumber": "",
* "city": "Radlett",
* "coordinates": {
* "latitude": 51.6855755,
* "longitude": -0.3241171999999999
* }
* "country": "GB",
* "googleFormattedAddress": "10 Watford Road, Radlett, UK",
* "hint": {
* "placement": "BEFORE",
* "text": "Located on the ground floor"
* },
* "isPhysical": true,
* "state": "Greater London",
* "street": "Watford Road",
* "streetNumber": "10",
* "zip": "WD7 8LD",
* },
* "businessConfig": "UNKNOWN",
* "businessName": "Kids Clothes For You",
* "businessSchedule": {
* "periods": [
* {
* "closeDay": "MONDAY",
* "closeTime": "18:00",
* "openDay": "MONDAY",
* "openTime": "08:00"
* },
* {
* "closeDay": "TUESDAY",
* "closeTime": "18:00",
* "openDay": "TUESDAY",
* "openTime": "08:00"
* },
* {
* "closeDay": "WEDNESDAY",
* "closeTime": "18:00",
* "openDay": "WEDNESDAY",
* "openTime": "08:00"
* },
* {
* "closeDay": "THURSDAY",
* "closeTime": "18:00",
* "openDay": "THURSDAY",
* "openTime": "08:00"
* },
* {
* "closeDay": "FRIDAY",
* "closeTime": "18:00",
* "openDay": "FRIDAY",
* "openTime": "08:00"
* }
* ],
* "specialHourPeriod": [
* {
* "comment": "Half price in the lead up to Christmas!",
* "endDate": "2023-12-24T23:59:00Z",
* "isClosed": false,
* "startDate": "2023-12-01T00:00:00Z"
* }
* ]
* },
* "categories": {
* "businessTermId": "38194ba8-1218-431c-a007-09c26c75ee0d"
* "primary": "other",
* "secondary": [
* "Local Business"
* ],
* },
* "consentPolicy": {
* "advertising": true,
* "analytics": true,
* "dataToThirdParty": true,
* "essential": true,
* "functional": true
* },
* "description": "Clothes for little people, for a little price!",
* "email": "kidsclothes@example.com",
* "fax": "011-44-20-12345678",
* "language": "en",
* "locale": {
* "languageCode": "en",
* "country": "GB"
* },
* "logo": "a8a52b_bf5596e614d8484e9f1d429ac256e1ad~mv2.jpeg",
* "paymentCurrency": "GBP",
* "phone": "0208 123 4569",
* "siteDisplayName": "Business Tools",
* "timeZone": "Europe/London",
* "trackClicksAnalytics": false
* },
* "version": "60"
* }
*/
There is 1 error with this status code.
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.