POST api/product

Post new Product to the system

Request Information

URI Parameters

None.

Body Parameters

Product want to post

New Product
NameDescriptionTypeAdditional information
seller_uid

ID of the Seller

integer

Required

product_name

Name of the product

string

Required

Max length: 50

product_price

Price of the product

decimal number

Required

category_uid

Category ID of the product

integer

Required

product_desc

Description of the product

string

Max length: 1024

shipping_is_face_to_face

Flag for Shipping allow Face to Face, at least 1 Shipping Flag requires to be true

boolean

None.

shipping_face_to_face_detail

Face to Face Shipping Detail

string

Max length: 1024

shipping_is_post

Flag for Shipping allow Post, at least 1 Shipping Flag requires to be true

boolean

None.

shipping_post_detail

Post Shipping Detail

string

Max length: 1024

shipping_is_other

Flag for Shipping allow Other Method, at least 1 Shipping Flag requires to be true

boolean

None.

shipping_other_detail

Other Method Shipping Detail

string

Max length: 1024

product_image_1

Image 1 ID of the product

integer

None.

product_image_2

Image 2 ID of the product

integer

None.

product_image_3

Image 3 ID of the product

integer

None.

old_product_uid

Old product UID. only needed when it is a reopen product

integer

None.

Request Formats

application/json, text/json

Sample:
{
  "seller_uid": 1,
  "product_name": "sample string 2",
  "product_price": 3.1,
  "category_uid": 4,
  "product_desc": "sample string 5",
  "shipping_is_face_to_face": true,
  "shipping_face_to_face_detail": "sample string 7",
  "shipping_is_post": true,
  "shipping_post_detail": "sample string 9",
  "shipping_is_other": true,
  "shipping_other_detail": "sample string 11",
  "product_image_1": 1,
  "product_image_2": 1,
  "product_image_3": 1,
  "old_product_uid": 1
}

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'NewProductDTO'.

Response Information

Resource Description

Message with API result, if sucess(200), product info like user UID will return; if fail in input, error message with missing field(400) will return; if user is not valid or credit not enough, error message will returen with reason(400)

NewProductResponse
NameDescriptionTypeAdditional information
Message

Message of the API

string

None.

Product

Product info

Product Simple Info

None.

Response Formats

application/json, text/json

Sample:
{
  "Message": "sample string 1",
  "Product": {
    "uid": 1,
    "name": "sample string 2"
  }
}