Stock On Hand
The StockOnHand resource allows stock on hand to be listed, or viewed. An individual product’s StockOnHand details can be viewed by appending its identifier (a GUID formatted as XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
) to the URI.
Note: Products without any transactions will not be returned (i.e; zero quantity products with no previous transactions).
The full range of URIs and HTTP Verbs supported are:
Operation
HTTP Action
List a page of stock on hand data
GET /StockOnHand
View stock on hand for a specific product
GET /StockOnHand/{productGuid}
View stock on hand for a specific product for all warehouses
GET /StockOnHand/{productGuid}/AllWarehouses
GET Stock On Hand
Available Filters for GET StockOnHand endpoint
Filter
Description
asAtDate
Returns the Stock on Hand for a specific date.
isAssembled
If set to true
, the AvailableQty
will also include the quantity that can be assembled via any auto-assembly BOMs.
modifiedSince
Returns Stock on Hand created or modified since the specified date. Please note this filter is not available for single product queries.
orderBy
Orders the list by a specific column, by default the list is ordered by productCode
.
productId
Returns products with the specific Product Guid. You can enter multiple product guids separated by commas.
warehouseCode
Returns Stock on Hand for a specific warehouse code.
warehouseName
Returns Stock on Hand for a specific warehouse name.
Note: Date filters should be provided in the ISO format YYYY-MM-DD.
Filters are used by adding the filter and value to the URI:
/StockOnHand?warehouseCode=ACME&asAtDate=2012-01-01
Available Fields for GET StockOnHand endpoint
Property
Type
Length
Notes
AllocatedQty
Decimal
AvailableQty
Decimal
Quantity on hand - allocated quantity + quantity that can be assembled based on components
AvgCost
Decimal
DaysSinceLastSale
Nullable Integer
Guid
Guid
Unique identifier.
LastModifiedOn
Nullable DateTime
OnPurchase
Decimal
ProductCode
String
100
ProductDescription
String
500
ProductGroupName
String
450
ProductGuid
Guid
ProductSourceId
String
500
QtyOnHand
Decimal
TotalCost
Decimal
Warehouse
String
100
WarehouseCode
String
15
WarehouseId
Guid
Examples for Response GET /StockOnHand
show xml example
<?xml version="1.0"?>
<StockOnHandList xmlns:xsd= "http://www.w3.org/2001/XMLSchema" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xmlns= "http://api.unleashedsoftware.com/version/1" >
<Pagination>
<NumberOfItems> 2</NumberOfItems>
<PageSize> 200</PageSize>
<PageNumber> 1</PageNumber>
<NumberOfPages> 1</NumberOfPages>
</Pagination>
<StockOnHand>
<Guid> 7fc624f7-738a-4e95-aed1-758662372899</Guid>
<LastModifiedOn> 2016-10-08T20:31:25.963</LastModifiedOn>
<ProductCode> BOOKSHELF</ProductCode>
<ProductDescription> Wooden Bookshelf</ProductDescription>
<ProductGuid> 7fc624f7-738a-4e95-aed1-758662372899</ProductGuid>
<ProductGroupName> Furniture</ProductGroupName>
<WarehouseId></WarehouseId>
<WarehouseCode></WarehouseCode>
<Warehouse></Warehouse>
<DaysSinceLastSale> 12</DaysSinceLastSale>
<OnPurchase> 0.0000</OnPurchase>
<AllocatedQty> 0.0000</AllocatedQty>
<AvailableQty> 81.8000</AvailableQty>
<QtyOnHand> 69.0000</QtyOnHand>
<AvgCost> 1774.93449333333333</AvgCost>
<TotalCost> 122470.480040</TotalCost>
</StockOnHand>
<StockOnHand>
<Guid> 5cf1c9ba-89de-4f59-879c-c08a447fd49c</Guid>
<LastModifiedOn> 2015-06-22T02:32:20.74</LastModifiedOn>
<ProductCode> BOOK</ProductCode>
<ProductDescription> Book of Spells</ProductDescription>
<ProductGuid> 5cf1c9ba-89de-4f59-879c-c08a447fd49c</ProductGuid>
<ProductGroupName> Gift</ProductGroupName>
<WarehouseId />
<Warehouse />
<WarehouseCode />
<DaysSinceLastSale> 282</DaysSinceLastSale>
<OnPurchase> 0.0000</OnPurchase>
<AllocatedQty> 0.0000</AllocatedQty>
<AvailableQty> 252.0000</AvailableQty>
<QtyOnHand> 252.0000</QtyOnHand>
<AvgCost> 12.45391666666667</AvgCost>
<TotalCost> 3138.387000</TotalCost>
</StockOnHand>
</StockOnHandList>
show json example
{
"Pagination" : {
"NumberOfItems" : 2 ,
"PageSize" : 200 ,
"PageNumber" : 1 ,
"NumberOfPages" : 1
},
"Items" : [
{
"ProductCode" : "BOOKSHELF" ,
"ProductDescription" : "Wooden Bookshelf" ,
"ProductGuid" : "7fc624f7-738a-4e95-aed1-758662372899" ,
"ProductSourceId" : null ,
"ProductGroupName" : "Furniture" ,
"WarehouseId" : "" ,
"Warehouse" : "" ,
"WarehouseCode" : "" ,
"DaysSinceLastSale" : 12 ,
"OnPurchase" : 0 ,
"AllocatedQty" : 0 ,
"AvailableQty" : 81.8 ,
"QtyOnHand" : 69 ,
"AvgCost" : 1774.93449333333333 ,
"TotalCost" : 122470.48004 ,
"Guid" : "7fc624f7-738a-4e95-aed1-758662372899" ,
"LastModifiedOn" : "/Date(1475958685963)/"
},
{
"ProductCode" : "BOOK" ,
"ProductDescription" : "Book of Spells" ,
"ProductGuid" : "5cf1c9ba-89de-4f59-879c-c08a447fd49c" ,
"ProductSourceId" : null ,
"ProductGroupName" : "Gift" ,
"WarehouseId" : "" ,
"Warehouse" : "" ,
"WarehouseCode" : "" ,
"DaysSinceLastSale" : 282 ,
"OnPurchase" : 0 ,
"AllocatedQty" : 0 ,
"AvailableQty" : 252 ,
"QtyOnHand" : 252 ,
"AvgCost" : 12.45391666666667 ,
"TotalCost" : 3138.387 ,
"Guid" : "5cf1c9ba-89de-4f59-879c-c08a447fd49c" ,
"LastModifiedOn" : "/Date(1434940340740)/"
}
]
}
Examples for Response GET /StockOnHand/{productGuid}
show xml example
<?xml version="1.0"?>
<StockOnHand xmlns:xsd= "http://www.w3.org/2001/XMLSchema" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xmlns= "http://api.unleashedsoftware.com/version/1" >
<Guid> 111d5b06-04e1-4785-b7a9-7a72e28cd757</Guid>
<LastModifiedOn> 2016-10-09T00:50:23.96</LastModifiedOn>
<ProductCode> BOOKSHELF</ProductCode>
<ProductDescription> Wooden Bookshelf</ProductDescription>
<ProductGuid> 111d5b06-04e1-4785-b7a9-7a72e28cd757</ProductGuid>
<ProductGroupName> Furniture</ProductGroupName>
<WarehouseId />
<Warehouse />
<WarehouseCode />
<DaysSinceLastSale> 17</DaysSinceLastSale>
<OnPurchase> 0.0000</OnPurchase>
<AllocatedQty> 0.0000</AllocatedQty>
<AvailableQty> 93.0000</AvailableQty>
<QtyOnHand> 75.0000</QtyOnHand>
<AvgCost> 1774.93449333333333</AvgCost>
<TotalCost> 133120.087000</TotalCost>
</StockOnHand>
show json example
{
"ProductCode" : "BOOKSHELF" ,
"ProductDescription" : "Wooden Bookshelf" ,
"ProductGuid" : "111d5b06-04e1-4785-b7a9-7a72e28cd757" ,
"ProductSourceId" : null ,
"ProductGroupName" : "Furniture" ,
"WarehouseId" : "" ,
"Warehouse" : "" ,
"WarehouseCode" : "" ,
"DaysSinceLastSale" : 17 ,
"OnPurchase" : 0 ,
"AllocatedQty" : 0 ,
"AvailableQty" : 75 ,
"QtyOnHand" : 75 ,
"AvgCost" : 1774.93449333333333 ,
"TotalCost" : 133120.087 ,
"Guid" : "111d5b06-04e1-4785-b7a9-7a72e28cd757" ,
"LastModifiedOn" : "/Date(1475974223960)/"
}
Examples for Response GET /StockOnHand/{productGuid}/AllWarehouses
show xml example
<?xml version="1.0"?>
<StockOnHandList xmlns:xsd= "http://www.w3.org/2001/XMLSchema" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xmlns= "http://api.unleashedsoftware.com/version/1" >
<StockOnHand>
<WarehouseId> 705efc56-abd4-4d6c-9262-418a3084f2da</WarehouseId>
<Warehouse> Main Warehouse</Warehouse>
<AvailableQty> 69.0000</AvailableQty>
</StockOnHand>
<StockOnHand>
<WarehouseId> 6ba9df7b-7538-4e8a-94fa-4c0841d9382f</WarehouseId>
<Warehouse> Head Office</Warehouse>
<AvailableQty> 6.0000</AvailableQty>
</StockOnHand>
</StockOnHandList>
show json example
{
"Items" : [
{
"WarehouseId" : "705efc56-abd4-4d6c-9262-418a3084f2da" ,
"Warehouse" : "Main Warehouse" ,
"AvailableQty" : 69
},
{
"WarehouseId" : "6ba9df7b-7538-4e8a-94fa-4c0841d9382f" ,
"Warehouse" : "Head Office" ,
"AvailableQty" : 6
}
]
}