Trying to fetch only disapproved items by hitting Content API.

234 views
Skip to first unread message

Rajneesh Kumar Singh

unread,
May 14, 2024, 9:49:02 AMMay 14
to Google Content API for Shopping
Hello,

I want to get 'disapproved or invalid' items only from merchant account but getting both 'active' and 'disapproved or invalid' items while hitting API.
Into the Diagnostics tab, my Disapproved items are frequently increasing(It may be happening due to price and availability change. Not clear about this!).

Please guide me how to get disapproved items by Content API. 

Shopping API Forum Advisor

unread,
May 14, 2024, 5:41:54 PMMay 14
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hi,

Thank you for reaching out to the Content API support team.

I understand that you would like to retrieve only the disapproved products in your Merchant Center account. From the Content API perspective, you can use the productstatuses.list method to retrieve the list of disapproved products and filter the response for "status": "disapproved" in the destinationStatuses list of the ProductStatus response.

You can send the details via Reply privately to the author option, or through direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tIyCq:ref" (ADR-00234939)

Thanks,
 
Google Logo Content API for Shopping Team


Rajneesh Kumar Singh

unread,
May 15, 2024, 1:22:52 AMMay 15
to Google Content API for Shopping
Thanks for your reply!

I already did that. I tested below API using Postman to get only disapproved items -
API -  https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/products?filter=approvalStatus:disapproved%20AND%20NOT%20priceValid&maxResults=100&key={apiKey}

But still getting both active and disapproved items. Please help me to get disapproved items only.
Also I don't get why my 'Disapproved items' number is increasing frequently. Because of this I need to get only disapproved items so that I can filter according to price and availability then update with current price and availability.

Is it possible to make it real-time, as in If my  'Disapproved items' number increases then update item attributes like price, availability etc.?

and How would I send the details via Reply privately to the author option, or through direct private reply to this email?

Thanks.

Shopping API Forum Advisor

unread,
May 15, 2024, 7:42:17 AMMay 15
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hi,

As mentioned earlier, you can use the productstatuses.list method to retrieve the list of disapproved products. Can you provide us with the complete JSON request and response logs of the method from which you are fetching disapproved items?
 

You can send us a private message by clicking on the 'Reply privately' option.

Rajneesh Kumar Singh

unread,
May 15, 2024, 9:37:06 AMMay 15
to Google Content API for Shopping
Hello,

As you guided that I can use 'productstatuses.list'. I gone through the document and read carefully, I got something useful and thanks you for this help. After reading docs I used below API and fetch product status -
API -  https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/productstatuses/{productId}
and got below part of JSON response - 

"destinationStatuses": [
        {
            "destination": "Shopping",
            "status": "disapproved",
            "disapprovedCountries": [
                "IN"
            ]
        },
        {
            "destination": "SurfacesAcrossGoogle",
            "status": "disapproved",
            "disapprovedCountries": [
                "IN"
            ]
        }
    ],
    "itemLevelIssues": [
        {
            "code": "price_mismatch",
            "servability": "disapproved",
            "resolution": "merchant_action",
            "attributeName": "price",
            "destination": "Shopping",
            "description": "Mismatched value (page crawl) [price]",
            "detail": "Update your product's price in your product data to match the price on your landing page",
            "documentation": "https://support.google.com/merchants/answer/6098334",
            "applicableCountries": [
                "IN"
            ]
        }
    ],
into above JSON, status is disapproved and servability is also disapproved and into my merchant center this item is in disapproved items.
But I also tested another API into postman and that API is - 

https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/productstatuses?filter=Statuse:disapproved&codes=price_mismatch&maxResults=250
and got below part of JSON response along with above JSON response for disapproved items - 
"destinationStatuses": [
                {
                    "destination": "Shopping",
                    "status": "disapproved",
                    "approvedCountries": [
                        "IN"
                    ]
                },
                {
                    "destination": "SurfacesAcrossGoogle",
                    "status": "disapproved",
                    "approvedCountries": [
                        "IN"
                    ]
                }
            ],
            "itemLevelIssues": [
                {
                    "code": "description_short",
                    "servability": "unaffected",
                    "resolution": "merchant_action",
                    "attributeName": "description",
                    "destination": "Shopping",
                    "description": "Text too short [description]",
                    "detail": "Add a more detailed description for your product",
                    "documentation": "https://support.google.com/merchants/answer/6098336",
                    "applicableCountries": [
                        "IN"
                    ]
                },
                {
                    "code": "description_short",
                    "servability": "unaffected",
                    "resolution": "merchant_action",
                    "attributeName": "description",
                    "destination": "SurfacesAcrossGoogle",
                    "description": "Text too short [description]",
                    "detail": "Add a more detailed description for your product",
                    "documentation": "https://support.google.com/merchants/answer/6098336",
                    "applicableCountries": [
                        "IN"
                    ]
                }
            ],

