POST api/Products/InsertProduct

Inserts a new product.

Request Information

URI Parameters

None.

Body Parameters

NewProductPost
NameDescriptionTypeAdditional information
Name

(Required) Name

string

None.

Description

Description

string

None.

ProductCategoryId

(Optional) Product category id

integer

None.

Code

Code

string

None.

IsDisabled

True if product is disabled

boolean

None.

Image

(Optional) Image for product

Collection of byte

None.

FontIcon

Font awesome icon will be used if image is empty. exapmle: fas fa-address-book

string

None.

Color

Color for font awesome icon

string

None.

Request Formats

application/json, text/json

Sample:
{
  "Name": "Product",
  "Description": null,
  "ProductCategoryId": null,
  "Code": null,
  "IsDisabled": false,
  "Image": null,
  "FontIcon": "fas fa-address-book",
  "Color": "#ffffff"
}

application/xml, text/xml

Sample:
<NewProductPost xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RequestorApiDataStructures.Posts">
  <Code i:nil="true" />
  <Color>#ffffff</Color>
  <Description i:nil="true" />
  <FontIcon>fas fa-address-book</FontIcon>
  <Image i:nil="true" />
  <IsDisabled>false</IsDisabled>
  <Name>Product</Name>
  <ProductCategoryId i:nil="true" />
</NewProductPost>

Response Information

Resource Description

InsertProductResult
NameDescriptionTypeAdditional information
Id

integer

None.

Response Formats

application/json, text/json

Sample:
{
  "Id": 1
}

application/xml, text/xml

Sample:
<InsertProductResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RequestorApiDataStructures.Results">
  <Id>1</Id>
</InsertProductResult>