Storefront products api not returning some products

We are using storefront API to integrate our store with Rails BE. Some of products are not getting listed in the storefront get products API. There nothing seems wrong with the attributes of the product because I tried to make both products similiar, One is listing while the other is not.

I also tried duplicating the product which was not listing, the new generated duplicate is appearing in the products list but not the actual one. This is strange!

We are not able to identify the root cause of this issue, and it is causing a lot of inconvenience to our business operations.

1 Like

Hi @junaid1112 :waving_hand:

I’d recommend checking whether the product is published to the app with SFAPI access. If it appears to be published but remains inaccessible with SFAPI, please contact us here using an account with permissions to the store/app and share examples for investigation.

{ # Admin API
    product (id: "gid://shopify/Product/123"){
        publishedOnCurrentPublication
    }
}

Hope that helps!

1 Like

Yes, It appears to be visible to current Publication. But it’s still not visible in the products API. Should I try something else?

1 Like

It’s unclear from the screenshot what request is being made. If the product is published (to the app that owns the storefront access token), please use a storefront access token from the same app with the below curl request. Alternatively, please reach out through this link using an account with permissions to the app & shop, and provide the team with examples of the exact request being made including the product ID.

curl -L 'https://SHOP-NAME.myshopify.com/api/2023-04/graphql.json' \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Storefront-Access-Token: {STOREFRONT-ACCESS-TOKEN-FROM-SAME-APP}' \
-d '{"query":"{ product (id: \"gid://shopify/Product/123\"){ title } } " }'