into above JSON, 'status is disapproved' for each fetched items and some of fetched items 'servability is disapproved and unaffected'. Now the 'servability - unaffected' items are showing 'Active' (into Diagnostic - these 'Active' items are showing warnings) into my merchant center and 'servability - disapproved' items are in disapproved items.
But by hitting this API I need only those items which is into 'Disapproved items' so that I can update my items with current values.

Also didn't find the 'Reply privately' option.

Shopping API Forum Advisor

unread,
May 15, 2024, 2:38:47 PMMay 15
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hi,

I understand that the products are showing 'servability - unaffected' in the mentioned JSON response, but now 'servability - unaffected' items are showing as 'Active' in your Merchant Center account. 'Servability - unaffected' appears in the Item-level issues, which means the product is still being shown. For more information, you can refer to this document. To retrieve only disapproved products, filter the JSON response for 'status': 'disapproved' in the destinationStatuses list of the ProductStatus response.

Rajneesh Kumar Singh

unread,
May 18, 2024, 9:12:11 AMMay 18
to Google Content API for Shopping
Hello,

Thanks for the help.
 I got both  unaffected and disapproved items and split both by using 'servability'. I saved both 'unaffected and disapproved' separately.

Thanks again.

I've another concern, is it possible to authenticate programmatically(automatically) before generating access token?
I want that if I run my project, authentication then generating access token done automatically without manually grant permission and then generate token by using 'Code' which I get after granting permission?

Shopping API Forum Advisor

unread,
May 20, 2024, 7:55:15 AMMay 20
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hi,

I would like to inform you that it is not possible to generate access tokens automatically. You can refer to this link on how authentication can be done using the Content API.

Rajneesh Kumar Singh

unread,
May 20, 2024, 8:16:36 AMMay 20
to Google Content API for Shopping
Hello,

It means I've to manually authenticate on browser once. There is no way to authenticate and generate access token programmatically.
So now there is no possibility to create such console application which I want to run and programmatically authenticate then generate access token and update price or availability. 

Shopping API Forum Advisor

unread,
May 20, 2024, 1:38:41 PMMay 20
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hi,

Yes, the authentication process for the API follows the manual process to obtain an access token for the application(such as OAuth 2.0 authorization code flow).

Rajneesh Kumar Singh

unread,
May 22, 2024, 2:29:02 AMMay 22
to Google Content API for Shopping
Thanks you so much for your help.

I've another question about content api. Is this possible for more than ten thousands of items to be updated which consist new price and new availability if I use both separate api for price or availability?

I tried to update with more than thirty thousands of new price items at once by using price update api but less than 1000 of items (sometimes it was less than 100 also) got updated and rest thrown errors. Is there any other way to update items (price or availability or any other items attributes) more than 5K or 10K or 20K or 30K etc. at once?

Thanks.

Shopping API Forum Advisor

unread,
May 22, 2024, 6:15:25 AMMay 22
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hello,

Thank you for getting back to us.

Yes, you can update the products using the Content API but the rate of the API calls depends on the quota available to use the products service for your account. You may refer to this link about quotas and limits in the Content API. If you are not facing the quota issue then, please share the following details to investigate further:
  • MCID.
  • Complete JSON request and response logs.
  • Error screenshots (if any).
  • The user email / service account email used for authenticating the API query.

Rajneesh Kumar Singh

unread,
May 23, 2024, 3:43:57 AMMay 23
to Google Content API for Shopping
Hello,

I'm using below api to update price - 


