setServiceLocations( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Replaces the list of the locations (SDK | REST) where the business offers the service.

Consequences for customers

Removing a service location may impact existing sessions and their participants. If you remove at least one service location, you must specify removedLocationSessionsAction to indicate what happens to all future sessions scheduled at this location.

  • Keep existing location: If you want to retain future sessions at their originally scheduled location, specify {"removedLocationSessionsAction.action": "KEEP_AT_CURRENT_LOCATION"}. This ensures nothing changes for the customer, but the business must be able to provide access to the removed location in the future.
  • Update location: If you want to update the location for future sessions scheduled at the removed location, specify {"removedLocationSessionsAction.action": "MOVE_TO_LOCATION"} and moveToLocationOptions.newLocation.

You can't mix and match to keep some sessions at the previous location while moving other sessions to an updated location.

Past session details aren't changed, no matter which option you choose for future sessions.

Future sessions scheduled for a location defined by the customer are also not updated.

Specify location details

Depending on whether the new or updated location is a business or custom location, you need to specify different fields.

  • Business location: Specify the relevant location ID (SDK | REST) in locations.business.id.
  • Custom location: Specify the complete address object as locations.custom.address.

Participant notifications

You can specify a participantNotification.message that's immediately send to all customers who had booked at a changed location. Ensure participantNotification.notifyParticipants is set to true to send the message.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings - all permissions
Manage Bookings
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
serviceIdstringRequired

ID of the service.


locationsArray<V2Location>Required

List of locations replacing existing service locations. Omitting an existing location removes it from the service. Specify removedLocationSessionsAction to determine the handling of future sessions scheduled at that location.


optionsSetServiceLocationsOptions
Returns
Return Type:Promise<SetServiceLocationsResponse>
Errors

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

Did this help?