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.

Is there any way to identify the person type from the Shopify Product resource?

Solved

Is there any way to identify the person type from the Shopify Product resource?

maviswa
New Member
6 0 0

Hi,

 

Currently using the Products REST API - "admin/api/2024-01/products.json" we are fetching all the products from our Shopify store. We want to know which type of person (Women / Men / Kid) can use this product from the product resource returned by the Products API.

 

Is there any specific field in Shopify, which gives us the person type (Women/Men/Kid) kind of information ?

 

Thanks In Advance.

Accepted Solution (1)
Liam
Community Manager
3108 344 911

This is an accepted solution.

Hi Maviswa,

 

There is no native field for gender on products, but you can define your own custom fields called metafields specifically for products where you can specify whether a product is for Women / Men/ Girl / Boy, etc. 

 

So you'd create a product metafield definition with a single-line-text type, which will then be visible on the product page in the admin. Then you'd enter into this field whether a product is for Women / Men/ Girl / Boy, etc. Finally when you query the product you can specify that you want the metafield value returned to get the assigned gender for the product.

 

Would this work for you?

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 4 (4)

Liam
Community Manager
3108 344 911

Hi Maviswa,

 

I'm not sure I fully understand this question - do you have a field (eg the product type field) where you're entering this info on the Shopify admin, and you want to access this via the API?

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

maviswa
New Member
6 0 0

Thanks Liam for getting back and Extremely Sorry for not being clear.

 

We are fetching the products from the Shopify store using the Admin REST API and we are getting the lists of Products as a response.

 

We want to know is there any field in Shopify which says who can use the product? For example, If one of the returned products from Shopify store is a T Shirt, then how can I identify that T-Shirt can be used by Women / Men/ Girl / Boy? Is there any field in Shopify Product resource that tells me who can use this product.

 

I hope it is clear.

 

Thanks,

Maviswa

Liam
Community Manager
3108 344 911

This is an accepted solution.

Hi Maviswa,

 

There is no native field for gender on products, but you can define your own custom fields called metafields specifically for products where you can specify whether a product is for Women / Men/ Girl / Boy, etc. 

 

So you'd create a product metafield definition with a single-line-text type, which will then be visible on the product page in the admin. Then you'd enter into this field whether a product is for Women / Men/ Girl / Boy, etc. Finally when you query the product you can specify that you want the metafield value returned to get the assigned gender for the product.

 

Would this work for you?

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

maviswa
New Member
6 0 0

Yes. Thanks for the information.