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
Example object:
Phone object (phones
)
phones
)A phone object contains the following fields
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
Required fields - Service area only location
List locations
List all locations for all businesses
List all locations for a particular business
Parameters
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