POST API/Product/AddProduct

Request Information

URI Parameters

None.

Body Parameters

Product
NameDescriptionTypeAdditional information
id

integer

None.

name

string

None.

description

string

None.

barcode

string

None.

price

decimal number

None.

dateTime

date

None.

discontinued

integer

None.

categoryID

integer

None.

genderID

integer

None.

brandID

integer

None.

image

Collection of Image

None.

size

Collection of AllocateSize

None.

brand

Brand

None.

Request Formats

application/json, text/json

Sample:
{
  "id": 1,
  "name": "sample string 2",
  "description": "sample string 3",
  "barcode": "sample string 4",
  "price": 5.1,
  "dateTime": "2025-12-13T08:57:10.9009928+02:00",
  "discontinued": 7,
  "categoryID": 8,
  "genderID": 9,
  "brandID": 10,
  "image": [
    {
      "id": 1,
      "image": "sample string 2",
      "colourID": 3,
      "productID": 4
    },
    {
      "id": 1,
      "image": "sample string 2",
      "colourID": 3,
      "productID": 4
    }
  ],
  "size": [
    {
      "id": 1,
      "quantity": 2,
      "sizeID": 3,
      "productID": 4
    },
    {
      "id": 1,
      "quantity": 2,
      "sizeID": 3,
      "productID": 4
    }
  ],
  "brand": {
    "id": 1,
    "logo": "sample string 2",
    "name": "sample string 3",
    "description": "sample string 4",
    "representativePerson": "sample string 5",
    "contactNumber": "sample string 6",
    "dateTime": "2025-12-13T08:57:10.9009928+02:00",
    "userID": 8
  }
}

application/xml, text/xml

Sample:
<Product xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Models">
  <barcode>sample string 4</barcode>
  <brand>
    <contactNumber>sample string 6</contactNumber>
    <dateTime>2025-12-13T08:57:10.9009928+02:00</dateTime>
    <description>sample string 4</description>
    <id>1</id>
    <logo>sample string 2</logo>
    <name>sample string 3</name>
    <representativePerson>sample string 5</representativePerson>
    <userID>8</userID>
  </brand>
  <brandID>10</brandID>
  <categoryID>8</categoryID>
  <dateTime>2025-12-13T08:57:10.9009928+02:00</dateTime>
  <description>sample string 3</description>
  <discontinued>7</discontinued>
  <genderID>9</genderID>
  <id>1</id>
  <image>
    <Image>
      <colourID>3</colourID>
      <id>1</id>
      <image>sample string 2</image>
      <productID>4</productID>
    </Image>
    <Image>
      <colourID>3</colourID>
      <id>1</id>
      <image>sample string 2</image>
      <productID>4</productID>
    </Image>
  </image>
  <name>sample string 2</name>
  <price>5.1</price>
  <size>
    <AllocateSize>
      <id>1</id>
      <productID>4</productID>
      <quantity>2</quantity>
      <sizeID>3</sizeID>
    </AllocateSize>
    <AllocateSize>
      <id>1</id>
      <productID>4</productID>
      <quantity>2</quantity>
      <sizeID>3</sizeID>
    </AllocateSize>
  </size>
</Product>

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 'Product'.

application/bson

Sample:
Binary JSON content. See http://bsonspec.org for details.

Response Information

Resource Description

IHttpActionResult

None.

Response Formats

application/json, text/json, application/xml, text/xml

Sample:

Sample not available.

application/bson

Sample:
Binary JSON content. See http://bsonspec.org for details.