Create Product

관리자나 판매자가 상품을 등록하기 위한 API

Create Product

POST /api/products

Access Permissions

Role
Description
ADMIN

관리자

SELLER

판매자

Request Headers

Name
Value

Content-Type

multipart/form-data

Authorization

Bearer <token>

Request Part

Name
Type
Description
Required

companyId

Long

Company ID

true

productName

String

Name of the product

true

productImage

MultipartFile

Image of the product

false

description

String

Description of the product

true

productDescriptionImage

MultipartFile

Image of the product description

false

productOption

String

Option of the product

false

originalPrice

Integer

Original price of the product

true

discountedPrice

Integer

Discounted price of the product

true

stock

Integer

Stock of the product

true

categoryCode

Integer

Category code of the product

true

salesStartTime

LocalDateTime

Start time of the sale

true

salesEndTime

LocalDateTime

End time of the sale

true

Response

{ 
    "status": 200,
    "data": {
        "productId": 1,
        "companyId": 1,
        "companyName": "업체1",
        "productName": "상품1",
        "productImageUrl": "https://s3~~~~~",
        "description": "상품1입니다.",
        "descriptionImageUrl": "https://s3~~~~~",
        "productOption": "RED",
        "originalPrice": 30000,
        "discountedPrice": 10000,
        "stock": 100,
        "categoryCode": 001,
        "saleStartTime": "2024-09-27 12:00:00",
        "saleEndTime": "2024-09-27 13:00:00",
        "rate": 3.4,
        "isSoldout": false
    },
    "error": null,
    "timeStamp": "2024-09-27 12:00:00"
}

Last updated