截至 API 版本 2026-04,您可以在查询 InventoryItem 和 Location 上的 inventoryLevels 或 inventoryLevel 字段时传递 includeInactive: true,以便在响应中包含非活跃库存级别。默认情况下,仅返回活跃库存级别。
我们做出此变更的原因
此前,无法通过 API 检索非活跃库存级别。includeInactive 参数使应用程序能够明确控制是否在结果中包含非活跃级别。
对您的应用的影响
- GraphQL:在 2026-04 及更高版本的 API 中,InventoryItem.inventoryLevels、InventoryItem.inventoryLevel、Location.inventoryLevels 和 Location.inventoryLevel 字段接受一个新的可选 includeInactive 布尔参数。默认值为 false,以确保现有查询不受影响。
您需要执行的操作
- 现有查询无需进行任何更改,因为它们将继续仅返回活跃库存水平。
- 要访问非活跃库存级别,请在您的查询中包含 includeInactive: true。

