Add Product Inventory

Use this operation to add Inventory to an existing Product object.

Parameters

Body Params
JSON:json
Product Inventory details needs to be passed as body parameter,it should be in JSON format.
XML:string
Product Inventory details needs to be passed as body parameter,it should be in XML format.
Path Params
yourCompany:string
The Company name need to passed in the base URL.For eg. if you enter xyzcompany name, the url https://{yourCompany}.agiliron.net/agiliron/api-40.php/ProductsInventory will change to https://xyzcompany.agiliron.net/agiliron/api-40.php/ProductsInventory
Header Params
Accept:string
Response header need to be passed for eg. application/json or application/xml.
Query Auth
key:string
API key needs to be passed in this variable.The option to enter API key will appear when you click on Try it button.This will be the first option in AUTHENTICATION block.Default is SET to 0.
Header Auth
apiKey:string
Dedicated API key needs to be passed in this variable via header.The option to enter API key will appear when you click on Try it button.This will be the second option in AUTHENTICATION block.Default is SET to 0.

Sample Code

{
	"ProductsInventory": {
		"StockLocationInventory": [
			{
				"ProductCode": "ProductCode1",
				"StockLocation": "OAK",
				"QtyInStock": "20",
				"UnitCost": "10.00000",
				"QtyOnPO": "0",
				"QtyOnSO": "0",
				"BinLocation": "BIN1"
			},
			{
				"ProductCode": "ProductCode1",
				"StockLocation": "PDX",
				"QtyInStock": "0",
				"UnitCost": "10.00000",
				"QtyOnPO": "0",
				"QtyOnSO": "0",
				"BinLocation": "BIN2"
			}
		]
	}
}
<ProductInventory>
    <StockLocationInventory>
        <ProductCode>ProductCode1</ProductCode>
        <StockLocation>OAK</StockLocation>
        <QtyInStock>20</QtyInStock>
        <UnitCost>10.00000</UnitCost>
        <QtyOnPO>0</QtyOnPO>
        <QtyOnSO>0</QtyOnSO>
        <BinLocation>BIN1</BinLocation>
    </StockLocationInventory>
    <StockLocationInventory>
        <ProductCode>ProductCode1</ProductCode>
        <StockLocation>PDX</StockLocation>
        <QtyInStock>0</QtyInStock>
        <UnitCost>10.00000</UnitCost>
        <QtyOnPO>0</QtyOnPO>
        <QtyOnSO>0</QtyOnSO>
        <BinLocation>BIN2</BinLocation>
    </StockLocationInventory>
