In March 2019, we released version 2.1 of the Content API for Shopping, and in April 2021, we announced that v2 would sunset on September 30, 2021. Version v2 has sunset. Please migrate to v2.1 immediately.
Migrate your application
Migrating from v2 to v2.1 involves updating your endpoint URLs to call the new v2.1 versions and modifying your applications to account for breaking changes introduced in v2.1.
Update your API calls to use v2.1 endpoints
To make calls to v2.1, update your requests to use the new v2.1 endpoints.
For example, to call the products.get
method with v2, you would use:
GET https://shoppingcontent.googleapis.com/content/v2/merchantId/products/productId
For v2.1, update the URL to:
GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/products/productId
For complete information on v2.1 services and endpoints, see the API Reference.
Make required changes
In addition to updating the URLs for your API calls, you also need to update your application to account for several breaking changes introduced in v2.1. Review the following sections and update your application, as needed.
1. Update integrations with the inventory
service
The v2 inventory
service has been removed, and equivalent functionality is
available with the following v2.1 features:
Use new Supplemental Feeds or
products.update
for partial product updates. Updates are possible to all mutable product fields, including all fields previously updated withinventory.set
(excluding those exclusive tolocalinventory
). See Migrate to supplemental feeds for more details.Use the new
localinventory
service for local product updates.
2. Update calls to the accounts
service
Calls to the
accounts.update
method in v2.1 completely overwrite theaccounts
resource, instead of only updating the fields included in the request. To avoid deleting fields on theaccounts
resource, update your call requests to include all fields.The
reviewsUrl
has been removed.The link status
inactive
has been removed foradsLinks
,googleMyBusinessLink
, andyoutubeChannelLinks
.
3. Update calls to the products
service
Custom attributes no longer contain a type and unit. Instead, units are to be appended to the value and types should be automatically detected.
The repeated field
productTypes
has replaced bothproductType
andadditionalProductTypes
.The repeated fields
includedDestinations
andexcludedDestinations
have replaced the repeated fielddestinations
.The following AdWords-related fields have been renamed:
adwordsGrouping
->adsGrouping
adwordsLabels
->adsLabels
adwordsRedirect
->adsRedirect
The following fields have been removed:
aspects
destinations
onlineOnly
validatedDestinations
warnings
The
includeInvalidInsertedItems
parameter has been removed. In v2.1, all products are returned by default.There is now a delay of a few minutes before an inserted product can be retrieved via
products.get
orproducts.list
.The returned
offerId
is no longer guaranteed to be the same as the inputofferId
. v2.1 trims leading and trailing whitespace in theofferId
and merges multiple whitespace characters into one. This change does not impactofferId
values that conform to the recommendedofferId
syntax.Prices are now validated before product insertion. Only the following characters are allowed in the value string:
+
,-
,.
, and digits (i.e.,0
-9
). Commas are no longer accepted.Responses from a
products.insert
orproducts.update
call only contain the following attributes:channel
contentLanguage
id
offerId
feedLabel
The v2 option
includeAttributes
is deprecated. Instead, useproducts.get
with theProductId
to view full product information.
4. Update calls to the productstatuses
service
The
product
attribute has been removed, along with theincludeAttributes
parameter. To retrieve attributes of the product corresponding to a status, use theproducts
service and pass the value of the newproductId
field.The
includeInvalidInsertedItems
parameter has been removed. TheproductId
of every product is now returned regardless of whether the product is valid.The
intention
,approvalStatus
, andapprovalPending
fields indestinationStatuses
have been replaced bystatus
, which is a string that can be one ofapproved
,disapproved
, orpending
.dataQualityIssues
has been replaced byitemLevelIssues
.
5. Update calls to the datafeeds
service
The following target fields have been replaced:
contentLanguage
->language
targetCountry
->country
intendedDestinations
->includedDestinations
, andexcludedDestinations
Data feeds with
contentType = "product inventory update"
have been removed.
6. Update calls to the orders
and TestOrders
services
In v2.1, calls should not not include tax data because tax data is calculated automatically. If the order is fulfilled in a state with a Marketplace Fairness Act (MFA) or similar, calls that include tax data fail. If the order is fulfilled in a non-MFA state, tax is calculated based on settings configured in Merchant Center. If not configured, the calculated tax is 0.
The
InStoreRefundLineItem
andReturnRefundLineItem
fieldsamountPretax
andamountTax
have been replaced bypriceAmount
andtaxAmount
, respectively.priceAmount
can be pre-tax or post-tax, depending on the location of the order.The
ShipLineItem
fieldscarrier
,shipmentId
, andtrackingId
in the request have been moved toshipmentInfos
.billingAddress
andpredefinedBillingAddress
are now top-level fields inorders
andTestOrder
, respectively.customer.explicitMarketingPreference
has been replaced bycustomer.marketingRightsInfo
.The
netAmount
field has been split intonetPriceAmount
andnetTaxAmount
.shippingOption
has been replaced bylineItems[].shippingDetails
.The
CancelLineItem
fieldsamount
,amountPretax
, andamountTax
in the request have been removed. The refunded amount is now calculated automatically.CustomBatch
has been removed.Refund
has been removed. UserefundOrder
orrefundItem
instead.The
paymentMethod
field has been removed.The v2 methods
orders.returnlineitem
andorders.refund
are replaced byorderreturns.creatOrderReturn
andorderreturns.process
.The
customer.email
,channelType
, andlineItem.product.channel
fields have been removed.The
promotions
field has been removed from theTestOrder
service and its format changed inOrder
.
7. Update calls to the orderinvoice
service
The
amountPretax
andamountTax
fields have been replaced bypriceAmount
andtaxAmount
, respectively. ThepriceAmount
field can be pre-tax or post-tax, depending on the location of the order.Removed balances (merchant, customer, Google) in
invoiceSummary
and promotion charge related fields.
8. Remove functionality not included in v2.1
Several other features have been removed from the Content API in v2.1. Review the following list and update your application, as needed:
XML is no longer supported. For more information on switching to JSON, see Sunset of XML support in the Content API for Shopping.
The
dryRun
parameter has been removed. This change applies to all API calls.All
HTTP BATCH
methods have been removed. UsecustomBatch
instead.The
patch
method has been removed from the following services:accounts
accounttax
datafeeds
liasettings
shippingsettings
The
orderpayments
service has been removed.
Test your migration
For more information on testing the changes to your applications after migrating to v2.1, see Testing Uses of the Content API for Shopping. If you encounter issues while testing your updates, you can contact us.
Additional changes in v2.1
In addition changes that require updates, v2.1 also introduces several new features and non-breaking changes:
New services:
The new
localinventory
service lets you make local product updates (in place of theinventory
service in v2).The new
orderreturns
service makes it easier to manage Buy on Google (formerly known as Shopping Actions) by letting you process returns without having to use theorders
service.
Supplemental Feeds let you make partial product updates.
Additional changes to the
products
service:products.insert
requests no longer report non-fatal warnings or errors. This lets you insert products and make subsequent updates to resolve issues via feed rules in Merchant Center, just as you would with feeds managed outside the Content API.products.update
has been added to let you make updates to a chosen set of product fields. For more information on possible usage see the guide.Invalid values for the following attributes no longer trigger insertion errors, and returned as part of
itemLevelIssues
by theproductstatus
service:ageGroup
availability
condition
energyEfficiencyClass
gender
maxEnergyEfficiencyClass
minEnergyEfficiencyClass
sizeSystem
sizeType
Custom attributes are now recursive, which removes the need for custom groups.
Custom attributes now have a
groupValues
field in addition to the originalvalue
field. Exactly one of the fields must be set.