With the Locations API, Wix users can define multiple physical locations for their business. This allows them to set individual opening hours for each location.
The Locations API allows you to:
Learn more about how Wix users can manage their location-specific bookings.
It’s important to note the following points before starting to code:
INACTIVE
location status isn't currently supported.businessSchedule
object.ACTIVE
or INACTIVE
.To use the Locations API, install the @wix/business-tools
package using npm or Yarn:
or
Then import { locations }
from @wix/business-tools
:
This article shares a possible use case for your implementation, as well as an example flow that supports it. You're certainly not limited to this use case, but it can be a helpful jumping off point as you plan your implementation.
You can help Wix users create a new business location, set it as default, and update the opening hours for a location.
Call Create Location.
Set the new location as default by calling Set Default Location.
List all existing locations by calling List Locations.
Note: Make sure to extract the relevant locations’ IDs from the response and save it for future calls.
Update a location's opening hours by calling Update Location.
Note: Currently, it isn't possible to partially update a location. Therefore, you'll need to specify the full location object when making the call.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Adds a location type to the specified location.
ID of the location where the type will be added.
Location type to add.
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.
Archives a location.
Notes:
archived
boolean of a location to true
.status
using this endpoint.default
location can't be archived.
ID of the location to archive.
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.
Creates a location.
Location to create.
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.
Retrieves a location.
ID of the location to retrieve.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Retrieves locations, given the specified filters, sorting, and paging.
Options to use when retrieving a list of locations.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.