Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Markets by Product GraphQl/Rest API

Solved

Markets by Product GraphQl/Rest API

RfcSilva
Shopify Partner
22 1 6

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
Community Manager
3108 344 894

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
Community Manager
3108 344 894

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