大数跨境

为 inventoryLevels 和 inventoryLevel 字段添加 includeInactive 参数

为 inventoryLevels 和 inventoryLevel 字段添加 includeInactive 参数 Shopify电商独立站
2026-04-17
2
导读:截至 API 版本 2026-04,在查询库存级别(Inventory Levels)或库存项(Inventory Item)和位置(Location)的库存级别字段时,您可以传入 include I

截至 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。
【声明】内容源于网络
0
0
Shopify电商独立站
1234
内容 7146
粉丝 0
Shopify电商独立站 1234
总阅读87.4k
粉丝0
内容7.1k