Locations
Locations
The Locations resource is the primary way our system stores structured information about a Business location. It is a sub-resource of "Business" and also one or multiple locations can be assigned to a Site.
Location Model
Location object
A location object contains the following fields
Attribute
Type
Description
id
integer
unique id of the location
business_id
integer
Reference id to the Business this location is under
user_id
integer
Reference id to the User that created this business
published
boolean
Should this location show in Store Locators or Location directory modules. Default is true
location_name
string
Name of this location to identify different locations within a single Business
street
string
Street address
street2
string
Apartment or unit number
city
string
City
state
string
State code
country
string
2 character country code
postal_code
string
Postal / zip code
neighborhood
string
Neighborhood
description
string
HTML-formatted business description
partner_location_id
string
Unique ID reference to partner IDs
partner_location_sub_id
string
Non-unique ID reference to partner IDs
google_places_id
string
The Google Place ID for this location. When set can be used for optimized directions links and schema
directions_url
string
Generated URL for Google Maps directions
contact_emails
list
Default contact emails for the business as a list of email address strings. Also used as the default recipients on forms
payment_forms_notes
string
Additional payment forms or notes
price_range
integer
Price range indicated by 1-4
and used to represent $-$$$$
private_street
string
Street address but used for service area businesses. This field will not be displayed by default on maps or within templates
service_area_only
boolean
Toggle to set this location as a "service-area only" business
service_areas
string
Location service areas - neighborhoods, cities, zip codes
tagline
string
Tagline or main headline for the location
year_opened
integer
Year opened
careerplug_url
string
Full url link to their careers page
facebook_url
string
Full url link to their Facebook page
gplus_url
string
Full url link to their Google plus page
homepage_url
string
Full url link to their external website if applicable
instagram_url
string
Full url link to their Instagram profile
linkedin_url
string
Full url link to their LinkedIn profile
pinterest_url
string
Full url link to their Pinterest page
twitter_url
string
Full url link to their Twitter profile
yelp_url
string
Full url link to their Yelp profile
youtube_url
string
Full url link to their Youtube page
added
timestamp
Date and time location was created
modified
timestamp
Date and time location was modified
automatic_latlon
boolean
If true, we will automatically geocode the address and set the lat
and lon
fields
lat
float
Latitude coordinate
lon
float
Longitude coordinate
location_url
string
Full url link to the location page associated with this location. This is used by our Store Locator module
custom_fields
object
Custom field values assigned to the location for use in Location Finders, etc.
Example object:
Phone object (phones
)
phones
)A phone object contains the following fields
Attribute
Type
Description
id
integer
unique id of the phone
location_id
integer
Reference id to the Location this phone is under
type
string
type of the phone - options are phone
secondary
tollfree
fax
number
string
Formatted version of the phone number
extension
string
Extension of the phone
Hours of operation (hours
)
hours
)Except for the special case formatting, this object is a list of 7 items which represent each day.
Each day can can have one-four time ranges. For example, two time ranges denotes a "lunch-break". No time ranges denotes closed.
9am-5pm
[["09:00:00", "17:00:00"]]
9am-12pm and 1pm-5pm
[["09:00:00", "12:00:00"], ["13:00:00", "17:00:00"]]
Closed - send an empty list
[]
Example of set of hours
Special case formatting
24 hours, for every day
Extra Schema.org (extra_schema
)
extra_schema
)Our platform auto-generates location-based JSON-LD
schema.org values for each location. This is embedded into any site that is published on the platform to syndicate these values to web search engines.
The extra_schema
gives that ability to extend or replace the existing auto-generated schema values.
Example of automatic schema values
Example of extending schema for a restaurant
Using values specific to the @type
of Restaurant
.
Payment forms (payment_forms
)
payment_forms
)Predefined list of payment forms supported by this location.
List of all valid payment forms: visa
, mastercard
, american-express
, discover
, diners-club
, debit
, checks
, credit-card
, cash
, vouchers
, bank-deposit
, money-orders
, cashiers-checks
, paypal
, financing-available
, carecredit
, most-insurance-plans
, layaway
, money-transfers
, line-of-credit
, store-card
, google-wallet
, travelers-checks
, invoice
, cheque
, interac
Example of sending payment forms
Note. These are always sent as lowercase.
Services tags (services_tags
)
services_tags
)These are structured tags that can be assigned to a location. These are primarily used for filtering Location Finder results. But these tags can also be used within templates to hide and show content or build a list of applicable services.
These tags should be lowercase and can contain alphanumeric and dashes (-
) characters.
Create a location
POST /api/v2/locations/
Required fields - Normal location
Attribute
business_id
street
city
state
postal_code
country
Required fields - Service area only location
Attribute
business_id
city
state
postal_code
country
List locations
List all locations for all businesses
List all locations for a particular business
Parameters
Name
Type
Description
business_id
string
Filter for locations associated with a particular Business
near_location
string
Location search string to find nearby locations. See Distance Search for more details
partner_business_id
string
Used to lookup/search for locations matching a particular internal id
partner_location_id
string
Used to lookup/search for locations matching a particular internal id
threshold
int
Distance in miles to restrict distance search results. See Distance Search for more details
Distance search
Locations can be searched and ordered by distance from a particular point or searched location (near_location
) string like a postal code or city/state.
If you already have the search location (latitude and longitude), you can pass those directly into the request using near_lat
and near_lon
to speed up the response time and avoid an API call to geocode the search.
Additional values
For these distance searches, we also add additional values to the response with some location and distance context.
In the resulting response meta
we will add the latitude and longitude of the searched point for reference.
In each of the the resulting Location objects, we adddistance
(in miles or km depending on the project configuration).
Update a location
PUT /api/v2/locations/:location_id/
Delete a location
DELETE /api/v2/locations/:location_id/
Last updated