</ProductInventory>
{
	"ProductsInventory": {
		"StockLocationInventory": [
			{
				"ProductCode": "ProductCode1",
				"StockLocation": "OAK",
				"QtyInStock": "990",
				"UnitCost": "125.55556",
				"QtyOnPO": "0",
				"QtyOnSO": "0",
				"BinLocation": "BIN1",
				"InventoryMatrixItems": {
					"InventoryMatrixItem": [
						{
							"InventoryMatrixItemSKUCode": "563245",
							"InventoryMatrixItemQtyInStock": "140",
							"InventoryMatrixItemUnitCost": "120.00000"
						},
						{
							"InventoryMatrixItemSKUCode": "563246",
							"InventoryMatrixItemQtyInStock": "150",
							"InventoryMatrixItemUnitCost": "130.00000"
						}
					]
				}
			},
			{
				"ProductCode": "ProductCode1",
				"StockLocation": "PDX",
				"QtyInStock": "0",
				"UnitCost": "125.55556",
				"QtyOnPO": "0",
				"QtyOnSO": "0",
				"BinLocation": "BIN2",
				"InventoryMatrixItems": {
					"InventoryMatrixItem": [
						{
							"InventoryMatrixItemSKUCode": "563245",
							"InventoryMatrixItemQtyInStock": "60",
							"InventoryMatrixItemUnitCost": "30.00000"
						},
						{
							"InventoryMatrixItemSKUCode": "563246",
							"InventoryMatrixItemQtyInStock": "40",
							"InventoryMatrixItemUnitCost": "20.00000"
						}
					]
				}
			}
		]
	}
}
<ProductInventory>
    <StockLocationInventory>
        <ProductCode>ProductCode1</ProductCode>
        <StockLocation>OAK</StockLocation>
        <QtyInStock>990</QtyInStock>
        <UnitCost>125.55556</UnitCost>
        <QtyOnPO>0</QtyOnPO>
        <QtyOnSO>0</QtyOnSO>
        <BinLocation>BIN1</BinLocation>
        <InventoryMatrixItems>
            <InventoryMatrixItem>
                <InventoryMatrixItemSKUCode>563245</InventoryMatrixItemSKUCode>
                <InventoryMatrixItemQtyInStock>140</InventoryMatrixItemQtyInStock>
                <InventoryMatrixItemUnitCost>120.00000</InventoryMatrixItemUnitCost>
            </InventoryMatrixItem>
            <InventoryMatrixItem>
                <InventoryMatrixItemSKUCode>563246</InventoryMatrixItemSKUCode>
                <InventoryMatrixItemQtyInStock>150</InventoryMatrixItemQtyInStock>
                <InventoryMatrixItemUnitCost>130.00000</InventoryMatrixItemUnitCost>
            </InventoryMatrixItem>
        </InventoryMatrixItems>
    </StockLocationInventory>
    <StockLocationInventory>
        <ProductCode>ProductCode1</ProductCode>
        <StockLocation>PDX</StockLocation>
        <QtyInStock>0</QtyInStock>
        <UnitCost>125.55556</UnitCost>
        <QtyOnPO>0</QtyOnPO>
        <QtyOnSO>0</QtyOnSO>
        <BinLocation>BIN2</BinLocation>
        <InventoryMatrixItems>
            <InventoryMatrixItem>
                <InventoryMatrixItemSKUCode>563245</InventoryMatrixItemSKUCode>
                <InventoryMatrixItemQtyInStock>60</InventoryMatrixItemQtyInStock>
                <InventoryMatrixItemUnitCost>30.00000</InventoryMatrixItemUnitCost>
            </InventoryMatrixItem>
            <InventoryMatrixItem>
                <InventoryMatrixItemSKUCode>563246</InventoryMatrixItemSKUCode>
                <InventoryMatrixItemQtyInStock>40</InventoryMatrixItemQtyInStock>
                <InventoryMatrixItemUnitCost>20.00000</InventoryMatrixItemUnitCost>
            </InventoryMatrixItem>
        </InventoryMatrixItems>
    </StockLocationInventory>
</ProductInventory>
{
	"ProductsInventory": {
		"StockLocationInventory": [
			{
				"ProductCode": "ProductCode1",
				"StockLocation": "OAK",
				"QtyInStock": "20",
				"UnitCost": "10.00000",
				"QtyOnPO": "0",
				"QtyOnSO": "0",
				"BinLocation": "BIN1",
        "SerialNo":"125424"
			},
			{
				"ProductCode": "ProductCode1",
				"StockLocation": "PDX",
				"QtyInStock": "0",
				"UnitCost": "10.00000",
				"QtyOnPO": "0",
				"QtyOnSO": "0",
				"BinLocation": "BIN2",
        "SerialNo":"1254241"
			}
		]
	}
}
<ProductInventory>
    <StockLocationInventory>
        <ProductCode>ProductCode1</ProductCode>
        <StockLocation>OAK</StockLocation>
        <QtyInStock>20</QtyInStock>
        <UnitCost>10.00000</UnitCost>
        <QtyOnPO>0</QtyOnPO>
        <QtyOnSO>0</QtyOnSO>
        <BinLocation>BIN1</BinLocation>
      	<SerialNo>6556566</SerialNo>
    </StockLocationInventory>
    <StockLocationInventory>
        <ProductCode>ProductCode1</ProductCode>
        <StockLocation>PDX</StockLocation>
        <QtyInStock>0</QtyInStock>
        <UnitCost>10.00000</UnitCost>
        <QtyOnPO>0</QtyOnPO>
        <QtyOnSO>0</QtyOnSO>
        <BinLocation>BIN2</BinLocation>
      	<SerialNo>6556556</SerialNo>
    </StockLocationInventory>
