I am trying to get only the category name and category id with the parent and child segregation programmatically using REST API. Can anyone please suggest some solution or provide some sample code which would help me achieve the task.

Thanks in advance


To get the name and ID of te categgory you need to call below rest API:


using GET method to get details of the category and all its child. If you want parent and child segregation then you need to write down a module with webapi.xml file and declare your endpoint and method in it. In that method you need to write down the code to fetch all details separately. Let me know if this suggestion helps or you want me to write down the code to provide you.


Rahul Anand

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.