Solved

Markets by Product GraphQl/Rest API

RfcSilva
Shopify Partner
17 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
2731 301 779

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

Replies 2 (2)

Liam
Shopify Staff
2731 301 779

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

uttpal
Shopify Partner
2 0 0

Hi @Liam while creating a product using Rest API how can i set market values?As in our case i want market to be always set as international and primary(United States) while creating a product, can u help me the correct endpoint with request body?

 

uttpal_0-1709706554764.png