</ProductInventory>
{
    "ProductsInventory": {
        "StockLocationInventory": [
            {
                "ProductCode": "ProductCode1",
                "StockLocation": "OAK",
                "CreatedTime": "09-14-2022 22:58:51",
                "CreatedTimeUTC": "2022-09-15 10:58:51",
                "ModifiedTime": "09-14-2022 23:00:17",
                "ModifiedTimeUTC": "2022-09-15 11:00:17",
                "QtyInStock": "45500",
                "UnitCost": "1.20000",
                "QtyOnPO": "0",
                "QtyOnSO": "1",
                "BinLocation": null,
                "InventoryLots": {
                    "InventoryLot": {
                        "LotNumber": "45555",
                        "LotQuantity": "45500",
                        "LotCreated": "09-14-2022 23:01:51",
                        "LotExpires": "09-15-2022 23:01:00",
                        "LotOperator": "Operator"
                    }
                }
            },
            {
                "ProductCode": "ProductCode2",
                "StockLocation": "PDX",
                "CreatedTime": "09-14-2022 22:58:51",
                "CreatedTimeUTC": "2022-09-15 10:58:51",
                "ModifiedTime": "09-14-2022 23:00:17",
                "ModifiedTimeUTC": "2022-09-15 11:00:17",
                "QtyInStock": "76985",
                "UnitCost": "1.20000",
                "QtyOnPO": "0",
                "QtyOnSO": "0",
                "BinLocation": "LA",
                "InventoryLots": {
                    "InventoryLot": [
                        {
                            "LotNumber": "111111",
                            "LotQuantity": "11185",
                            "LotCreated": "09-14-2022 23:02:35",
                            "LotExpires": "09-15-2022 23:02:00",
                            "LotOperator": "Operator"
                        },
                        {
                            "LotNumber": "8547125687",
                            "LotQuantity": "65800",
                            "LotCreated": "09-14-2022 23:02:35",
                            "LotExpires": "09-15-2022 23:02:00",
                            "LotOperator": "Operator"
                        }
                    ]
                }
            }
        ],
        "TotalRecords": "2",
        "CurrentPage": "1",
        "TotalPages": "1",
        "PageSize": "50"
    }
}
<ProductsInventory>
		<StockLocationInventory>
			<ProductCode>ProductCode1</ProductCode>
			<StockLocation>OAK</StockLocation>
			<CreatedTime>09-14-2022 22:58:51</CreatedTime>
			<CreatedTimeUTC>2022-09-15 10:58:51</CreatedTimeUTC>
			<ModifiedTime>09-14-2022 23:00:17</ModifiedTime>
			<ModifiedTimeUTC>2022-09-15 11:00:17</ModifiedTimeUTC>
			<QtyInStock>45500</QtyInStock>
			<UnitCost>1.20000</UnitCost>
			<QtyOnPO>0</QtyOnPO>
			<QtyOnSO>1</QtyOnSO>
			<BinLocation />
			<InventoryLots>
				<InventoryLot>
					<LotNumber>45555</LotNumber>
					<LotQuantity>45500</LotQuantity>
					<LotCreated>09-14-2022 23:01:51</LotCreated>
					<LotExpires>09-15-2022 23:01:00</LotExpires>
					<LotOperator>Operator</LotOperator>
				</InventoryLot>
			</InventoryLots>
		</StockLocationInventory>
		<StockLocationInventory>
			<ProductCode>ProductCode2</ProductCode>
			<StockLocation>PDX</StockLocation>
			<CreatedTime>09-14-2022 22:58:51</CreatedTime>
			<CreatedTimeUTC>2022-09-15 10:58:51</CreatedTimeUTC>
			<ModifiedTime>09-14-2022 23:00:17</ModifiedTime>
			<ModifiedTimeUTC>2022-09-15 11:00:17</ModifiedTimeUTC>
			<QtyInStock>76985</QtyInStock>
			<UnitCost>1.20000</UnitCost>
			<QtyOnPO>0</QtyOnPO>
			<QtyOnSO>0</QtyOnSO>
			<BinLocation>LA</BinLocation>
			<InventoryLots>
				<InventoryLot>
					<LotNumber>111111</LotNumber>
					<LotQuantity>11185</LotQuantity>
					<LotCreated>09-14-2022 23:02:35</LotCreated>
					<LotExpires>09-15-2022 23:02:00</LotExpires>
					<LotOperator>Operator</LotOperator>
				</InventoryLot>
				<InventoryLot>
					<LotNumber>8547125687</LotNumber>
					<LotQuantity>65800</LotQuantity>
					<LotCreated>09-14-2022 23:02:35</LotCreated>
					<LotExpires>09-15-2022 23:02:00</LotExpires>
					<LotOperator>Operator</LotOperator>
				</InventoryLot>
			</InventoryLots>
		</StockLocationInventory>
		<TotalRecords>2</TotalRecords>
		<CurrentPage>1</CurrentPage>
		<TotalPages>1</TotalPages>
		<PageSize>50</PageSize>
	</ProductsInventory>

