A Store Locator site that will be setup to be hosted under locations.abcbrand.com/
Note: Each instance of our platform is configured with a "directory depth" that is used to specify what the URLs will look like for each of the Sites. In the below example, it is set to 1 which would allow you to publish sites under /example-location-slug/
For each location, we will be creating a location and a location page (site)
1. Create a location
Create a location and also pass the location_url which is used to link to the location page from the store locator.
POST /api/v2/locations/
You will use the returned location.id in the next request
2. Create a location page (site)
Create a location page (site) under the same location_url from above and using the business_id, location_id, and theme_id from previous requests.
POST /api/v2/sites/
Store locator
1. Create the store locator site
We will then publish a Store Locator site under locations.abcbrand.com and we will pass /lp/ as the base_directory which is a special method to support rendering the store locator under the root domain.
POST /api/v2/sites/
The returned site.id will be used in later requests
2. Update the home page to add the default Store Locator module
In step 1, the site that was created has a blank home page. So we will now update the home page to add the store locator. This will also override the default location page (site) content that would normally show for that theme_id
1. Find the current home page
We will grab all the pages under the Site (there should only be one) and use it's page.id to update the content in the next step. The home page will be the one with the path set to / (slash)