Fetching invalid product offers in Content API

The Shopping Content API now supports the retrieval of invalid product offers. This means that offers such as those with an invalid category or a mismatched URL can now be retrieved and reviewed via the API. This will enable you to more easily view invalid product offers and debug API requests. Going forward, invalid product offers that are newly inserted via the API will be available for review in the Diagnostics tab of the Merchant Center.

How should you go about retrieving your invalid offers from the API? You can do this by using a new optional URL parameter that has been added to the products.list method, called includeInvalidInsertedItems. (Yes, it's a long name; we apologize for the extra keystrokes.) If you set this parameter to true, your response will include products that were invalid at the time of insertion. The default value is false, so if you don't include the parameter in your request, you will not have invalid products in your response. This preserves existing behavior, with the exception that if you have invalid product offers from feeds, they will also not be returned in the response. Note that you can still use the 'get' and 'delete' methods to reference product offers directly by ID, even if they are invalid. No additional parameter is needed for those methods.

We are introducing one new error when inserting product offers, called "The item could not be inserted". An invalid offer is inserted only if it does not overwrite an existing valid offer. When there already is an existing valid offer, an additional error is returned, stating "The item could not be inserted". This also means that the product offer will not be available for review from products.list nor in the Diagnostics tab. Product offers are matched based on the full product ID, of the form channel:languageCode:countryCode:offerId.

It's important to remember that the new includeInvalidInsertedItems parameter will only filter between valid and invalid product offers, as determined at insertion time, ignoring whether they were or not later disapproved. This means that it will return invalid product offers inserted both from the API and from feeds. To distinguish between approved and disapproved product offers, use the Productstatuses Service.

To try out this new parameter, add includeInvalidInsertedItems as a query parameter to your products.list request. If you have more questions or feedback, please head on over to our developer forum.