Sample Response

{
    "MCM": {
        "response": {
            "objectType": "Products",
            "syncTime": "2021-06-15 13:30:32"
        },
        "parameters": {
            "results": {
                "message": {
                    "ProductsInventory": {
                        "Success": {
                            "ProductInventory": [
                                {
                                    "ProductCode": "ProductCode1"
                                },
                                {
                                    "ProductCode": "ProductCode1"
                                }
                            ]
                        },
                        "SuccessNumber": "2",
                        "FailureNumber": "0"
                    }
                }
            }
        }
    }
}
<MCM>
		<response>
			<objectType>Products</objectType>
			<syncTime>2021-06-15 13:30:32</syncTime>
		</response>
		<parameters>
			<results>
				<message>
					<ProductsInventory>
						<Success>
							<ProductInventory>
								<ProductCode>ProductCode1</ProductCode>
							</ProductInventory>
							<ProductInventory>
								<ProductCode>ProductCode1</ProductCode>
							</ProductInventory>
						</Success>
						<SuccessNumber>2</SuccessNumber>
						<FailureNumber>0</FailureNumber>
					</ProductsInventory>
				</message>
			</results>
		</parameters>
	</MCM>

WADL

<?xml version="1.0" encoding="utf-8"?>
<application>
   <resources base="https://{yourCompany}.agiliron.net/agiliron/api-40/">
     <resource path="ProductsInventory">
       <method name="POST">
         <request>
           <param name="key" type="xsd:string" style="query" required="true"/>
           <param name="ProductCode" type="xsd:string" style="body" required="true"/>
           <param name="StockLocation" type="xsd:string" style="body" required="true"/>
           <param name="QtyInStock" type="xsd:string" style="body"/>
           <param name="UnitCost" type="xsd:decimal" style="body"/>
           <param name="QtyOnPO" type="xsd:int" style="body"/>
           <param name="QtyOnSO" type="xsd:int" style="body"/>
           <param name="BinLocation" type="xsd:string" style="body"/>
         </request> 
         <response status="200"> 
            <representation mediaType="application/xml" element="yn:ResultSet"/> 
         </response> 
         <response status="400"> 
            <representation mediaType="application/xml" element="ya:Error"/> 
         </response> 
       </method> 
     </resource> 
   </resources>
 </application>
<?xml version="1.0" encoding="utf-8"?>
<application>
   <resources base="https://{yourCompany}.agiliron.net/agiliron/api-40/">
     <resource path="ProductsInventory">
       <method name="POST">
         <request>
           <param name="key" type="xsd:string" style="query" required="true"/>
           <param name="ProductCode" type="xsd:string" style="body" required="true"/>
           <param name="StockLocation" type="xsd:string" style="body" required="true"/>
           <param name="QtyInStock" type="xsd:string" style="body"/>
           <param name="UnitCost" type="xsd:decimal" style="body"/>
           <param name="QtyOnPO" type="xsd:int" style="body"/>
           <param name="QtyOnSO" type="xsd:int" style="body"/>
           <param name="BinLocation" type="xsd:string" style="body"/>
           <param name="InventoryMatrixItemSKUCode" type="xsd:string" style="body"/>
           <param name="InventoryMatrixItemQtyInStock" type="xsd:int" style="body"/>
           <param name="InventoryMatrixItemUnitCost" type="xsd:decimal" style="body"/>
         </request> 
         <response status="200"> 
            <representation mediaType="application/xml" element="yn:ResultSet"/> 
         </response> 
         <response status="400"> 
            <representation mediaType="application/xml" element="ya:Error"/> 
         </response> 
       </method> 
     </resource> 
   </resources>
 </application>

© Copyright 2022 Agiliron - All Rights Reserved.