POST api/itemapi/add?siteId={siteId}

Request Information

URI Parameters

NameDescriptionTypeAdditional information
siteId

globally unique identifier

None.

Body Parameters

ItemViewModel
NameDescriptionTypeAdditional information
descriptions

Dictionary of string [key] and string [value]

None.

active

boolean

None.

code

string

Required

String length: inclusive between 0 and 30

color_id

globally unique identifier

None.

customer_id

globally unique identifier

Required

grouping_quantity

integer

None.

id

globally unique identifier

None.

item_service_id

globally unique identifier

None.

item_garment_type_id

globally unique identifier

None.

item_segment_id

globally unique identifier

None.

item_type_id

globally unique identifier

None.

purchase_price

decimal number

None.

sale_price

decimal number

None.

size_id

globally unique identifier

None.

supplier_code

string

String length: inclusive between 0 and 30

supplier_description

string

String length: inclusive between 0 and 100

unit

string

String length: inclusive between 0 and 10

weight

integer

None.

root_code

string

String length: inclusive between 0 and 30

Request Formats

application/json, text/json

Sample:
{
  "descriptions": {
    "sample string 1": "sample string 2",
    "sample string 3": "sample string 4"
  },
  "active": true,
  "code": "sample string 2",
  "color_id": "aff1b3cd-e967-4651-bc09-206714fff704",
  "customer_id": "68dd5744-cafb-4342-a816-41c8e9e4bb00",
  "grouping_quantity": 1,
  "id": "d9e8b4b1-acd3-407a-b083-e7b53ca1b5b8",
  "item_service_id": "36e6c748-ca13-4f2c-be40-ebd3ea0869b6",
  "item_garment_type_id": "f824d482-1ce2-45e0-9abb-d0d5fe2c9928",
  "item_segment_id": "52f3820c-ca1e-41b7-b095-3684f294a755",
  "item_type_id": "366ceb7e-2238-4013-97c8-68b515294001",
  "purchase_price": 1.0,
  "sale_price": 1.0,
  "size_id": "8f45d996-d65a-48b1-9621-7c857d757665",
  "supplier_code": "sample string 6",
  "supplier_description": "sample string 7",
  "unit": "sample string 8",
  "weight": 1,
  "root_code": "sample string 9"
}

application/xml, text/xml

Sample:
<item xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/EntityModel">
  <active>true</active>
  <code>sample string 2</code>
  <color_id>aff1b3cd-e967-4651-bc09-206714fff704</color_id>
  <customer_id>68dd5744-cafb-4342-a816-41c8e9e4bb00</customer_id>
  <grouping_quantity>1</grouping_quantity>
  <id>d9e8b4b1-acd3-407a-b083-e7b53ca1b5b8</id>
  <item_garment_type_id>f824d482-1ce2-45e0-9abb-d0d5fe2c9928</item_garment_type_id>
  <item_segment_id>52f3820c-ca1e-41b7-b095-3684f294a755</item_segment_id>
  <item_service_id>36e6c748-ca13-4f2c-be40-ebd3ea0869b6</item_service_id>
  <item_type_id>366ceb7e-2238-4013-97c8-68b515294001</item_type_id>
  <purchase_price>1</purchase_price>
  <root_code>sample string 9</root_code>
  <sale_price>1</sale_price>
  <size_id>8f45d996-d65a-48b1-9621-7c857d757665</size_id>
  <supplier_code>sample string 6</supplier_code>
  <supplier_description>sample string 7</supplier_description>
  <unit>sample string 8</unit>
  <weight>1</weight>
  <descriptions xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 1</d2p1:Key>
      <d2p1:Value>sample string 2</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 3</d2p1:Key>
      <d2p1:Value>sample string 4</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </descriptions>
</item>

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

Response Information

Resource Description

globally unique identifier

Response Formats

application/json, text/json

Sample:
"ee1d01e8-afb8-4443-bdc7-3b8ab7821386"

application/xml, text/xml

Sample:
<guid xmlns="http://schemas.microsoft.com/2003/10/Serialization/">ee1d01e8-afb8-4443-bdc7-3b8ab7821386</guid>