POST api/PurchaseRequests

Add a new purchase request

Request Information

URI Parameters

None.

Body Parameters

PurchaseRequestNew
NameDescriptionTypeAdditional information
Title

The Purchase Request Title

string

Required

Max length: 255

Date

The Purchase Request Date

date

None.

StockItems

The Purchase Request Stock Items List

Collection of PurchaseRequest.StockItemEdit

None.

Others

The Purchase Request Others/Services List

Collection of PurchaseRequest.OtherEdit

None.

Notes

The Purchase Request Notes

string

None.

Request Formats

Sample:
{
  "Title": "sample string 1",
  "Date": "2024-11-14T16:36:36.8365361+00:00",
  "StockItems": [
    {
      "Id": 1,
      "Code": "sample string 1",
      "Supplier": "sample string 2",
      "Quantity": 1.1,
      "UnitCost": 1.1,
      "Urgency": "Emergency",
      "Store": "sample string 3",
      "CostAllocation": {
        "Type": "WorkOrder",
        "Code": "sample string 1"
      },
      "Notes": "sample string 4"
    },
    {
      "Id": 1,
      "Code": "sample string 1",
      "Supplier": "sample string 2",
      "Quantity": 1.1,
      "UnitCost": 1.1,
      "Urgency": "Emergency",
      "Store": "sample string 3",
      "CostAllocation": {
        "Type": "WorkOrder",
        "Code": "sample string 1"
      },
      "Notes": "sample string 4"
    }
  ],
  "Others": [
    {
      "Id": 1,
      "Description": "sample string 1",
      "Supplier": "sample string 2",
      "TotalCost": 1.1,
      "Urgency": "Emergency",
      "CostAllocation": {
        "Type": "WorkOrder",
        "Code": "sample string 1"
      },
      "Notes": "sample string 3"
    },
    {
      "Id": 1,
      "Description": "sample string 1",
      "Supplier": "sample string 2",
      "TotalCost": 1.1,
      "Urgency": "Emergency",
      "CostAllocation": {
        "Type": "WorkOrder",
        "Code": "sample string 1"
      },
      "Notes": "sample string 3"
    }
  ],
  "Notes": "sample string 2"
}
Sample:
<PurchaseRequestNew xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebAPI.Models.Purchase">
  <Date>2024-11-14T16:36:36.8365361+00:00</Date>
  <Notes>sample string 2</Notes>
  <Others>
    <OtherEdit>
      <CostAllocation xmlns:d4p1="http://schemas.datacontract.org/2004/07/WebAPI.Models">
        <d4p1:Code>sample string 1</d4p1:Code>
        <d4p1:Type>WorkOrder</d4p1:Type>
      </CostAllocation>
      <Description>sample string 1</Description>
      <Id>1</Id>
      <Notes>sample string 3</Notes>
      <Supplier>sample string 2</Supplier>
      <TotalCost>1.1</TotalCost>
      <Urgency>Emergency</Urgency>
    </OtherEdit>
    <OtherEdit>
      <CostAllocation xmlns:d4p1="http://schemas.datacontract.org/2004/07/WebAPI.Models">
        <d4p1:Code>sample string 1</d4p1:Code>
        <d4p1:Type>WorkOrder</d4p1:Type>
      </CostAllocation>
      <Description>sample string 1</Description>
      <Id>1</Id>
      <Notes>sample string 3</Notes>
      <Supplier>sample string 2</Supplier>
      <TotalCost>1.1</TotalCost>
      <Urgency>Emergency</Urgency>
    </OtherEdit>
  </Others>
  <StockItems>
    <StockItemEdit>
      <Code>sample string 1</Code>
      <CostAllocation xmlns:d4p1="http://schemas.datacontract.org/2004/07/WebAPI.Models">
        <d4p1:Code>sample string 1</d4p1:Code>
        <d4p1:Type>WorkOrder</d4p1:Type>
      </CostAllocation>
      <Id>1</Id>
      <Notes>sample string 4</Notes>
      <Quantity>1.1</Quantity>
      <Store>sample string 3</Store>
      <Supplier>sample string 2</Supplier>
      <UnitCost>1.1</UnitCost>
      <Urgency>Emergency</Urgency>
    </StockItemEdit>
    <StockItemEdit>
      <Code>sample string 1</Code>
      <CostAllocation xmlns:d4p1="http://schemas.datacontract.org/2004/07/WebAPI.Models">
        <d4p1:Code>sample string 1</d4p1:Code>
        <d4p1:Type>WorkOrder</d4p1:Type>
      </CostAllocation>
      <Id>1</Id>
      <Notes>sample string 4</Notes>
      <Quantity>1.1</Quantity>
      <Store>sample string 3</Store>
      <Supplier>sample string 2</Supplier>
      <UnitCost>1.1</UnitCost>
      <Urgency>Emergency</Urgency>
    </StockItemEdit>
  </StockItems>
  <Title>sample string 1</Title>
</PurchaseRequestNew>
Sample:

Sample not available.

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

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

2024-11-14T16:36:36.8365361+00:00
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].Id"

1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].Code"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].Supplier"

sample string 2
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].Quantity"

1.1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].UnitCost"

1.1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].Urgency"

Emergency
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].Store"

sample string 3
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].CostAllocation.Type"

WorkOrder
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].CostAllocation.Code"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[0].Notes"

sample string 4
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].Id"

1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].Code"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].Supplier"

sample string 2
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].Quantity"

1.1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].UnitCost"

1.1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].Urgency"

Emergency
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].Store"

sample string 3
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].CostAllocation.Type"

WorkOrder
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].CostAllocation.Code"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="StockItems[1].Notes"

sample string 4
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[0].Id"

1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[0].Description"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[0].Supplier"

sample string 2
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[0].TotalCost"

1.1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[0].Urgency"

Emergency
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[0].CostAllocation.Type"

WorkOrder
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[0].CostAllocation.Code"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[0].Notes"

sample string 3
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[1].Id"

1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[1].Description"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[1].Supplier"

sample string 2
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[1].TotalCost"

1.1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[1].Urgency"

Emergency
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[1].CostAllocation.Type"

WorkOrder
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[1].CostAllocation.Code"

sample string 1
--MultipartDataMediaFormatterBoundary1q2w3e
Content-Disposition: form-data; name="Others[1].Notes"

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

sample string 2
--MultipartDataMediaFormatterBoundary1q2w3e--

Response Information

Resource Description

Returns the Purchase Request Code; Status code: 201 (Created)

HttpResponseMessage
NameDescriptionTypeAdditional information
Version

Version

None.

Content

HttpContent

None.

StatusCode

HttpStatusCode

None.

ReasonPhrase

string

None.

Headers

Collection of Object

None.

RequestMessage

HttpRequestMessage

None.

IsSuccessStatusCode

boolean

None.