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 is0
limit
: maximum number of items on one page - default value is25
Status codes
200
on success
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
: The stock information. Contains the following properties:queue
: the current stock queue - stock amounts pruchased at different price points. Each entry has the same properties as the summary:count
,ml
(optional),price
,total
summary
: summary entry with average price and totals.count
: total count of all stockml
: total fractional count (optional)price
: average pricetotal
: total value of the stock
Example response
{
"total": 2,
"entries": [
{
"item": {
"category": "cat_______TEST",
"id": "itm_nrqkSr14q2",
"name": "Test Bottle",
"vessel": {
"size": 700,
"unit": "ml"
}
},
"stock": {
"queue": [
{ "count": 49, "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
}
}
}
]
}