Read list of Items

GET /items

Use this endpoint to find Items in your account. Without a status filter, it includes active and inactive (archived) Items, but not deleted Items. Use GET /items/deleted for deleted Items.

Parameters

All query parameters are optional.

  • offset: Pagination offset, the index of the first item returned. Defaults to 0.
  • limit: Page size for pagination, defaults to 25. Use a reasonable page size when reading large collections.
  • status: Filter by Item status: "ACTIVE" for active Items or "INACTIVE" for archived Items.
  • category: Filter by Product group. Use its id from GET /categories.
  • supplier: Filter by supplier. The value is the numeric supplier id.
  • search_term: Search Item names.
  • scope: Select which Items to query. One of "all", "connect", "order", "order:favorites" or "favorites"; omit it for the account's Items. Some scopes require additional parameters.
  • area: Area ID used with the "favorites" scope or an inspection list. (optional)
  • from_area: Area ID required for the "order" and "order:favorites" scopes. (optional)
  • division: Division ID for order scopes. (optional)
  • list: Inspection list ID or "none"; requires area. (optional)
  • expand: Additional data to include. One of "connect", "shop" or an area reference in the format "area:<id>". (optional)

The "connect" scope reads a YBM Connect Supplier's products as Item-style results and requires one supplier and an X-Timezone-Offset request header. For the Supplier's raw catalogue and the IDs needed to import products, use GET /suppliers/:id/items. The "all" scope searches across your Items and connected Supplier catalogues; it also requires the header. When your account has connected Suppliers, an "all" request without search_term returns an empty list. The header is the client's time-zone offset in minutes (for example, 0 for UTC). expand=connect or expand=shop also requires it. scope=all requires UPDATE_DETAILS permission on Items in addition to read access.

scope=order:favorites uses a fixed maximum of 1,000 Items; offset and limit do not paginate that scope.

Status codes

  • 200 on success
  • 202 while the search index is being prepared; retry the request later
  • 400 on invalid request parameter

Response properties

  • total: The total number of items that fulfill the filter criteria.
  • items: The array of Item objects.
  • cache_status: Present with a 202 response instead of results.

Depending on the request, an Item may also have source ("account" or "connect") in a combined search, area_defined with expand=area:<id>, or connected supplier and ordering details with expand=connect or expand=shop. See Item details and YBM Connect Items.

You can see all the Item properties on the GET /items/:id page under "Response properties".

Example request

Query the first 25 items:

GET /items

Query the first 33 active items:

GET /items?status=ACTIVE&limit=33

Query the first 25 active items for a specific supplier:

GET /items?status=ACTIVE&supplier=1693919950079

Query the second page of items, each page containing 50 items.

GET /items?offset=50&limit=50

Example response

{
  "total": 2,
  "items": [
    {
      "id": "itm_oh0IyIjqvd",
      "category": "cat_KaNDv51Gh0",
      "name": "Vodka",
      "vessel": {
        "size": 7,
        "unit": "dl",
        "type": "BO"
      },
      "bundles": [
        {
          "type": "CT",
          "size": 6
        }
      ],
      "price": 750,
      "supplier": {
        "id": 1693919950079,
        "reference": "1100992"
      }
    },
    {
      "id": "itm_xAWy4N9VCg",
      "category": "cat_myTRpvnsNb",
      "name": "Chicken breast",
      "vessel": {
        "size": 1,
        "unit": "kg"
      },
      "price": 990,
      "price_per": "kg",
      "order_by": "kg",
      "supplier": {
        "id": 1663919969543,
        "reference": "prd-chicken-998"
      }
    }
  ]
}