Anchor to inventoryItemUpdateinventory
inventoryItemUpdate
mutation
Requires access scope. Also: The user must have a permission to update an inventory item.
Updates an inventory item.
Anchor to Arguments
Arguments
- •ID!required
The ID of the inventory item to update.
- Anchor to inputinput•Inventory
Item requiredUpdate Input!
Was this section helpful?
Anchor to InventoryItemUpdatePayload returnsInventoryItemUpdatePayload returns
- Anchor to inventoryIteminventory•
Item The inventory item that was updated.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
mutation inventoryItemUpdate($id: ID!, $input: InventoryItemUpdateInput!) {
inventoryItemUpdate(id: $id, input: $input) {
inventoryItem {
# InventoryItem fields
}
userErrors {
field
message
}
}
}
Input
{
"id": "gid://shopify/<objectName>/10079785100",
"input": {
"cost": "29.99",
"countryCodeOfOrigin": "",
"countryHarmonizedSystemCodes": [
{
"countryCode": "",
"harmonizedSystemCode": "<your-harmonizedSystemCode>"
}
],
"harmonizedSystemCode": "<your-harmonizedSystemCode>",
"provinceCodeOfOrigin": "<your-provinceCodeOfOrigin>",
"tracked": true
}
}
{
"id": "gid://shopify/<objectName>/10079785100",
"input": {
"cost": "29.99",
"countryCodeOfOrigin": "",
"countryHarmonizedSystemCodes": [
{
"countryCode": "",
"harmonizedSystemCode": "<your-harmonizedSystemCode>"
}
],
"harmonizedSystemCode": "<your-harmonizedSystemCode>",
"provinceCodeOfOrigin": "<your-provinceCodeOfOrigin>",
"tracked": true
}
}
input InventoryItemUpdateInput {
cost: Decimal
countryCodeOfOrigin: CountryCode
countryHarmonizedSystemCodes: [CountryHarmonizedSystemCodeInput!]
harmonizedSystemCode: String
provinceCodeOfOrigin: String
tracked: Boolean
}
input CountryHarmonizedSystemCodeInput {
countryCode: CountryCode!
harmonizedSystemCode: String!
}