0

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




  }
}
0
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
 }
}
  • 1
    how do I do it for a bulk creation? – satan Apr 28 '18 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 – WISAM HAKIM Apr 30 '18 at 3:56

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.