Why "xxxx.myshopify.com/admin/api/2023-10/products/count.json" not giving actual product count

Why "xxxx.myshopify.com/admin/api/2023-10/products/count.json" not giving actual product count

Shopify Partner
2 0 1

I am new to Shopify, with referrence of Dev. docs an app developed using .Net Framework and installed it in partner api to get total products count with the client request uri as "xxxx.myshopify.com/admin/api/2023-10/products/count.json".

There is no error on the request but getting always with "count":0 as response, though the store is having many products . Anybody can help me to figure out the code/configuration where I'm doing wrong to get the total products count. 


Here's the C# code to get products count.


var client = new RestClient("https://xxx.myshopify.com/");
var request = new RestRequest("admin/api/2023-10/products/count.json", Method.Get);

request.RequestFormat = DataFormat.Json;
request.AddHeader("X-Shopify-Access-Token", "xxxtoaken");

var response = client.ExecuteAsync<string>(request);

var r = JsonConvert.DeserializeObject<dynamic>(response.Result.Content);

var count = r.count; // here r.count={0} 

Reply 1 (1)

Shopify Partner
676 126 135

Hi @ds_ 
Can you share the store URL.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required