> 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 # Package: locations # Webhook link: https://dev.wix.com/docs/api-reference/business-management/locations/location-updated.md ## Introduction # Webhook Permissions Scopes IDs: Manage Locations: SCOPE.DC-MULTILOCATION.MANAGE-LOCATIONS --- ## REST API ### Schema ``` Webhook: Location Updated Description: Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: updatedEvent | type: object | description: Updated event details. - name: currentEntity | type: Location | description: The entity after the update. - name: id | type: string | description: Location GUID. - name: name | type: string | description: Location name. - name: description | type: string | description: Location description. - name: default | type: boolean | description: Whether this is the default location. There can only be one default location per site. The default location can't be archived. - name: status | type: LocationStatus | description: Location status. Defaults to `ACTIVE`. __Notes:__ - [Archiving a location](https://dev.wix.com/api/rest/business-info/locations/archive-location) doesn't affect the location's status. - `INACTIVE` status is currently not supported. - enum: ACTIVE, INACTIVE - name: fax | type: string | description: Fax number. - name: timeZone | type: string | description: Timezone in `America/New_York` format. - name: email | type: string | description: Email address. - name: phone | type: string | description: Phone number. - name: address | type: Address | description: Address. - name: country | type: string | description: 2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. - name: city | type: string | description: City name. - name: postalCode | type: string | description: Postal or zip code. - name: streetAddress | type: StreetAddress | description: Street address. Includes street name, number, and apartment number in separate fields. - name: number | type: string | description: Street number. - name: name | type: string | description: Street name. - name: apt | type: string | description: Apartment number. - name: formattedAddress | type: string | description: Full address of the location. - name: hint | type: string | description: Extra information that helps finding the location. - name: geocode | type: AddressLocation | description: Geographic coordinates of location. - name: latitude | type: number | description: Latitude of the location. Must be between -90 and 90. - name: longitude | type: number | description: Longitude of the location. Must be between -180 and 180. - name: businessSchedule | type: BusinessSchedule | description: Business schedule. Array of weekly recurring time periods when the location is open for business. Limited to 100 time periods. __Note:__ Not supported by Wix Bookings. - name: periods | type: array | description: Weekly recurring time periods when the business is regularly open or the service is available. Limited to 100 time periods. - name: openDay | type: DayOfWeek | description: Day of the week the period starts on. - enum: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY - name: openTime | type: string | description: Time the period starts in 24-hour [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended format. Valid values are `00:00` to `24:00`, where `24:00` represents midnight at the end of the specified day. - name: closeDay | type: DayOfWeek | description: Day of the week the period ends on. - enum: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY - name: closeTime | type: string | description: Time the period ends in 24-hour [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended format. Valid values are `00:00` to `24:00`, where `24:00` represents midnight at the end of the specified day. __Note:__ If `openDay` and `closeDay` specify the same day of the week `closeTime` must be later than `openTime`. - name: specialHourPeriod | type: array | description: Exceptions to the business's regular hours. The business can be open or closed during the exception. - name: startDate | type: string | description: Start date and time of the exception in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format and [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). - name: endDate | type: string | description: End date and time of the exception in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format and [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). - name: isClosed | type: boolean | description: Whether the business is closed (or the service is not available) during the exception. Default: `true`. - name: comment | type: string | description: Additional info about the exception. For example, "We close earlier on New Year's Eve." - name: revision | type: string | description: Revision number, which increments by 1 each time the location is updated. To prevent conflicting changes, the existing revision must be used when updating a location. - name: archived | type: boolean | description: Whether the location is archived. Archived locations can't be updated. __Note:__ [Archiving a location](https://dev.wix.com/api/rest/business-info/locations/archive-location) doesn't affect its `status`. - name: locationTypes | type: array | description: Location types. - enum: UNKNOWN, BRANCH, OFFICES, RECEPTION, HEADQUARTERS, INVENTORY - name: extendedFields | type: ExtendedFields | description: Extended fields for data extensions. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: modifiedFields | type: Map | description: Fields that were updated and their values before the update. ``` --- ## JavaScript SDK ### Schema ``` Webhook: onLocationUpdated Description: Payload: LocationUpdatedEnvelope - name: entity | type: Location | description: none - name: _id | type: string | description: Location GUID. - name: name | type: string | description: Location name. - name: description | type: string | description: Location description. - name: default | type: boolean | description: Whether this is the default location. There can only be one default location per site. The default location can't be archived. - name: status | type: LocationStatus | description: Location status. Defaults to `ACTIVE`. __Notes:__ - [Archiving a location](https://dev.wix.com/api/rest/business-info/locations/archive-location) doesn't affect the location's status. - `INACTIVE` status is currently not supported. - enum: ACTIVE, INACTIVE - name: fax | type: string | description: Fax number. - name: timeZone | type: string | description: Timezone in `America/New_York` format. - name: email | type: string | description: Email address. - name: phone | type: string | description: Phone number. - name: address | type: Address | description: Address. - name: streetAddress | type: StreetAddress | description: none - name: name | type: string | description: none - name: number | type: string | description: none - name: city | type: string | description: none - name: subdivision | type: string | description: none - name: country | type: string | description: none - name: postalCode | type: string | description: none - name: businessSchedule | type: BusinessSchedule | description: Business schedule. Array of weekly recurring time periods when the location is open for business. Limited to 100 time periods. __Note:__ Not supported by Wix Bookings. - name: periods | type: array | description: Weekly recurring time periods when the business is regularly open or the service is available. Limited to 100 time periods. - name: openDay | type: DayOfWeek | description: Day of the week the period starts on. - enum: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY - name: openTime | type: string | description: Time the period starts in 24-hour [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended format. Valid values are `00:00` to `24:00`, where `24:00` represents midnight at the end of the specified day. - name: closeDay | type: DayOfWeek | description: Day of the week the period ends on. - enum: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY - name: closeTime | type: string | description: Time the period ends in 24-hour [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended format. Valid values are `00:00` to `24:00`, where `24:00` represents midnight at the end of the specified day. __Note:__ If `openDay` and `closeDay` specify the same day of the week `closeTime` must be later than `openTime`. - name: specialHourPeriod | type: array | description: Exceptions to the business's regular hours. The business can be open or closed during the exception. - name: startDate | type: string | description: Start date and time of the exception in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format and [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). - name: endDate | type: string | description: End date and time of the exception in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format and [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). - name: isClosed | type: boolean | description: Whether the business is closed (or the service is not available) during the exception. Default: `true`. - name: comment | type: string | description: Additional info about the exception. For example, "We close earlier on New Year's Eve." - name: revision | type: string | description: Revision number, which increments by 1 each time the location is updated. To prevent conflicting changes, the existing revision must be used when updating a location. - name: archived | type: boolean | description: Whether the location is archived. Archived locations can't be updated. __Note:__ [Archiving a location](https://dev.wix.com/api/rest/business-info/locations/archive-location) doesn't affect its `status`. - name: locationTypes | type: array | description: Location types. - enum: UNKNOWN, BRANCH, OFFICES, RECEPTION, HEADQUARTERS, INVENTORY - name: extendedFields | type: ExtendedFields | description: Extended fields for data extensions. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: modifiedFields | type: Map | description: Fields that were updated and their values before the update. - ONE-OF: - name: nullValue | type: | description: - name: numberValue | type: number | description: - name: stringValue | type: string | description: - name: boolValue | type: boolean | description: - name: structValue | type: object | description: - name: listValue | type: ListValue | description: - name: values | type: array | description: - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. ``` ### Examples ```javascript import { locations } from '@wix/business-tools'; locations.onLocationUpdated((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { locations } from '@wix/business-tools'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { locations, }, }); wixClient.locations.onLocationUpdated((event) => { // handle your event here }); ``` ---