Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.
Solved

Markets by Product GraphQl/Rest API

RfcSilva
Shopify Partner
16 1 2

Hello,

 

How do I get all the Markets that one product is available using GraphQl or Rest API?


Basically, the information that we can also see when we edit a product:

RfcSilva_0-1703070324637.png

 

Best Regards!

Accepted Solution (1)

Liam
Shopify Staff
2677 288 734

This is an accepted solution.

Hi RfcSilva,

 

Markets should all have a catalog, and that catalog has a publication - you can query that to get a publication ID,  and then query the product's publishedOnPublication field to see the markets that a product is available on. 

Liam | Developer Advocate @ 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

View solution in original post

Reply 1 (1)

Liam
Shopify Staff
2677 288 734

This is an accepted solution.

Hi RfcSilva,

 

Markets should all have a catalog, and that catalog has a publication - you can query that to get a publication ID,  and then query the product's publishedOnPublication field to see the markets that a product is available on. 

Liam | Developer Advocate @ 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