and updating price of more than 10000 items at once(numbers of items to update differs each day) but  getting errors and updating price around 1000 or 800 or 600 or 700 etc. Below is the error I'm getting each time - 

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task

Also, authenticating manually and then generating access token.

Thanks.

Shopping API Forum Advisor

unread,
May 23, 2024, 9:14:11 AMMay 23
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hi,

I will check with our team regarding your issue and one of my team members will reach out to you once we have an update on this.

Shopping API Forum Advisor

unread,
May 23, 2024, 3:38:24 PMMay 23
to google-content-...@googlegroups.com, rajnees...@bookswagon.in
Hi,

I would recommend that you refer to this guide to filter products by disapproval using the reports service. Also, I would recommend that you use products.custombatch to update the products with 1000 or less items per request. Please note that updating more than 1000 items at once may cause errors.

Hope this helps. If you have any more queries, please feel free to get back to us.

Rajneesh Kumar Singh

unread,
May 31, 2024, 5:08:26 AMMay 31
to Google Content API for Shopping
Thanks for your help!
It really helped me a lot.

I've one another question.

I saw that If I'm updating any items attributes, values are updating successfully and showing updated values and 'Active' on merchant center. 

But after updating attributes values, I downloaded my feed after an hour, to check items updated values, there I found the items attributes values are old values not updated values. Then I randomly checked that items also, which I updated one or two days ago into downloaded file and merchant both, on merchant center there is updated values but into downloaded file there is still old values. Why?

If I'm updating any items attributes values then it must be change into feed also and show updated values on merchant center.
So if the updated values are showing on merchant but not updating into feed then from where the updated values are showing on merchant and where are these updated values stored?

Thanks.

Rajneesh Kumar Singh

unread,
Jun 3, 2024, 2:34:56 AMJun 3
to Google Content API for Shopping
Hello Team,

Please resolve above query!

Shopping API Forum Advisor

unread,
Jun 3, 2024, 2:28:57 PMJun 3
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hi,

Upon reviewing your concern, I understand that you are encountering an issue with the products not displaying the updated values in your account. To assist you better, please provide the following details for further investigation:
  • Screenshots of the issue (if any).
  • Please provide the complete JSON request and response logs of successful updated calls.

Rajneesh Kumar Singh

unread,
Jun 4, 2024, 5:53:23 AMJun 4
to Google Content API for Shopping
Hello,

Below is the request and URL, I'm sending to update price - 
URL - https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/products/{productId}
{
  "price": {
    "value": "321",
    "currency": "INR"
  }
}

Below is the part of JSON of updated attribute response I'm getting after updating any item value - 

{
"kind": "content#product",
    "id": "online:en:-:###",
    "offerId": "###",
    "source": "feed",
...
...
...
"price": {
        "value": "321.00",
        "currency": "INR"
    },
    "customAttributes": [
        {
            "name": "update type",
            "value": "merge"
        }
    ]
}

Below I'm attaching screenshot of downloaded feed file - 

1. I downloaded feed from here and into this file value is still old - 

Screenshot_27.png


2.  I downloaded feed from below also but into this file there is updated value { If here, items value showing updated value then the question is where the updated items are stored and displaying here } -- 


Screenshot_28.png

Thanks.

Rajneesh Kumar Singh

unread,
Jun 4, 2024, 6:39:36 AMJun 4
to Google Content API for Shopping
here is the screenshot of price difference on both feed and merchant below - 

1. Downloaded Feeds (excel) - (Old value)

Screenshot_29.png

2. Merchant - All Products - (New values)

Screenshot_30.png

Shopping API Forum Advisor

unread,
Jun 5, 2024, 3:27:59 PMJun 5
to rajnees...@bookswagon.in, google-content-...@googlegroups.com
Hi,

Based on the screenshot, I understand that you are using the file input method for the Feed in your account. Since you are using a file input method, which is outside of our scope, I would recommend you to reach out to the Merchant Center support team as they are better equipped to address your concerns. You can check this link posted in our public forum for more information.

Rajneesh Kumar Singh

unread,
Jun 7, 2024, 8:30:05 AMJun 7
to Google Content API for Shopping
Hi,

Thanks for your help!

I'll contact  Merchant Center support team.

Thanks again.

Reply all
Reply to author
Forward
0 new messages