CorvidReference

generalInfo

The General Info API contains functionality for getting the information about your business that has been entered in the General Info section of your site's Dashboard.

To use the General Info API, import wixSite from the wix-site-backend module:

   import wixSite from 'wix-site-backend';

Table of Contents

FUNCTIONS

?
Perform actions on an object.
getAddress( )Gets the physical address of the site's business.
getBusinessName( )Gets the site business name.
getBusinessSchedule( )Gets the business hours of the site's business.
getCategories( )Gets the site category information.
getDescription( )Gets the site description.
getEmail( )Gets the email address used for notifications of activities on your site.
getFax( )Gets the fax number used for notifications of activities on your site.
getLanguage( )Gets site language information.
getLocale( )Gets site locale information.
getLogo( )Gets the site logo file name.
getMultilingual( )Gets site multilingual information.
getPaymentCurrency( )Gets site payment currency information.
getPhone( )Gets the phone number used for notifications of activities on your site.
getSiteDisplayName( )Gets the site display name.
getTimeZone( )Gets site time zone information.

OBJECTS

?
Objects used when setting, getting, or calling the properties and methods listed above.
GeneralInfoAddressAn object representing a site's corresponding physical address.
GeneralInfoAddressCoordinatesAn object representing the coordinates of the site address.
GeneralInfoAddressHintAn object representing a description of a site's address.
GeneralInfoCategoriesAn object representing the categories that describe your site's business.
GeneralInfoLanguagesAn object representing the site's languages.
GeneralInfoLanguagesSupportedAn object representing the site's supported languages.
GeneralInfoLocaleAn object representing a site's locale.
GeneralInfoScheduleAn object representing business hours.
GeneralInfoSchedulePeriodsAn object representing business opened and closed hours.
GeneralInfoScheduleSpecialAn object representing special business hours.

getAddress( )

Gets the physical address of the site's business.

Description

The getAddress() function returns a Promise that resolves to the site's corresponding physical address information.

The retrieved address is the address that has been entered in the General Info section of your site's Dashboard.

Syntax

function getAddress(): Promise<GeneralInfoAddress>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.

Fulfilled - An object containing the site's corresponding physical address information. Rejected - Error message.

Examples

Get site's corresponding physical address information

import wixSite from 'wix-site-backend';

export function getAddress() {
  return wixSite.generalInfo.getAddress();
}

/*
 * {
 *   "street":   "235 W 23rd St",
 *   "city":     "New York",
 *   "country":  "USA",
 *   "state":    "NY",
 *   "zip":      "10011",
 *   "hint": {
 *     "text":       "green building",
 *     "placement":  "BEFORE"
 *   },
 *   "isPhysical":             true,
 *   "googleFormattedAddress": "235 W 23rd St, New York, NY, 10011",
 *   "streetNumber":           "235",
 *   "apartmentNumber":        "12",
 *   "coordinates": {
 *     "latitude": "40.744869",
 *     "longitude": "-73.996736"
 *   }
 * }
 */

getBusinessName( )

Gets the site business name.

Description

The getBusinessName() function returns a Promise that resolves to the site's business name information.

The retrieved business name is the name that has been entered in the General Info section of your site's Dashboard.

Syntax

