Focusing on managing products, variants, and collections through the API.
Repost since the first time I asked it yielded no valuable results.
I'm making a call to:
https://[my shopify url]/admin/api/2023-07/product_listings.json
But the response comes back with:
{ "errors": "Not Found" }
I am trying to maintain a list of sales channels each of the products in our Shopify store are in. What is the best approach? Which API endpoint should I hit to either:
Permissions are not the issue here. I've temporarily given the API key full permissions.
I'd prefer to keep it simple and use the REST API's instead of giving myself a brain aneurysm struggling with the GraphQL APIs.
Solved! Go to the solution
This is an accepted solution.
Hey @Pegarm
I think that endpoint will only show products published to your app, not every sales channel.
Sorry to say I think you'll need to use the GraphQL API 😅 here's an example query:
query {
publications(first:10) {
nodes {
id
name
products(first:10) {
nodes {
id
title
}
}
}
}
}
Pagination will be the tricky piece - here's a refresher. Let me know if you get stuck.
Scott | Developer Advocate @ Shopify
This is an accepted solution.
Hey @Pegarm
I think that endpoint will only show products published to your app, not every sales channel.
Sorry to say I think you'll need to use the GraphQL API 😅 here's an example query:
query {
publications(first:10) {
nodes {
id
name
products(first:10) {
nodes {
id
title
}
}
}
}
}
Pagination will be the tricky piece - here's a refresher. Let me know if you get stuck.
Scott | Developer Advocate @ Shopify
So there's no way using a Shopify REST API to retrieve a sales channel and the list of products in it, or a or retrieve a product and the list of sales channels it appears in?
GraphQL, although more powerful, is much more complicated for some development teams to incorporate.
Agreed! Unfortunately not.
Scott | Developer Advocate @ Shopify