Focusing on managing products, variants, and collections through the API.
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.
Solved! Go to the solution
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
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
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
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
Yes. Thanks for the information.