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": "4fde59d6-e662-459b-be88-6e77f5990cd6",
  "customer_id": "b783ccb4-42e3-4d15-853d-20f111e8b844",
  "grouping_quantity": 1,
  "id": "0e85ea41-825b-4741-9207-81d77ef181c9",
  "item_service_id": "c0d7676c-7d1a-4a83-bd99-dfdf94108ab5",
  "item_garment_type_id": "99d2fb7d-fb0f-48cb-ae44-0d075c684c07",
  "item_segment_id": "c0565d66-facd-4f97-bada-630f9089c3bd",
  "item_type_id": "c25c67df-4dbe-40b3-875b-3a920d3e78a2",
  "purchase_price": 1.0,
  "sale_price": 1.0,
  "size_id": "a8530aad-e816-49d2-b69d-94a9a81b7850",
  "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>4fde59d6-e662-459b-be88-6e77f5990cd6</color_id>
  <customer_id>b783ccb4-42e3-4d15-853d-20f111e8b844</customer_id>
  <grouping_quantity>1</grouping_quantity>
  <id>0e85ea41-825b-4741-9207-81d77ef181c9</id>
  <item_garment_type_id>99d2fb7d-fb0f-48cb-ae44-0d075c684c07</item_garment_type_id>
  <item_segment_id>c0565d66-facd-4f97-bada-630f9089c3bd</item_segment_id>
  <item_service_id>c0d7676c-7d1a-4a83-bd99-dfdf94108ab5</item_service_id>
  <item_type_id>c25c67df-4dbe-40b3-875b-3a920d3e78a2</item_type_id>
  <purchase_price>1</purchase_price>
  <root_code>sample string 9</root_code>
  <sale_price>1</sale_price>
  <size_id>a8530aad-e816-49d2-b69d-94a9a81b7850</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:
"4abfd50e-80f0-4eba-9f8c-4c8e7dec08ac"

application/xml, text/xml

Sample:
<guid xmlns="http://schemas.microsoft.com/2003/10/Serialization/">4abfd50e-80f0-4eba-9f8c-4c8e7dec08ac</guid>