Google Local Shopping enables users to find products in their neighborhood stores. Thus, potential customers can learn about the nearby store locations, prices, and availability of the products they wish to buy.
The Product Inventory feed in the Content API supports partial updates to the local product data. This enables merchants to modify key product attributes such as price, and availability for each of their stores through the Merchant Center account. This product information may also surface on various other online products of Google, such as: generic search, AdWords, and commerce search.
Important: To use this feed, your Merchant Center account must be whitelisted. Contact the Google Account Team to whitelist your account.
Updating an individual item
To update an individual item in a store, follow these steps:
- Create an HTTP
PUTrequest having the mandatory and optional product attributes. Here’s an item request example:
- Send the above request to its unique URL, having the store code (created in Google Places) and item number. For example, to update the item number SKU 4711 for store code 67890, belonging to merchant ID 12345, the request can be sent to:
<?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:scp="http://schemas.google.com/structuredcontent/2009/products"> <scp:price unit="USD">250.00</scp:price> <scp:quantity>1000</scp:quantity> <scp:sale_price unit="USD">199.90</scp:sale_price> <scp:sale_price_effective_date>2012-01-09 2012-01-13</scp:sale_price_effective_date> <scp:availability>in stock</scp:availability> </entry>
Note 1: In the above request, "channel" should always be set to "local," as this feed is only for local product updates. The remaining 3 values in the end-point is the language of the product data, target country, and item code.
Note 2: The request response contains the confirmation input, updated timestamp, as well as edit and self links. The data update happens almost in real time. In case of an entry error, the current inventory data remains unchanged.
Updating multiple items
The steps to update multiple items are similar to the steps for updating a single item:
- Create an HTTP
POSTrequest having the local information of multiple items. In this case, each entry’s
(whose value is the URL as created in step 2 above) has to be within this request. Here’s an example batch request:
Here’s an item request example:
- Send the above request to its unique batch URL:
<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:batch="http://schemas.google.com/gdata/batch"> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:scp="http://schemas.google.com/structuredcontent/2009/products"> <batch:operation type="update"/> <id>http://content.googleapis.com/content/v1/12345/inventory/67890/items/local%3Aen%3AUS%3A4711</id> <scp:price unit="USD">350.50</scp:price> <scp:quantity>998</scp:quantity> </entry> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:scp="http://schemas.google.com/structuredcontent/2009/products"> <batch:operation type="update"/> <id>http://content.googleapis.com/content/v1/12345/inventory/67890/items/local%3Aen%3AUS%3A4712</id> <scp:price unit="USD">210.90</scp:price> <scp:quantity>614</scp:quantity> </entry> </feed>
Note 1: Batch requests (having multiple items across stores) can be up to 1 MB. The data attributes for individual and batch requests are the same.
Note 2: To improve the back-end response time, it is recommended to update few product data across many stores, rather than multiple products in a single store.
The following table explains the various data elements in the feed:
|Element||Type||Accepted Values||Example||Error Code|
||integer||Equal to or greater than zero||
||integer||Greater than zero||
||integer||Greater than zero (mandatory if
||date range (pair of ISO 8601 dates separated by a space, comma, or slash)||Valid date range (start and end dates; if end date is undecided,
then enter a
||string||in stock; out of stock; limited availability; on display to order||
Supported Time Format
DateRange = DateTime Separator DateTime. Separator = " " | "," | "/". DateTime = ISODateTime | "null". ISODateTime = Date [ "T" [ Time ] [ TimeZone ] ]. Date = yyyy "-" MM "-" dd. Time = hh ":" mm [ ":" ss ]. TimeZone = Offset | "Z". Offset = ( "+" | "-" ) hh [ ":" mm ].
Note 1: Time and TimeZone values are optional. Mixing time zones for the start and end date or time is not allowed. If no TimeZone is specified, then the respective local store’s time zone is used.
Note 2: The value of either the range start or end can
null in a scenario where the sale has already commenced or the
sale end date has not been determined as yet, respectively. However, you
null for both range start and range end.
Nonetheless, you can specify a blank
in which case the
sale_price will be effective infinitely.
Note 3: If an entry does not contain an element, the
corresponding product data is not modified. Further, to delete any product
data, specify an element with a blank value (for example,
The exception to this rule is the
price attribute that cannot
have a blank value, if specified.
Following are the example values for the time format:
2012-01-09 2012-01-13 2012-01-09,2012-01-09 2012-01-09T09:00/2012-01-13 2012-01-09T-08 2012-01-13T-08 null 2012-01-13 2012-01-09T-08:00 null 2012-01-09T09:00,2012-01-13T20:00 2012-01-09T09:00Z/2012-01-13T20:00Z