v1

latestOpenAPI 3.0.3raw.githubusercontent.com2024-10-2916802.4 MB
🛒 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

namestring

Example request

{
  "name": "shirts"
}

Response

Create category

messagestring
statusCodenumber
successboolean

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
}