Stock Report

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 for
  • area: id of area to filter for
  • status: item status to filter for
  • search_term: search term to match items against
  • supplier: id of supplier to filter for
  • category: id of product group to filter for
  • offset: starting offset for pagination - default value is 0
  • limit: maximum number of items on one page - default value is 25

Status codes

  • 200 on success
  • 202 while 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 a count and may have an ml value for a fractional quantity.
  • stock.summary: Aggregated stock across those entries. It has a count and may have an ml value for the remaining fractional quantity.
  • price and total: 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 summary price is 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
        }
      }
    }
  ]
}