younifyd
Menu

inventoryItemUpdate

Updates an InventoryItem's properties including whether inventory is tracked, cost, SKU, and whether shipping is required.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the inventoryItemUpdate action (under Inventory).
  3. Fill in the fields below, then reference the result from later steps as {{inventoryitemupdate.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation InventoryItemUpdate($id: ID!, $input: InventoryItemInput!) {
  inventoryItemUpdate(id: $id, input: $input) {
    inventoryItem {
      countryCodeOfOrigin
      createdAt
      duplicateSkuCount
      harmonizedSystemCode
      id
      inventoryHistoryUrl
      legacyResourceId
      locationsCount {
        count
        precision
      }
      measurement {
        id
        weight
      }
      provinceCodeOfOrigin
      requiresShipping
      sku
      tracked
      trackedEditable {
        locked
        reason
      }
      unitCost {
        amount
        currencyCode
      }
      updatedAt
      variant {
        availableForSale
        availablePublicationsCount
        barcode
        compareAtPrice
        createdAt
        defaultCursor
        deliveryProfile
        displayName
        id
        inventoryItem
        inventoryPolicy
        inventoryQuantity
        legacyResourceId
        position
        price
        product
        publishedOnCurrentChannel
        publishedOnCurrentPublication
        requiresComponents
        selectedOptions
        sellableOnlineQuantity
        sellingPlanGroupCount
        sellingPlanGroupsCount
        showUnitPrice
        sku
        storefrontId
        taxCode
        taxable
        title
        unitPrice
        unitPriceMeasurement
        updatedAt
      }
    }
    userErrors {
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

idstringrequired

The ID of the inventory item to update.

inputobjectrequired

The input fields that update an [`inventoryItem`](https://shopify.dev/api/admin-graphql/latest/queries/inventoryitem).

skustring
coststring
trackedboolean
countryCodeOfOriginstring

One ofAFAXALDZADAOAIAGARAMAWACAUATAZBSBHBDBBBYBEBZBJBMBTBOBABWBVBRIOBNBGBFBIKHCACVBQKY

harmonizedSystemCodestring
countryHarmonizedSystemCodesarray<object>2 fields
provinceCodeOfOriginstring
measurementobject2 fields
requiresShippingboolean
json
{
  "id": "string",
  "input": {
    "sku": "string",
    "cost": "string",
    "tracked": false,
    "countryCodeOfOrigin": "AF",
    "harmonizedSystemCode": "string",
    "countryHarmonizedSystemCodes": [
      {
        "harmonizedSystemCode": "string",
        "countryCode": "string"
      }
    ],
    "provinceCodeOfOrigin": "string",
    "measurement": {
      "weight": {
        "value": "string",
        "unit": "string"
      },
      "shippingPackageId": "string"
    },
    "requiresShipping": false
  }
}

Response

Read the result with {{inventoryitemupdate.response.data.data.inventoryItemUpdate}}. If the API returns errors, the step fails and they are at {{inventoryitemupdate.response.data.errors}}.

inventoryItemobject
countryCodeOfOriginstring

One ofAFAXALDZADAOAIAGARAMAWACAUATAZBSBHBDBBBYBEBZBJBMBTBOBABWBVBRIOBNBGBFBIKHCACVBQKY

createdAtstring
duplicateSkuCountnumber
harmonizedSystemCodestring
idstring
inventoryHistoryUrlstring
legacyResourceIdstring
locationsCountobject2 fields
measurementobject2 fields
provinceCodeOfOriginstring
requiresShippingboolean
skustring
trackedboolean
trackedEditableobject2 fields
unitCostobject2 fields
updatedAtstring
variantobject32 fields
userErrorsarray<object>
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

Was this page helpful?