---
title: "Create product"
method: POST
path: "/ecommerce/products"
tags: ["🛒 Ecommerce"]
---

# Create product

`POST /ecommerce/products`

The API enables an authenticated user with the role of `ADMIN` to create a product by providing various details in the request body using form data.

The required fields for creating a product includes:

- name
- description
- price
- stock quantity
- category (referenced by the category ID),
- mainImage (representing the main product image),
- subImages (up to **4** additional images that can be viewed in a carousel on the frontend).
    

By submitting this information via form data, the API allows administrators to efficiently add new products to the system, ensuring accurate and comprehensive product listings for users.

## Response `201`

Create product

- object
  - `data` object
    - `__v` number
    - `_id` string
    - `category` string
    - `createdAt` string
    - `description` string
    - `mainImage` string
    - `name` string
    - `owner` string
    - `price` number
    - `stock` number
    - `subImages` string[]
    - `updatedAt` string
  - `message` string
  - `statusCode` number
  - `success` boolean

---

[API](https://skmtc.net/hiteshchoudhary-ssesph/apis/freeapi.md) · [All operations](https://skmtc.net/hiteshchoudhary-ssesph/apis/freeapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hiteshchoudhary-ssesph/freeapi/versions/a9f3a290e4dc/schema)
