GET /reports/stock
This report returns the current stock for all items that match the query criteria. The response is paginated and if no limit is set it defaults to 25 entries per page.
Parameters
All query parameters are optional.
division: id of division (location) to filter forarea: id of area to filter forstatus: item status to filter forsearch_term: search term to match items againstsupplier: id of supplier to filter forcategory: id of product group to filter foroffset: starting offset for pagination - default value is0limit: maximum number of items on one page - default value is25
Status codes
200on success202while the item index is being prepared; retry after a short delay
Response properties
total: The total number of items that fulfill the filter criteria.entries: The array of "Item stock" objects.
Item Stock object
item: The item properties. You can see all possible properties on the GET /items/:id page under "Response properties".stock.queue: Stock at individual price points, sorted from the lowest to the highest price. Each entry has acountand may have anmlvalue for a fractional quantity.stock.summary: Aggregated stock across those entries. It has acountand may have anmlvalue for the remaining fractional quantity.priceandtotal: Unit price and stock value. These fields appear in queue entries and the summary only when the API token has permission to read Item prices. The summarypriceis an average.
A 202 response contains empty entries, total: 0 and cache_status. It does not mean that the account has no stock.
Example response
{
"total": 2,
"entries": [
{
"item": {
"category": "cat_______TEST",
"id": "itm_nrqkSr14q2",
"name": "Test Bottle",
"vessel": {
"size": 700,
"unit": "ml"
}
},
"stock": {
"queue": [
{ "count": 50, "price": 1150, "total": 57500 },
{ "count": 12, "ml": 350, "price": 1250, "total": 15625 }
],
"summary": {
"count": 62,
"ml": 350,
"price": 1170,
"total": 73125
}
}
},
{
"item": {
"category": "cat_______REST",
"id": "itm_E8duEU5qLM",
"name": "Some OutOfStock Thing",
"vessel": {
"size": 500,
"unit": "g"
}
},
"stock": {
"queue": [],
"summary": {
"count": 0,
"price": 0,
"total": 0
}
}
}
]
}