function getBusinessName(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site business name information. Rejected - Error message.

Examples

Get the site business name

import wixSite from 'wix-site-backend';

export function getBusinessName() {
  return wixSite.generalInfo.getBusinessName(); // "My Business Name"
}

getBusinessSchedule( )

Gets the business hours of the site's business.

Description

The getBusinessSchedule() function returns a Promise that resolves to the site's corresponding business hours information.

The retrieved schedule is the schedule that has been entered in the General Info section of your site's Dashboard.

Syntax

function getBusinessSchedule(): Promise<GeneralInfoSchedule>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.

Fulfilled - An object containing the site business hours. Rejected - Error message.

Examples

Get site business hours

import wixSite from 'wix-site-backend';

export function getBusinessSchedule() {
  return wixSite.generalInfo.getBusinessSchedule();
}

/*
 * {
 *   "periods": [
 *     {
 *       "openDay":    "MONDAY",
 *       "openTime":   "08:00",
 *       "closeDay":   "MONDAY",
 *       "closeTime":  "17:00"
 *     },
 *     {
 *       "openDay":    "THURSDAY",
 *       "openTime":   "09:00",
 *       "closeDay":   "THURSDAY",
 *       "closeTime":  "18:00"
 *     }
 *   ],
 *   "specialHourPeriod": [
 *     {
 *       "startDate":  "31-12-2018",
 *       "endDate":    "01-01-2019",
 *       "isClosed":   true,
 *       "comment":    "new year eve"
 *     }
 *   ]
 * }
 */

getCategories( )

Gets the site category information.

Description

The getCategories() function returns a Promise that resolves to the site's category information.

The retrieved category information is the information that has been entered in the General Info section of your site's Dashboard.

Syntax

function getCategories(): Promise<GeneralInfoCategories>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.

Fulfilled - An object containing the site category information. Rejected - Error message.

Examples

Get site category information

import wixSite from 'wix-site-backend';

export function getCategories() {
  return wixSite.generalInfo.getCategories();
}

/*
 * {
 *   "primary":   "business",
 *   "secondary": ["technology-apps"]
 * }
 */

getDescription( )

Gets the site description.

Description

The getDescription() function returns a Promise that resolves to the site's description information.

The retrieved description is the description that has been entered in the General Info section of your site's Dashboard.

Syntax

function getDescription(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site description. Rejected - Error message.

Examples

Get the site description

import wixSite from 'wix-site-backend';

export function getDescription() {
  return wixSite.generalInfo.getDescription(); // "Description text."
}

getEmail( )

Gets the email address used for notifications of activities on your site.

Description

The getEmail() function returns a Promise that resolves to the site's email information.

The retrieved email address is the address that has been entered in the General Info section of your site's Dashboard.

Syntax

function getEmail(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site email information. Rejected - Error message.

Examples

Get the email address used for notifications of activities on your site

import wixSite from 'wix-site-backend';

export function getEmail() {
  return wixSite.generalInfo.getEmail(); // "some@email.com"
}

getFax( )

Gets the fax number used for notifications of activities on your site.

Description

The getFax() function returns a Promise that resolves to the site's fax number information.

The retrieved fax number is the fax number that has been entered in the General Info section of your site's Dashboard.

Syntax

function getFax(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site fax number information. Rejected - Error message.

Examples

Get the fax number used for notifications of activities on your site

import wixSite from 'wix-site-backend';

export function getFax() {
  return wixSite.generalInfo.getFax(); // "+ 555-55-5556"
}

getLanguage( )

Gets site language information.

Description

The getLanguage() function returns a Promise that resolves to the site's language information.

The retrieved language information is the information that has been entered in the General Info section of your site's Dashboard.

Syntax

function getLanguage(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site language information. Rejected - Error message.

Examples

Get site language information

import wixSite from 'wix-site-backend';

export function getLanguage() {
  return wixSite.generalInfo.getLanguage(); // "en"
}

getLocale( )

Gets site locale information.

Description

The getLocale() function returns a Promise that resolves to the site's locale information.

The retrieved locale information is the information that has been entered in the General Info section of your site's Dashboard.

Syntax

function getLocale(): Promise<GeneralInfoLocale>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.

Fulfilled - An object containing the site locale information. Rejected - Error message.

Examples

Get site locale information

import wixSite from 'wix-site-backend';

export function getLocale() {
  return wixSite.generalInfo.getLocale();
}

/*
 * {
 *   "country":      "US",
 *   "languageCode": "en"
 * }
 */

getLogo( )

Gets the site logo file name.

Description

The getLogo() function returns a Promise that resolves to the site's logo file name information.

The retrieved logo is the logo that has been entered in the General Info section of your site's Dashboard.

Syntax

function getLogo(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site logo file name. Rejected - Error message.

Examples

Get the site logo file name

import wixSite from 'wix-site-backend';

export function getLogo() {
  return wixSite.generalInfo.getLogo();
}

// "791f5e_3217d51097ed4ea7a51deaa583cfbe65~mv2.gif"

getMultilingual( )

Gets site multilingual information.

Description

The getMultilingual() function returns a Promise that resolves to the site's multilingual information.

The retrieved multilingual information is based on the languages set using Wix Multilingual.

Syntax

function getMultilingual(): Promise<GeneralInfoLanguages>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.

Fulfilled - An object containing the site multilingual information. Rejected - Error message.

Examples

Get site multilingual information

import wixSite from 'wix-site-backend';

export function getMultilingual() {
  return wixSite.generalInfo.getMultilingual();
}

/*
 * {
 *   "supportedLanguages": [
 *     {
 *       "languageCode": "en",
 *       "locale": {
 *         "country":    "US",
 *         "languageCode": "en"
 *       },
 *       "iconUrl":    "someUrl",
 *       "isPrimary":  true
 *     }
 *   ],
 *   "autoRedirect": true
 * }
 */

getPaymentCurrency( )

Gets site payment currency information.

Description

The getPaymentCurrency() function returns a Promise that resolves to the site's payment currency information.

The retrieved payment currency information is the information that has been entered in the General Info section of your site's Dashboard.

Syntax

function getPaymentCurrency(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site payment currency information. Rejected - Error message.

Examples

Get site payment currency information

import wixSite from 'wix-site-backend';

export function getPaymentCurrency() {
  return wixSite.generalInfo.getPaymentCurrency(); // "USD"
}

getPhone( )

Gets the phone number used for notifications of activities on your site.

Description

The getPhone() function returns a Promise that resolves to the site's phone number information.

The retrieved phone number is the phone number that has been entered in the General Info section of your site's Dashboard.

Syntax

function getPhone(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site phone number information. Rejected - Error message.

Examples

Get the phone number used for notifications of activities on your site

import wixSite from 'wix-site-backend';

export function getPhone() {
  return wixSite.generalInfo.getPhone(); // "+ 555-555-5555"
}

getSiteDisplayName( )

Gets the site display name.

Description

The getSiteDisplayName() function returns a Promise that resolves to the site's display name information.

The retrieved display name is the name that has been entered in the General Info section of your site's Dashboard.

Syntax

function getSiteDisplayName(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site display name information. Rejected - Error message.

Examples

Get the site display name

import wixSite from 'wix-site-backend';

export function getSiteDisplayName() {
  return wixSite.generalInfo.getSiteDisplayName(); // "My Awesome Site"
}

getTimeZone( )

Gets site time zone information.

Description

The getTimeZone() function returns a Promise that resolves to the site's time zone information.

The retrieved time zone information is the information that has been entered in the General Info section of your site's Dashboard.

Syntax

function getTimeZone(): Promise<string>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<string>

Fulfilled - An object containing the site time zone information. Rejected - Error message.

Examples

Get site time zone information

import wixSite from 'wix-site-backend';

export function getTimeZone() {
  return wixSite.generalInfo.getTimeZone(); // "America/New_York"
}

GeneralInfoAddress

An object representing a site's corresponding physical address.

See Also

getAddress( )

Syntax

type GeneralInfoAddress = {
  street: string
  city: string
  country: string
  state: string
  zip: string
  hint: GeneralInfoAddressHint
  isPhysical: boolean
  googleFormattedAddress: string
  streetNumber: string
  apartmentNumber: string
  coordinates: GeneralInfoAddressCoordinates
}
MEMBERS
?
The properties of an object.
street
string
Address street.
city
string
Address city.
country
string
Address country.
state
string
Address state.
zip
string
Address zip code.
hint
Address description.
isPhysical
boolean
Whether the business has a physical address.
googleFormattedAddress
string
Address as formatted by Google.
streetNumber
string
Address street number.
apartmentNumber
string
Address apartment number.
coordinates
Address coordinates.

Examples

Get site's corresponding physical address information

import wixSite from 'wix-site-backend';

export function getAddress() {
  return wixSite.generalInfo.getAddress();
}

/*
 * {
 *   "street":   "235 W 23rd St",
 *   "city":     "New York",
 *   "country":  "USA",
 *   "state":    "NY",
 *   "zip":      "10011",
 *   "hint": {
 *     "text":       "green building",
 *     "placement":  "BEFORE"
 *   },
 *   "isPhysical":             true,
 *   "googleFormattedAddress": "235 W 23rd St, New York, NY, 10011",
 *   "streetNumber":           "235",
 *   "apartmentNumber":        "12",
 *   "coordinates": {
 *     "latitude": "40.744869",
 *     "longitude": "-73.996736"
 *   }
 * }
 */

GeneralInfoAddressCoordinates

An object representing the coordinates of the site address.

See Also

getAddress( )

Syntax

type GeneralInfoAddressCoordinates = {
  latitude: string
  longitude: string
}
MEMBERS
?
The properties of an object.
latitude
string
Address latitude.
longitude
string
Address longitude.

Examples

Get site's corresponding physical address information

import wixSite from 'wix-site-backend';

export function getAddress() {
  return wixSite.generalInfo.getAddress();
}

/*
 * {
 *   "street":   "235 W 23rd St",
 *   "city":     "New York",
 *   "country":  "USA",
 *   "state":    "NY",
 *   "zip":      "10011",
 *   "hint": {
 *     "text":       "green building",
 *     "placement":  "BEFORE"
 *   },
 *   "isPhysical":             true,
 *   "googleFormattedAddress": "235 W 23rd St, New York, NY, 10011",
 *   "streetNumber":           "235",
 *   "apartmentNumber":        "12",
 *   "coordinates": {
 *     "latitude": "40.744869",
 *     "longitude": "-73.996736"
 *   }
 * }
 */

GeneralInfoAddressHint

An object representing a description of a site's address.

See Also

getAddress( )

Syntax

type GeneralInfoAddressHint = {
  text: string
  placement: string
}
MEMBERS
?
The properties of an object.
text
string
Address description.
placement
string
Whether description is shown before, after, or instead of the actual address.

Examples

Get site's corresponding physical address information

import wixSite from 'wix-site-backend';

export function getAddress() {
  return wixSite.generalInfo.getAddress();
}

/*
 * {
 *   "street":   "235 W 23rd St",
 *   "city":     "New York",
 *   "country":  "USA",
 *   "state":    "NY",
 *   "zip":      "10011",
 *   "hint": {
 *     "text":       "green building",
 *     "placement":  "BEFORE"
 *   },
 *   "isPhysical":             true,
 *   "googleFormattedAddress": "235 W 23rd St, New York, NY, 10011",
 *   "streetNumber":           "235",
 *   "apartmentNumber":        "12",
 *   "coordinates": {
 *     "latitude": "40.744869",
 *     "longitude": "-73.996736"
 *   }
 * }
 */

GeneralInfoCategories

An object representing the categories that describe your site's business.

See Also

getCategories( )

Syntax

type GeneralInfoCategories = {
  primary: string
  secondary: Array<string>
}
MEMBERS
?
The properties of an object.
primary
string
Primary site category.
secondary
Array<string>
List of secondary site categories.

Examples

Get site category information

import wixSite from 'wix-site-backend';

export function getCategories() {
  return wixSite.generalInfo.getCategories();
}

/*
 * {
 *   "primary":   "business",
 *   "secondary": ["technology-apps"]
 * }
 */

GeneralInfoLanguages

An object representing the site's languages.

See Also

getMultilingual( )

Syntax

type GeneralInfoLanguages = {
  supportedLanguages: Array<GeneralInfoLanguagesSupported>
  autoRedirect: boolean
}
MEMBERS
?
The properties of an object.
supportedLanguages
List supported languages.
autoRedirect
boolean
Whether to automatically redirect users based on their browser's settings.

Examples

Get site multilingual information

import wixSite from 'wix-site-backend';

export function getMultilingual() {
  return wixSite.generalInfo.getMultilingual();
}

/*
 * {
 *   "supportedLanguages": [
 *     {
 *       "languageCode": "en",
 *       "locale": {
 *         "country":    "US",
 *         "languageCode": "en"
 *       },
 *       "iconUrl":    "someUrl",
 *       "isPrimary":  true
 *     }
 *   ],
 *   "autoRedirect": true
 * }
 */

GeneralInfoLanguagesSupported

An object representing the site's supported languages.

See Also

getMultilingual( )

Syntax

type GeneralInfoLanguagesSupported = {
  languageCode: string
  locale: GeneralInfoLocale
  countryCode: string
  isPrimary: boolean
}
MEMBERS
?
The properties of an object.
languageCode
string
Language code.
locale
Language locale.
countryCode
string
Country Code for the Language icon.
isPrimary
boolean
Whether the language is the primary language.

Examples

Get site multilingual information

import wixSite from 'wix-site-backend';

export function getMultilingual() {
  return wixSite.generalInfo.getMultilingual();
}

/*
 * {
 *   "supportedLanguages": [
 *     {
 *       "languageCode": "en",
 *       "locale": {
 *         "country":    "US",
 *         "languageCode": "en"
 *       },
 *       "iconUrl":    "someUrl",
 *       "isPrimary":  true
 *     }
 *   ],
 *   "autoRedirect": true
 * }
 */

GeneralInfoLocale

An object representing a site's locale.

See Also

getLocale( )

Syntax

type GeneralInfoLocale = {
  country: string
  languageCode: string
}
MEMBERS
?
The properties of an object.
country
string
Site country.
languageCode
string
Site language code.

Examples

Get site locale information

import wixSite from 'wix-site-backend';

export function getLocale() {
  return wixSite.generalInfo.getLocale();
}

/*
 * {
 *   "country":      "US",
 *   "languageCode": "en"
 * }
 */

GeneralInfoSchedule

An object representing business hours.

See Also

getBusinessSchedule( )

Syntax

type GeneralInfoSchedule = {
  periods: Array<GeneralInfoSchedulePeriods>
  specialHourPeriod: Array<GeneralInfoScheduleSpecial>
}

Examples

Get site business hours

import wixSite from 'wix-site-backend';

export function getBusinessSchedule() {
  return wixSite.generalInfo.getBusinessSchedule();
}

/*
 * {
 *   "periods": [
 *     {
 *       "openDay":    "MONDAY",
 *       "openTime":   "08:00",
 *       "closeDay":   "MONDAY",
 *       "closeTime":  "17:00"
 *     },
 *     {
 *       "openDay":    "THURSDAY",
 *       "openTime":   "09:00",
 *       "closeDay":   "THURSDAY",
 *       "closeTime":  "18:00"
 *     }
 *   ],
 *   "specialHourPeriod": [
 *     {
 *       "startDate":  "31-12-2018",
 *       "endDate":    "01-01-2019",
 *       "isClosed":   true,
 *       "comment":    "new year eve"
 *     }
 *   ]
 * }
 */

GeneralInfoSchedulePeriods

An object representing business opened and closed hours.

See Also

getBusinessSchedule( )

Syntax

type GeneralInfoSchedulePeriods = {
  openDay: string
  openTime: string
  closeDay: string
  closeTime: string
}
MEMBERS
?
The properties of an object.
openDay
string
Business opening day.
openTime
string
Business opening time.
closeDay
string
Business closing day.
closeTime
string
Business closing time.

Examples

Get site business hours

import wixSite from 'wix-site-backend';

export function getBusinessSchedule() {
  return wixSite.generalInfo.getBusinessSchedule();
}

/*
 * {
 *   "periods": [
 *     {
 *       "openDay":    "MONDAY",
 *       "openTime":   "08:00",
 *       "closeDay":   "MONDAY",
 *       "closeTime":  "17:00"
 *     },
 *     {
 *       "openDay":    "THURSDAY",
 *       "openTime":   "09:00",
 *       "closeDay":   "THURSDAY",
 *       "closeTime":  "18:00"
 *     }
 *   ],
 *   "specialHourPeriod": [
 *     {
 *       "startDate":  "31-12-2018",
 *       "endDate":    "01-01-2019",
 *       "isClosed":   true,
 *       "comment":    "new year eve"
 *     }
 *   ]
 * }
 */

GeneralInfoScheduleSpecial

An object representing special business hours.

See Also

getBusinessSchedule( )

Syntax

type GeneralInfoScheduleSpecial = {
  startDate: string
  endDate: string
  isClosed: boolean
  comment: string
}
MEMBERS
?
The properties of an object.
startDate
string
Special hours start date.
endDate
string
Special hours end date.
isClosed
boolean
Whether the business is closed.
comment
string
Special hours comment.

Examples

Get site business hours

import wixSite from 'wix-site-backend';

export function getBusinessSchedule() {
  return wixSite.generalInfo.getBusinessSchedule();
}

/*
 * {
 *   "periods": [
 *     {
 *       "openDay":    "MONDAY",
 *       "openTime":   "08:00",
 *       "closeDay":   "MONDAY",
 *       "closeTime":  "17:00"
 *     },
 *     {
 *       "openDay":    "THURSDAY",
 *       "openTime":   "09:00",
 *       "closeDay":   "THURSDAY",
 *       "closeTime":  "18:00"
 *     }
 *   ],
 *   "specialHourPeriod": [
 *     {
 *       "startDate":  "31-12-2018",
 *       "endDate":    "01-01-2019",
 *       "isClosed":   true,
 *       "comment":    "new year eve"
 *     }
 *   ]
 * }
 */