1

I am able to create categories under default category but I am not able to create sub category while creating a new category under default. The body I am passing is

{
  "category": {

    "parent_id": 2,
    "name": "test_category1",
    "is_active": true




  }
}

1 Answer 1

3
I created a category under deafult category using following request
{
 "category": {
 "parent_id": 2,
 "name": "test",
 "is_active": true
 }
}
 To create a sub category for your new category change parent id equivalent to your response

 You can use below request :
 {
 "category": {
 "parent_id": 42,
 "name": "test1",
 "is_active": true
 }
}
2
  • 1
    how do I do it for a bulk creation?
    – satan
    Apr 28, 2018 at 17:35
  • when you create category using REST API, magento will return to you the created category id, you can process the response to get the ID then create another request with the created ID Apr 30, 2018 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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