I am working on a Rest API based "Add product" tool, starting with simple products. If I understand it correct, I need to know beforehand "attribute_set_id" for "Attribute set" such as Bag, Bottom, Default, Downloadable, Gear, Top or anything else that is there.
With this endpoint
POST <host>/rest/default/V1/products
I successfully managed to add a test product.
But I believe, based on the attribute set/product type I will need to have required and optional fields in order to successfully add the product. Where or how do I get this information? I have been looking for this information at https://devdocs.magento.com but I have not found it yet. Swagger at http://127.0.0.1/swagger does not help either.
So far using this Endpoint
GET <host>/rest/<store_code>/V1/eav/attribute-sets/list? searchCriteria[filter_groups][0][filters][0][field]=attribute_set_name& searchCriteria[filter_groups][0][filters][0][value]=Top& searchCriteria[filter_groups][0][filters][0][condition_type]=eq
I was able to get attribute_set_id for "Top", how can can I get all attribute_set_name and id's at the same time for all the attribute set that exist in the Magento Store?
Solved! Go to Solution.
Hi @burgurprot35d3
Try the below endpoint
rest/V1/products/attribute-sets/sets/list?searchCriteria=0
I hope it will help you!
Hi @burgurprot35d3
Try the below endpoint
rest/V1/products/attribute-sets/sets/list?searchCriteria=0
I hope it will help you!
Thanks a lot, it worked. Can you please also help me with figuring out all the required/mandatory and optional fields for each attribute set?