PUT api/Materials
Create a new Material or update an existing one
Request Information
URI Parameters
None.
Body Parameters
The Material to create/update
MaterialPut| Name | Description | Type | Additional information |
|---|---|---|---|
| Code |
The Material code |
string |
Required Max length: 40 |
| Description |
The Material description |
string |
Required Max length: 200 |
| Unit |
The unit of the Material |
string |
Required Max length: 5 |
| CodingStandard |
The coding standard where the new Material should be placed (no effect on update) |
string |
Required Matching regular expression pattern: \S{1,5}\.\S{1,5}\.\S{1,5} |
| ManufacturerCode |
Only update if is not the mandatory code |
string |
Max length: 40 |
| ExternalCode |
Only update if is not the mandatory code |
string |
Max length: 40 |
| Cost |
The unit cost of the material |
decimal number |
Equal or above: 0 |
| ItemsRelationship |
Relationship Items - applied stock items |
boolean |
None. |
| Stores |
Set the stores stock levels limits. The key is the Store code. |
Dictionary of string [key] and StoreStock [value] |
None. |
| Specifications |
|
Collection of MaterialSpecification |
No duplicate values on: Number |
Request Formats
{
"Code": "XV-001",
"Description": "PVC tube",
"Unit": "m",
"CodingStandard": "Z.ZZ.ZZZ",
"Stores": {
"A01": {
"Maximum": 10.0,
"Minimum": 1.0
}
}
}
<MaterialPut xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebAPI.Models.Materiais">
<Code>XV-001</Code>
<CodingStandard>Z.ZZ.ZZZ</CodingStandard>
<Cost i:nil="true" />
<Description>PVC tube</Description>
<ExternalCode i:nil="true" />
<ItemsRelationship i:nil="true" />
<ManufacturerCode i:nil="true" />
<Specifications i:nil="true" />
<Stores xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringStoreStockYjVXWtuX>
<d2p1:Key>A01</d2p1:Key>
<d2p1:Value>
<Location i:nil="true" />
<Maximum>10</Maximum>
<Minimum>1</Minimum>
<Security i:nil="true" />
</d2p1:Value>
</d2p1:KeyValueOfstringStoreStockYjVXWtuX>
</Stores>
<Unit>m</Unit>
</MaterialPut>
Sample not available.
--MultipartDataMediaFormatterBoundary1q2w3e Content-Disposition: form-data; name="Code" XV-001 --MultipartDataMediaFormatterBoundary1q2w3e Content-Disposition: form-data; name="Description" PVC tube --MultipartDataMediaFormatterBoundary1q2w3e Content-Disposition: form-data; name="Unit" m --MultipartDataMediaFormatterBoundary1q2w3e Content-Disposition: form-data; name="CodingStandard" Z.ZZ.ZZZ --MultipartDataMediaFormatterBoundary1q2w3e Content-Disposition: form-data; name="Stores[0].Key" A01 --MultipartDataMediaFormatterBoundary1q2w3e Content-Disposition: form-data; name="Stores[0].Value.Maximum" 10 --MultipartDataMediaFormatterBoundary1q2w3e Content-Disposition: form-data; name="Stores[0].Value.Minimum" 1 --MultipartDataMediaFormatterBoundary1q2w3e--
Response Information
Resource Description
Returns the Material Code. Status code: 201 (Created) on create; 200 (OK) on update
stringResponse Formats
"sample string 1"
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">sample string 1</string>
--MultipartDataMediaFormatterBoundary1q2w3e Content-Disposition: form-data; name="" sample string 1 --MultipartDataMediaFormatterBoundary1q2w3e--