POST api/Records/Materials

Add a new Material consumption

Request Information

URI Parameters

None.

Body Parameters

MaterialsRecordNew
NameDescriptionTypeAdditional information
Material

The material code

string

Required

Date

The date when this material was consumed

date

Required

Quantity

The quantity of material consumed

decimal number

Required

Above: 0

UnitCost

The unit cost of the material

decimal number

Equal or above: 0

Currency

The currency code.
If empty, the default currency is used

string

None.

Allocation

Where this record should be allocated

AllocationEntity

Required

Account

If empty, the ManWinWin predefined Account will be used

string

None.

CostDocument

This maybe required, depending on ManWinWin preferences

string

None.

Supplier

The Cost Document Supplier

string

None.

Request Formats

Sample:
{
  "Material": "sample string 1",
  "Date": "2024-11-14T16:31:45.8485303+00:00",
  "Quantity": 1.1,
  "UnitCost": 1.1,
  "Currency": "sample string 2",
  "Allocation": {
    "Type": "WorkOrder",
    "Code": "sample string 1"
  },
  "Account": "sample string 3",
  "CostDocument": "sample string 4",
  "Supplier": "sample string 5"
}
Sample:
<MaterialsRecordNew xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebAPI.Models.Apontamentos">
  <Account>sample string 3</Account>
  <Allocation xmlns:d2p1="http://schemas.datacontract.org/2004/07/WebAPI.Models">
    <d2p1:Code>sample string 1</d2p1:Code>
    <d2p1:Type>WorkOrder</d2p1:Type>
  </Allocation>
  <CostDocument>sample string 4</CostDocument>
  <Currency>sample string 2</Currency>
  <Date>2024-11-14T16:31:45.8485303+00:00</Date>
  <Material>sample string 1</Material>
  <Quantity>1.1</Quantity>
  <Supplier>sample string 5</Supplier>
  <UnitCost>1.1</UnitCost>
</MaterialsRecordNew>
Sample:

Sample not available.

Sample:
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Material"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Date"

2024-11-14T16:31:45.8485303+00:00
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Quantity"

1.1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="UnitCost"

1.1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Currency"

sample string 2
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Allocation.Type"

WorkOrder
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Allocation.Code"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Account"

sample string 3
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="CostDocument"

sample string 4
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Supplier"

sample string 5
--MultipartDataMediaFormatterBoundary1q2w3e--

Response Information

Resource Description

Returns the ID of the material consumption record; Status code: 201 (Created)

integer

Response Formats

Sample:
1
Sample:
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</int>
Sample:
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name=""

1
--MultipartDataMediaFormatterBoundary1q2w3e--