Today we are launching a new feature in Content API for Shopping v2.1: products.update . The products.update
method allows you to submit a subset of changes for a given product using the Products API. It works similarly to products.insert , but only requires the fields you would like to modify. Users of inventory.set in Content API v2, will be familiar with the ability to provide updates to price
, availability
and other limited fields. The products.update
method goes one step further and allows you to modify any fields that are mutable with products.insert
. Users that are migrating from v2 to v2.1 ahead of the September 30, 2021 sunset date, might find this new functionality useful. Products.update utilizes the HTTP PATCH method. Here is an example of updating the salePrice
using REST: HTTP request:
PATCH https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/products/{productId}
Example request body:
{
"salePrice": {
"value": "17.99",
"currency": "USD"
}
}
You can also provide product update operations as part of a products.custombatch request. For more examples and use-cases, see the products.update guide in the documentation. If you require further support using this feature, please visit the Content API for Shopping forum .
Ian Ballantyne, Content API for Shopping Team