🛒 Ecommerce
Create category
The API endpoint allows an administrator user with the appropriate role to create a new category.
By sending a request to this endpoint with the desired category name provided in the request body, the API will create a new category in the system.
This functionality is restricted to users with an ADMIN role to ensure proper access control and authorization.
post/ecommerce/categories
Request body
Example request
{
"name": "shirts"
}Response
Create category
Example response
{
"data": {
"_id": "6478e1c2b3b51f6d24e0aa5b",
"createdAt": "2023-06-01T18:21:54.762Z",
"name": "womens-wear",
"owner": "6476e34ebe1cfb9cc08bd446",
"updatedAt": "2023-06-01T18:21:54.762Z"
},
"message": "Category created successfully",
"statusCode": 200,
"success": true
}