Create Category - Venddor API

← Back to API Documentation
POST {{baseUrl}}/Categories

This endpoint allows you to create a new product category in the marketplace.

Request Headers

Header Value Description
Authorization Basic Auth Base64 encoded username:password combination

Request Body Parameters

Parameter Type Required Description
category* string Yes Name of the category
company_id* string Yes Always set to "0" to make the category available to all sellers
status* string Yes Set to "A" for activated or "D" for deactivated
parent_id string No ID of the parent category if this is a subcategory. If omitted, the category will be created as a top-level category.

Example Request

{
  "category": "Category name",
  "company_id": "0",
  "status": "A"
}

Response

The endpoint returns the ID of the newly created category.

Example Response

{
  "category_id": "1825"
}
Tip: When creating hierarchical categories, first create the parent category, then create the child categories by setting the parent_id parameter to the ID of the parent category.