New Shopify Certification now available: Liquid Storefronts for Theme Developers

REPOST: Product Listings REST API Returns "Not Found"

Solved
Pegarm
New Member
6 0 0

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:

  • Pass a product and see the sales channels the product is in
  • Pass a sales channel and see the products that are in it?

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.

 

Accepted Solution (1)
SBD_
Shopify Staff
Shopify Staff
1671 235 346

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 

View solution in original post

Replies 3 (3)
SBD_
Shopify Staff
Shopify Staff
1671 235 346

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 

Pegarm
New Member
6 0 0

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.

SBD_
Shopify Staff
Shopify Staff
1671 235 346

Agreed! Unfortunately not.

Scott | Developer Advocate @ Shopify