库存物品更新-inventoryItemUpdate mutation

更新库存项目。

所需的访问

write_inventory 访问范围。


在本页面


互动范例

这是一个示例变异查询。

变异ventoryItemUpdate ($ id :ID !,$ input :InventoryItemUpdateInput !){ 库存商品更新(id :$ id ,输入:$ input ){
  1. <font style="color:#1F61A0;">库存物品</font><font style="color:#555555;">{</font>
  2. <font style="color:#1F61A0;">ID</font>
  3. <font style="color:#555555;">}</font>
  4. <font style="color:#1F61A0;">userErrors </font><font style="color:#555555;">{</font>
  5. <font style="color:#1F61A0;">场地</font>
  6. <font style="color:#1F61A0;">信息</font>
  7. <font style="color:#555555;">}</font>
} } { “ id” :“ Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE =” , “输入” :{} }


参数

参数 描述
id
() [ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

必需的
要更新的库存项目的ID。
input
() [InventoryItemUpdateInput!](https://shopify.dev/docs/admin-api/graphql/reference/inventory/inventoryitemupdateinput)

必需的
库存项目的更新属性。


InventoryItemUpdateInput字段

  • 费用([Decimal](https://shopify.dev/docs/admin-api/graphql/reference/scalar#decimal-2021-01))
    与库存项目关联的单位成本,货币是商店的默认货币。
  • countryCodeOfOrigin([CountryCode](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/countrycode))
    原产国的ISO代码。
  • countryHarmonizedSystemCodes([[CountryHarmonizedSystemCodeInput!]](https://shopify.dev/docs/admin-api/graphql/reference/inventory/countryharmonizedsystemcodeinput))
    特定于国家/地区的协调系统代码列表。
  • harmonizedSystemCode([String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
    库存物料的统一系统代码。
  • provinceCodeOfOrigin([String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
    原产省的ISO代码。
  • 已追踪([Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01))
    是否跟踪库存项目。


返回字段

  • 库存物品([InventoryItem](https://shopify.dev/docs/admin-api/graphql/reference/inventory/inventoryitem))
    更新的库存项目。
  • userErrors([[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror))
    执行突变时发生的错误列表。