AI-generated Key Takeaways
-
The Merchant API is the new version of the Content API for Shopping and is now in beta.
-
Version 2 of the Content API for Shopping has been sunset; users need to migrate to version 2.1 immediately.
-
Migrating to v2.1 involves updating endpoint URLs and accounting for breaking changes, like the removal of the
inventoryservice and changes to various other services. -
Version 2.1 introduces new features like the
localinventoryandorderreturnsservices, supplemental feeds, and changes to theproductsservice. -
For detailed information on the Merchant API Beta and migration, refer to the provided links.
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.updatefor 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
localinventoryservice for local product updates.
2. Update calls to the accounts service
Calls to the
accounts.updatemethod in v2.1 completely overwrite theaccountsresource, instead of only updating the fields included in the request. To avoid deleting fields on theaccountsresource, update your call requests to include all fields.The
reviewsUrlhas been removed.The link status
inactivehas 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
productTypeshas replaced bothproductTypeandadditionalProductTypes.The repeated fields
includedDestinationsandexcludedDestinationshave replaced the repeated fielddestinations.The following AdWords-related fields have been renamed:
adwordsGrouping->adsGroupingadwordsLabels->adsLabelsadwordsRedirect->adsRedirect
The following fields have been removed:
aspectsdestinationsonlineOnlyvalidatedDestinationswarnings
The
includeInvalidInsertedItemsparameter 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.getorproducts.list.The returned
offerIdis no longer guaranteed to be the same as the inputofferId. v2.1 trims leading and trailing whitespace in theofferIdand merges multiple whitespace characters into one. This change does not impactofferIdvalues that conform to the recommendedofferIdsyntax.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.insertorproducts.updatecall only contain the following attributes:channelcontentLanguageidofferIdfeedLabel
The v2 option
includeAttributesis deprecated. Instead, useproducts.getwith theProductIdto view full product information.
4. Update calls to the productstatuses service
The
productattribute has been removed, along with theincludeAttributesparameter. To retrieve attributes of the product corresponding to a status, use theproductsservice and pass the value of the newproductIdfield.The
includeInvalidInsertedItemsparameter has been removed. TheproductIdof every product is now returned regardless of whether the product is valid.The
intention,approvalStatus, andapprovalPendingfields indestinationStatuseshave been replaced bystatus, which is a string that can be one ofapproved,disapproved, orpending.dataQualityIssueshas been replaced byitemLevelIssues.
5. Update calls to the datafeeds service
The following target fields have been replaced:
contentLanguage->languagetargetCountry->countryintendedDestinations->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
InStoreRefundLineItemandReturnRefundLineItemfieldsamountPretaxandamountTaxhave been replaced bypriceAmountandtaxAmount, respectively.priceAmountcan be pre-tax or post-tax, depending on the location of the order.The
ShipLineItemfieldscarrier,shipmentId, andtrackingIdin the request have been moved toshipmentInfos.billingAddressandpredefinedBillingAddressare now top-level fields inordersandTestOrder, respectively.customer.explicitMarketingPreferencehas been replaced bycustomer.marketingRightsInfo.The
netAmountfield has been split intonetPriceAmountandnetTaxAmount.shippingOptionhas been replaced bylineItems[].shippingDetails.The
CancelLineItemfieldsamount,amountPretax, andamountTaxin the request have been removed. The refunded amount is now calculated automatically.CustomBatchhas been removed.Refundhas been removed. UserefundOrderorrefundIteminstead.The
paymentMethodfield has been removed.The v2 methods
orders.returnlineitemandorders.refundare replaced byorderreturns.creatOrderReturnandorderreturns.process.The
customer.email,channelType, andlineItem.product.channelfields have been removed.The
promotionsfield has been removed from theTestOrderservice and its format changed inOrder.
7. Update calls to the orderinvoice service
The
amountPretaxandamountTaxfields have been replaced bypriceAmountandtaxAmount, respectively. ThepriceAmountfield can be pre-tax or post-tax, depending on the location of the order.Removed balances (merchant, customer, Google) in
invoiceSummaryand 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
dryRunparameter has been removed. This change applies to all API calls.All
HTTP BATCHmethods have been removed. UsecustomBatchinstead.The
patchmethod has been removed from the following services:accountsaccounttaxdatafeedsliasettingsshippingsettings
The
orderpaymentsservice 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
localinventoryservice lets you make local product updates (in place of theinventoryservice in v2).The new
orderreturnsservice makes it easier to manage Buy on Google (formerly known as Shopping Actions) by letting you process returns without having to use theordersservice.
Supplemental Feeds let you make partial product updates.
Additional changes to the
productsservice:products.insertrequests 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.updatehas 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
itemLevelIssuesby theproductstatusservice:ageGroupavailabilityconditionenergyEfficiencyClassgendermaxEnergyEfficiencyClassminEnergyEfficiencyClasssizeSystemsizeType
Custom attributes are now recursive, which removes the need for custom groups.
Custom attributes now have a
groupValuesfield in addition to the originalvaluefield. Exactly one of the fields must be set.