POST api/SpareParts/SaveSparePart

Api to Save SpareParts

Request Information

URI Parameters

None.

Body Parameters

InsertUpdateSparePartRequestModel
NameDescriptionTypeAdditional information
PartsID

integer

None.

PartsCode

string

Required

Name

string

Required

PartsDescription

string

None.

VendorPartCode

string

None.

PartsStatusID

integer

Required

PartsCategoryID

integer

None.

FacilityID

integer

None.

SubFacilityID

integer

None.

VendorID

integer

None.

Aisle

string

None.

Bin

string

None.

Row

string

None.

Model

string

None.

Make

string

None.

UnitID

integer

Required

CostPerUnit

decimal number

None.

PricePerUnit

decimal number

None.

CurrentStock

decimal number

None.

MinStock

decimal number

None.

MaxStock

decimal number

None.

VendorMap

Collection of VendorMapModel

None.

Request Formats

application/json, text/json, text/plain, text/html

Sample:
{
  "partsID": 1,
  "partsCode": "sample string 1",
  "name": "sample string 2",
  "partsDescription": "sample string 3",
  "vendorPartCode": "sample string 4",
  "partsStatusID": 5,
  "partsCategoryID": 6,
  "facilityID": 1,
  "subFacilityID": 1,
  "vendorID": 1,
  "aisle": "sample string 7",
  "bin": "sample string 8",
  "row": "sample string 9",
  "model": "sample string 10",
  "make": "sample string 11",
  "unitID": 12,
  "costPerUnit": 1.0,
  "pricePerUnit": 1.0,
  "currentStock": 1.0,
  "minStock": 1.0,
  "maxStock": 1.0,
  "vendorMap": [
    {
      "vendorId": 1,
      "isPreferred": true,
      "vendorPartCode": "sample string 3",
      "costPerUnit": 1.0
    },
    {
      "vendorId": 1,
      "isPreferred": true,
      "vendorPartCode": "sample string 3",
      "costPerUnit": 1.0
    }
  ]
}

application/xml, text/xml

Sample:
<InsertUpdateSparePartRequestModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ArrowCMMS.Core.RequestModel.SpareParts">
  <Aisle>sample string 7</Aisle>
  <Bin>sample string 8</Bin>
  <CostPerUnit>1</CostPerUnit>
  <CurrentStock>1</CurrentStock>
  <FacilityID>1</FacilityID>
  <Make>sample string 11</Make>
  <MaxStock>1</MaxStock>
  <MinStock>1</MinStock>
  <Model>sample string 10</Model>
  <Name>sample string 2</Name>
  <PartsCategoryID>6</PartsCategoryID>
  <PartsCode>sample string 1</PartsCode>
  <PartsDescription>sample string 3</PartsDescription>
  <PartsID>1</PartsID>
  <PartsStatusID>5</PartsStatusID>
  <PricePerUnit>1</PricePerUnit>
  <Row>sample string 9</Row>
  <SubFacilityID>1</SubFacilityID>
  <UnitID>12</UnitID>
  <VendorID>1</VendorID>
  <VendorMap>
    <VendorMapModel>
      <CostPerUnit>1</CostPerUnit>
      <IsPreferred>true</IsPreferred>
      <VendorId>1</VendorId>
      <VendorPartCode>sample string 3</VendorPartCode>
    </VendorMapModel>
    <VendorMapModel>
      <CostPerUnit>1</CostPerUnit>
      <IsPreferred>true</IsPreferred>
      <VendorId>1</VendorId>
      <VendorPartCode>sample string 3</VendorPartCode>
    </VendorMapModel>
  </VendorMap>
  <VendorPartCode>sample string 4</VendorPartCode>
</InsertUpdateSparePartRequestModel>

multipart/form-data

Sample:
<InsertUpdateSparePartRequestModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ArrowCMMS.Core.RequestModel.SpareParts"><Aisle>sample string 7</Aisle><Bin>sample string 8</Bin><CostPerUnit>1</CostPerUnit><CurrentStock>1</CurrentStock><FacilityID>1</FacilityID><Make>sample string 11</Make><MaxStock>1</MaxStock><MinStock>1</MinStock><Model>sample string 10</Model><Name>sample string 2</Name><PartsCategoryID>6</PartsCategoryID><PartsCode>sample string 1</PartsCode><PartsDescription>sample string 3</PartsDescription><PartsID>1</PartsID><PartsStatusID>5</PartsStatusID><PricePerUnit>1</PricePerUnit><Row>sample string 9</Row><SubFacilityID>1</SubFacilityID><UnitID>12</UnitID><VendorID>1</VendorID><VendorMap><VendorMapModel><CostPerUnit>1</CostPerUnit><IsPreferred>true</IsPreferred><VendorId>1</VendorId><VendorPartCode>sample string 3</VendorPartCode></VendorMapModel><VendorMapModel><CostPerUnit>1</CostPerUnit><IsPreferred>true</IsPreferred><VendorId>1</VendorId><VendorPartCode>sample string 3</VendorPartCode></VendorMapModel></VendorMap><VendorPartCode>sample string 4</VendorPartCode></InsertUpdateSparePartRequestModel>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

CommonResponseDataModel
NameDescriptionTypeAdditional information
ReturnID

integer

Required

Message

string

Required

Successful

boolean

Required

Code

integer

None.

TotalRecord

integer

None.

Response Formats

application/json, text/json, text/plain, text/html

Sample:
{
  "returnID": 1,
  "message": "sample string 2",
  "successful": true,
  "code": 4,
  "totalRecord": 5
}

application/xml, text/xml

Sample:
<CommonResponseDataModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Arrow.Core.DataModel">
  <Code>4</Code>
  <Message>sample string 2</Message>
  <ReturnID>1</ReturnID>
  <Successful>true</Successful>
  <TotalRecord>5</TotalRecord>
</CommonResponseDataModel>

multipart/form-data

Sample:
<CommonResponseDataModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Arrow.Core.DataModel"><Code>4</Code><Message>sample string 2</Message><ReturnID>1</ReturnID><Successful>true</Successful><TotalRecord>5</TotalRecord></CommonResponseDataModel>