A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Our app informations:
Shopify handle: product-filter-search
Shopify api key: d4172f8181a20b56ade67cc448fac594
We are using API: /admin/api/2021-07/collections/{collection_id}/products.json to get all products of the custom collection. Specifically for store: ca.lxrco.com, custom collection: https://ca.lxrco.com/collections/shop-sale-preloved-bags.json It has 869 products in this collection, but our app using this API got only 408 products.
We are debugged for this API with a limit per page are 250 and see it only works for 2 pages: page 1 has 250 products, and page 2 has 158 products. In the response header for page 2, the field link does not have field next, which means no page info for the next, API returning 408 products, x-request-id:"192ef857-aa99-415e-bc83-67cff7094d39"
Thank in advance.
Hey @issactran - thanks for getting in touch. I can't say why this happened, but I was able to look up the request you had made using the request ID and it doesn't appear that there was an error with the API.
Our recommendation would be to confirm that the collection ID number you're calling through the API is correct as it could potentially be that a different collection was returned rather than the expected one. Another possibility is that the merchant updated the collection recently and changed the amount of products in the collection. We're unable to access merchant data without approval from the merchant on our end (and they must contact us through our merchant support channels), so I can't confirm this, but if you are able to touch base to confirm the amount of products with your merchant and it still seems off, we can definitely take a further look into this with you.
Hope this helps with some next steps - best!
Alan | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi,
I work at the merchant in question here. How can i confirm this?
I chatted with support, spent an hour trying to explain the problem, and at the end the agent said we should take the conversation to email and he would loop in the app devs as well.
This was before noon. It's almost midnight here and I havent heard back.
So, how can we proceed so that someone helps us fix the issue at hand. What can i provide here?
Thanks,
Pablo / LXR
Hello @Alan, We spent a lot of time figuring out this error before deciding to send a support request to Shopify, I can confirm the correct collection id is 284579070146, Shopify API returned data incorrectly. For example product with id is 6982740803778 belongs to collection 284579070146, but when using API /admin/api/2021-07/collections/{collection_id}/products.json to get all products of this collection it doesn't return the product id 6982740803778. Can you help us check why and confirm total 408 products of collection 284579070146 returned from API is true or false?
Products count of the collection got from store front 869
Products counts of the collection got from Shopify API is 408 Thank you
To further elaborate, we switched the Sale collection because of an upcoming promo, AND created a copy collection for testing purposes.
https://ca.lxrco.com/collections/shop-sale-preloved-bags
https://ca.lxrco.com/collections/fake-sale
JSON response for both files says 376 items. Also if i go to Products > Inventory > Export the products using the tag used on those collections, I also get 376 products.
Yet when i look at them online, one is showing 274 products, the other one around 290 products.
So again, something is messing up the numbers, and we can't continue having collections not show the real number of products they have.
@Alan It seems that this error has been updated by Shopify, the current results are the same when viewing the number of products of a collection directly from the store and from the Shopify API.
We believe the data has been returned incorrectly before, please investigate it. We need answers for the customer, feel free to let me know what I can provide or help. Many thanks
Data view at the store:
Data return from Shopify API:
Alan | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thank you, @Alan
I have submitted an issue report according to the link you provided