- Resource: Location
- JSON representation
- PhoneNumbers
- Categories
- Category
- ServiceType
- MoreHoursType
- PostalAddress
- BusinessHours
- TimePeriod
- DayOfWeek
- TimeOfDay
- SpecialHours
- SpecialHourPeriod
- Date
- ServiceAreaBusiness
- BusinessType
- Places
- PlaceInfo
- AdWordsLocationExtensions
- LatLng
- OpenInfo
- OpenForBusiness
- Metadata
- Profile
- RelationshipData
- RelevantLocation
- RelationType
- MoreHours
- ServiceItem
- StructuredServiceItem
- FreeFormServiceItem
- Label
- Money
- Methods
Resource: Location
A location. See the help center article for a detailed description of these fields, or the category endpoint for a list of valid business categories.
JSON representation |
---|
{ "name": string, "languageCode": string, "storeCode": string, "title": string, "phoneNumbers": { object ( |
Fields | |
---|---|
name |
Google identifier for this location in the form: |
languageCode |
Immutable. The language of the location. Set during creation and not updateable. |
storeCode |
Optional. External identifier for this location, which must be unique within a given account. This is a means of associating the location with your own records. |
title |
Required. Location name should reflect your business's real-world name, as used consistently on your storefront, website, and stationery, and as known to customers. Any additional information, when relevant, can be included in other fields of the resource (for example, |
phoneNumbers |
Optional. The different phone numbers that customers can use to get in touch with the business. |
categories |
Optional. The different categories that describe the business. |
storefrontAddress |
Optional. A precise, accurate address to describe your business location. PO boxes or mailboxes located at remote locations are not acceptable. At this time, you can specify a maximum of five |
websiteUri |
Optional. A URL for this business. If possible, use a URL that represents this individual business location instead of a generic website/URL that represents all locations, or the brand. |
regularHours |
Optional. Operating hours for the business. |
specialHours |
Optional. Special hours for the business. This typically includes holiday hours, and other times outside of regular operating hours. These override regular business hours. This field cannot be set without regular hours. |
serviceArea |
Optional. Service area businesses provide their service at the customer's location. If this business is a service area business, this field describes the area(s) serviced by the business. |
labels[] |
Optional. A collection of free-form strings to allow you to tag your business. These labels are NOT user facing; only you can see them. Must be between 1-255 characters per label. |
adWordsLocationExtensions |
Optional. Additional information that is surfaced in AdWords. |
latlng |
Optional. User-provided latitude and longitude. When creating a location, this field is ignored if the provided address geocodes successfully. This field is only returned on get requests if the user-provided |
openInfo |
Optional. A flag that indicates whether the location is currently open for business. |
metadata |
Output only. Additional non-user-editable information. |
profile |
Optional. Describes your business in your own voice and shares with users the unique story of your business and offerings. This field is required for all categories except lodging categories (e.g. hotels, motels, inns). |
relationshipData |
Optional. All locations and chain related to this one. |
moreHours[] |
Optional. More hours for a business's different departments or specific customers. |
serviceItems[] |
Optional. List of services supported by merchants. A service can be haircut, install water heater, etc. Duplicated service items will be removed automatically. |
PhoneNumbers
A collection of phone numbers for the business. During updates, both fields must be set. Clients may not update just the primary or additional phone numbers using the update mask. International phone format is preferred, such as "+1 415 555 0132", see more in (https://developers.google.com/style/phone-numbers#international-phone-numbers).
JSON representation |
---|
{ "primaryPhone": string, "additionalPhones": [ string ] } |
Fields | |
---|---|
primaryPhone |
Required. A phone number that connects to your individual business location as directly as possible. Use a local phone number instead of a central, call center helpline number whenever possible. |
additionalPhones[] |
Optional. Up to two phone numbers (mobile or landline, no fax) at which your business can be called, in addition to your primary phone number. |
Categories
A collection of categories that describes the business. During updates, both fields must be set. Clients are prohibited from individually updating the primary or additional categories using the update mask.
JSON representation |
---|
{ "primaryCategory": { object ( |
Fields | |
---|---|
primaryCategory |
Required. Category that best describes the core business this location engages in. |
additionalCategories[] |
Optional. Additional categories to describe your business. Categories help your customers find accurate, specific results for services they're interested in. To keep your business information accurate and live, make sure that you use as few categories as possible to describe your overall core business. Choose categories that are as specific as possible, but representative of your main business. |
Category
A category describing what this business is (not what it does). For a list of valid category IDs, and the mappings to their human-readable names, see categories.list
.
JSON representation |
---|
{ "name": string, "displayName": string, "serviceTypes": [ { object ( |
Fields | |
---|---|
name |
Required. A stable ID (provided by Google) for this category. The value must be specified when modifying the category (when creating or updating a location). |
displayName |
Output only. The human-readable name of the category. This is set when reading the location. When modifying the location, |
serviceTypes[] |
Output only. A list of all the service types that are available for this business category. |
moreHoursTypes[] |
Output only. More hours types that are available for this business category. |
ServiceType
A message describing a service type that the business offers.
JSON representation |
---|
{ "serviceTypeId": string, "displayName": string } |
Fields | |
---|---|
serviceTypeId |
Output only. A stable ID (provided by Google) for this service type. |
displayName |
Output only. The human-readable display name for the service type. |
MoreHoursType
More hours types that a business can offers, in addition to its regular hours.
JSON representation |
---|
{ "hoursTypeId": string, "displayName": string, "localizedDisplayName": string } |
Fields | |
---|---|
hoursTypeId |
Output only. A stable ID provided by Google for this hours type. |
displayName |
Output only. The human-readable English display name for the hours type. |
localizedDisplayName |
Output only. The human-readable localized display name for the hours type. |
PostalAddress
Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains).
In typical usage an address would be created via user input or from importing existing data, depending on the type of process.
Advice on address input / editing: - Use an internationalization-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used.
For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478
JSON representation |
---|
{ "revision": integer, "regionCode": string, "languageCode": string, "postalCode": string, "sortingCode": string, "administrativeArea": string, "locality": string, "sublocality": string, "addressLines": [ string ], "recipients": [ string ], "organization": string } |
Fields | |
---|---|
revision |
The schema revision of the All new revisions must be backward compatible with old revisions. |
regionCode |
Required. CLDR region code of the country/region of the address. This is never inferred and it is up to the user to ensure the value is correct. See https://cldr.unicode.org/ and https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for Switzerland. |
languageCode |
Optional. BCP-47 language code of the contents of this address (if known). This is often the UI language of the input form or is expected to match one of the languages used in the address' country/region, or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to the correctness of the data and will never affect any validation or other non-formatting related operations. If this value is not known, it should be omitted (rather than specifying a possibly incorrect default). Examples: "zh-Hant", "ja", "ja-Latn", "en". |
postalCode |
Optional. Postal code of the address. Not all countries use or require postal codes to be present, but where they are used, they may trigger additional validation with other parts of the address (e.g. state/zip validation in the U.S.A.). |
sortingCode |
Optional. Additional, country-specific, sorting code. This is not used in most regions. Where it is used, the value is either a string like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number alone, representing the "sector code" (Jamaica), "delivery area indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). |
administrativeArea |
Optional. Highest administrative subdivision which is used for postal addresses of a country or region. For example, this can be a state, a province, an oblast, or a prefecture. Specifically, for Spain this is the province and not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many countries don't use an administrative area in postal addresses. E.g. in Switzerland this should be left unpopulated. |
locality |
Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do not fit into this structure well, leave locality empty and use addressLines. |
sublocality |
Optional. Sublocality of the address. For example, this can be neighborhoods, boroughs, districts. |
addressLines[] |
Unstructured address lines describing the lower levels of an address. Because values in addressLines do not have type information and may sometimes contain multiple values in a single field (e.g. "Austin, TX"), it is important that the line order is clear. The order of address lines should be "envelope order" for the country/region of the address. In places where this can vary (e.g. Japan), address_language is used to make it explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for small-to-large). This way, the most specific line of an address can be selected based on the language. The minimum permitted structural representation of an address consists of a regionCode with all remaining information placed in the addressLines. It would be possible to format such an address very approximately without geocoding, but no semantic reasoning could be made about any of the address components until it was at least partially resolved. Creating an address only containing a regionCode and addressLines, and then geocoding is the recommended way to handle completely unstructured addresses (as opposed to guessing which parts of the address should be localities or administrative areas). |
recipients[] |
Optional. The recipient at the address. This field may, under certain circumstances, contain multiline information. For example, it might contain "care of" information. |
organization |
Optional. The name of the organization at the address. |
BusinessHours
Represents the time periods that this location is open for business. Holds a collection of [TimePeriod][google.mybusiness.mybusinessinformation.v1.TimePeriod] instances.
JSON representation |
---|
{
"periods": [
{
object ( |
Fields | |
---|---|
periods[] |
Required. A collection of times that this location is open for business. Each period represents a range of hours when the location is open during the week. |
TimePeriod
Represents a span of time that the business is open, starting on the specified open day/time and closing on the specified close day/time. The closing time must occur after the opening time, for example later in the same day, or on a subsequent day.
JSON representation |
---|
{ "openDay": enum ( |
Fields | |
---|---|
openDay |
Required. Indicates the |
openTime |
Required. Valid values are 00:00-24:00, where 24:00 represents midnight at the end of the specified day field. |
closeDay |
Required. Indicates the |
closeTime |
Required. Valid values are 00:00-24:00, where 24:00 represents midnight at the end of the specified day field. |
DayOfWeek
Represents a day of the week.
Enums | |
---|---|
DAY_OF_WEEK_UNSPECIFIED |
The day of the week is unspecified. |
MONDAY |
Monday |
TUESDAY |
Tuesday |
WEDNESDAY |
Wednesday |
THURSDAY |
Thursday |
FRIDAY |
Friday |
SATURDAY |
Saturday |
SUNDAY |
Sunday |
TimeOfDay
Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date
and google.protobuf.Timestamp
.
JSON representation |
---|
{ "hours": integer, "minutes": integer, "seconds": integer, "nanos": integer } |
Fields | |
---|---|
hours |
Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time. |
minutes |
Minutes of hour of day. Must be from 0 to 59. |
seconds |
Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds. |
nanos |
Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. |
SpecialHours
Represents a set of time periods when a location's operational hours differ from its normal business hours.
JSON representation |
---|
{
"specialHourPeriods": [
{
object ( |
Fields | |
---|---|
specialHourPeriods[] |
Required. A list of exceptions to the business's regular hours. |
SpecialHourPeriod
Represents a single time period when a location's operational hours differ from its normal business hours. A special hour period must represent a range of less than 24 hours. The openTime
and startDate
must predate the closeTime
and endDate
. The closeTime
and endDate
can extend to 11:59 a.m. on the day after the specified startDate
. For example, the following inputs are valid:
startDate=2015-11-23, openTime=08:00, closeTime=18:00
startDate=2015-11-23, endDate=2015-11-23, openTime=08:00,
closeTime=18:00 startDate=2015-11-23, endDate=2015-11-24,
openTime=13:00, closeTime=11:59
The following inputs are not valid:
startDate=2015-11-23, openTime=13:00, closeTime=11:59
startDate=2015-11-23, endDate=2015-11-24, openTime=13:00,
closeTime=12:00 startDate=2015-11-23, endDate=2015-11-25,
openTime=08:00, closeTime=18:00
JSON representation |
---|
{ "startDate": { object ( |
Fields | |
---|---|
startDate |
Required. The calendar date this special hour period starts on. |
openTime |
Optional. Valid values are 00:00-24:00 where 24:00 represents midnight at the end of the specified day field. Must be specified if |
endDate |
Optional. The calendar date this special hour period ends on. If |
closeTime |
Optional. Valid values are 00:00-24:00, where 24:00 represents midnight at the end of the specified day field. Must be specified if |
closed |
Optional. If true, |
Date
Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:
- A full date, with non-zero year, month, and day values.
- A month and day, with a zero year (for example, an anniversary).
- A year on its own, with a zero month and a zero day.
- A year and month, with a zero day (for example, a credit card expiration date).
Related types:
google.type.TimeOfDay
google.type.DateTime
google.protobuf.Timestamp
JSON representation |
---|
{ "year": integer, "month": integer, "day": integer } |
Fields | |
---|---|
year |
Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. |
month |
Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. |
day |
Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. |
ServiceAreaBusiness
Service area businesses provide their service at the customer's location (for example, a locksmith or plumber).
JSON representation |
---|
{ "businessType": enum ( |
Fields | |
---|---|
businessType |
Required. Indicates the [type] [google.mybusiness.businessinfo.v1.ServiceAreaBusiness.BusinessType] of the service area business. |
places |
The area that this business serves defined through a set of places. |
regionCode |
Immutable. CLDR region code of the country/region that this service area business is based in. See http://cldr.unicode.org/ and http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for Switzerland. This field is required for CUSTOMER_LOCATION_ONLY businesses, and is ignored otherwise. The region specified here can be different from regions for the areas that this business serves (e.g. service area businesses that provide services in regions other than the one that they are based in). If this location requires verification after creation, the address provided for verification purposes must be located within this region, and the business owner or their authorized representative must be able to receive postal mail at the provided verification address. |
BusinessType
Indicates whether this business only offers services onsite at a customer location (for example, a tow truck), or at both an address and onsite (for example, a pizza store with a dining area, that also delivers to customers).
Enums | |
---|---|
BUSINESS_TYPE_UNSPECIFIED |
Output only. Not specified. |
CUSTOMER_LOCATION_ONLY |
Offers service only in the surrounding area (not at the business address). If a business is being updated from a CUSTOMER_AND_BUSINESS_LOCATION to a CUSTOMER_LOCATION_ONLY, the location update must include field mask storefrontAddress and set the field to empty. |
CUSTOMER_AND_BUSINESS_LOCATION |
Offers service at the business address and the surrounding area. |
Places
Defines the union of areas represented by a set of places.
JSON representation |
---|
{
"placeInfos": [
{
object ( |
Fields | |
---|---|
placeInfos[] |
The areas represented by place IDs. Limited to a maximum of 20 places. |
PlaceInfo
Defines an area that's represented by a place ID.
JSON representation |
---|
{ "placeName": string, "placeId": string } |
Fields | |
---|---|
placeName |
Required. The localized name of the place. For example, |
placeId |
Required. The ID of the place. Must correspond to a region. (https://developers.google.com/places/web-service/supported_types#table3) |
AdWordsLocationExtensions
Additional information that is surfaced in AdWords.
JSON representation |
---|
{ "adPhone": string } |
Fields | |
---|---|
adPhone |
Required. An alternate phone number to display on AdWords location extensions instead of the location's primary phone number. |
LatLng
An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.
JSON representation |
---|
{ "latitude": number, "longitude": number } |
Fields | |
---|---|
latitude |
The latitude in degrees. It must be in the range [-90.0, +90.0]. |
longitude |
The longitude in degrees. It must be in the range [-180.0, +180.0]. |
OpenInfo
Information related to the opening state of the business.
JSON representation |
---|
{ "status": enum ( |
Fields | |
---|---|
status |
Required. Indicates whether or not the Location is currently open for business. All locations are open by default, unless updated to be closed. |
canReopen |
Output only. Indicates whether this business is eligible for re-open. |
openingDate |
Optional. The date on which the location first opened. If the exact day is not known, month and year only can be provided. The date must be in the past or be no more than one year in the future. |
OpenForBusiness
Indicates the status of a location.
Enums | |
---|---|
OPEN_FOR_BUSINESS_UNSPECIFIED |
Not specified. |
OPEN |
Indicates that the location is open. |
CLOSED_PERMANENTLY |
Indicates that the location has been permanently closed. |
CLOSED_TEMPORARILY |
Indicates that the location has been temporarily closed. |
Metadata
Additional non-user-editable information about the location.
JSON representation |
---|
{ "hasGoogleUpdated": boolean, "hasPendingEdits": boolean, "canDelete": boolean, "canOperateLocalPost": boolean, "canModifyServiceList": boolean, "canHaveFoodMenus": boolean, "canOperateHealthData": boolean, "canOperateLodgingData": boolean, "placeId": string, "duplicateLocation": string, "mapsUri": string, "newReviewUri": string, "canHaveBusinessCalls": boolean, "hasVoiceOfMerchant": boolean } |
Fields | |
---|---|
hasGoogleUpdated |
Output only. Indicates whether the place ID associated with this location has updates that need to be updated or rejected by the client. If this boolean is set, you should call the |
hasPendingEdits |
Output only. Indicates whether any of this Location's properties are in the edit pending state. |
canDelete |
Output only. Indicates whether the location can be deleted using the API. |
canOperateLocalPost |
Output only. Indicates if the listing can manage local posts. |
canModifyServiceList |
Output only. Indicates if the listing can modify the service list. |
canHaveFoodMenus |
Output only. Indicates if the listing is eligible for food menu. |
canOperateHealthData |
Output only. Indicates whether the location can operate on Health data. |
canOperateLodgingData |
Output only. Indicates whether the location can operate on Lodging data. |
placeId |
Output only. If this locationappears on Google Maps, this field is populated with the place ID for the location. This ID can be used in various Places APIs. This field can be set during Create calls, but not for Update. |
duplicateLocation |
Output only. The location resource that this location duplicates. |
mapsUri |
Output only. A link to the location on Maps. |
newReviewUri |
Output only. A link to the page on Google Search where a customer can leave a review for the location. |
canHaveBusinessCalls |
Output only. Indicates if the listing is eligible for business calls. |
hasVoiceOfMerchant |
Output only. Indicates if the listing has Voice of Merchant. If this boolean is false, you should call the locations.getVoiceOfMerchantState API to get details as to why they do not have Voice of Merchant. |
Profile
All information pertaining to the location's profile.
JSON representation |
---|
{ "description": string } |
Fields | |
---|---|
description |
Required. Description of the location in your own voice, not editable by anyone else. |
RelationshipData
Information of all parent and children locations related to this one.
JSON representation |
---|
{ "parentLocation": { object ( |
Fields | |
---|---|
parentLocation |
The parent location that this location has relations with. |
childrenLocations[] |
The list of children locations that this location has relations with. |
parentChain |
The resource name of the Chain that this location is member of. [How to find Chain ID] [Locations.SearchChains] |
RelevantLocation
Information about another location that is related to current one. The relation can be any one of DEPARTMENT_OF or INDEPENDENT_ESTABLISHMENT_OF, and the location specified here can be on either side (parent/child) of the location.
JSON representation |
---|
{
"placeId": string,
"relationType": enum ( |
Fields | |
---|---|
placeId |
Required. Specify the location that is on the other side of the relation by its placeID. |
relationType |
Required. The type of the relationship. |
RelationType
The type relations to be specified.
Enums | |
---|---|
RELATION_TYPE_UNSPECIFIED |
Type unspecified. |
DEPARTMENT_OF |
This represents a relation between 2 locations which share one physical area, same brand/upper management/organization, but with different key attributes like store hours or phone numbers. For example, Costco Pharmacy is a department in Costco Wholesale. |
INDEPENDENT_ESTABLISHMENT_IN |
This represents the cases where 2 locations are co-located in the same physical location, but from different companies (e.g. Starbucks in a Safeway, shops in a mall). |
MoreHours
The time periods during which a location is open for certain types of business.
JSON representation |
---|
{
"hoursTypeId": string,
"periods": [
{
object ( |
Fields | |
---|---|
hoursTypeId |
Required. Type of hours. Clients should call {#link businessCategories:BatchGet} to get supported hours types for categories of their locations. |
periods[] |
Required. A collection of times that this location is open. Each period represents a range of hours when the location is open during the week. |
ServiceItem
A message that describes a single service item. It is used to describe the type of service that the merchant provides. For example, haircut can be a service.
JSON representation |
---|
{ "price": { object ( |
Fields | |
---|---|
price |
Optional. Represents the monetary price of the service item. We recommend that currencyCode and units should be set when including a price. This will be treated as a fixed price for the service item. |
Union field service_item_info . One of the following fields should always be set. service_item_info can be only one of the following: |
|
structuredServiceItem |
Optional. This field will be set case of structured services data. |
freeFormServiceItem |
Optional. This field will be set case of free-form services data. |
StructuredServiceItem
Represents a structured service offered by the merchant. For eg: toilet_installation.
JSON representation |
---|
{ "serviceTypeId": string, "description": string } |
Fields | |
---|---|
serviceTypeId |
Required. The |
description |
Optional. Description of structured service item. The character limit is 300. |
FreeFormServiceItem
Represents a free-form service offered by the merchant. These are services that are not exposed as part of our structure service data. The merchant manually enters the names for of such services via a geomerchant surface.
JSON representation |
---|
{
"category": string,
"label": {
object ( |
Fields | |
---|---|
category |
Required. This field represents the category name (i.e. the category's stable ID). The |
label |
Required. Language-tagged labels for the item. We recommend that item names be 140 characters or less, and descriptions 250 characters or less. This field should only be set if the input is a custom service item. Standardized service types should be updated via serviceTypeId. |
Label
Label to be used when displaying the price list, section, or item.
JSON representation |
---|
{ "displayName": string, "description": string, "languageCode": string } |
Fields | |
---|---|
displayName |
Required. Display name for the price list, section, or item. |
description |
Optional. Description of the price list, section, or item. |
languageCode |
Optional. The BCP-47 language code that these strings apply for. Only one set of labels may be set per language. |
Money
Represents an amount of money with its currency type.
JSON representation |
---|
{ "currencyCode": string, "units": string, "nanos": integer } |
Fields | |
---|---|
currencyCode |
The three-letter currency code defined in ISO 4217. |
units |
The whole units of the amount. For example if |
nanos |
Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If |
Methods |
|
---|---|
|
Creates a new Location that will be owned by the logged in user. |
|
Lists the locations for the specified account. |