Trying to update cost

Hi Guys

I’m building an app that can update my products price but from some reason cannot update the cost. I’m able to read all the product info including the cost, write back the price. But whatever I do the cost update is failing. I use inventoryCostAdjustmentWrite but it fails and chatgpt/gemini insist that update to cost is restricted in the basic plan. This sounds odd..
Any advice?

Hi @Udi_Zisser

Updating the cost of a product via the API shouldn’t be restricted by the plan type. Can you share a full query and response, removing any sensitive data? Before you update the cost, are you fetching the inventoryItem ID associated with the product variant you want to update?

I am building a custom embedded app and can successfully fetch the inventory item ID for a product variant using this query:

query VariantBySku($query: String!) {
  productVariants(first: 10, query: $query) {
    edges {
      node {
        id
        sku
        inventoryItem {
          id
          unitCost {
            amount
            currencyCode
          }
        }
      }
    }
  }
}

This returns the correct inventory item ID, for example:

"inventoryItem": {
  "id": "gid://shopify/InventoryItem/44572686024781",
  "unitCost": { "amount": "77.00", "currencyCode": "USD" }
}

However, when I try to update the cost using Shopify’s documented mutation:

mutation InventoryCostAdjustmentWrite(
  $inventoryItemId: ID!
  $unitCost: MoneyInput!
  $reason: InventoryCostAdjustmentReason!
) {
  inventoryCostAdjustmentWrite(
    inventoryItemId: $inventoryItemId
    unitCost: $unitCost
    reason: $reason
  ) {
    userErrors {
      field
      message
    }
  }
}

the API returns:

Error: InventoryCostAdjustmentReason isn't a defined input type

To verify, I tested the schema:

{
  __type(name: "InventoryCostAdjustmentReason") {
    enumValues { name }
  }
}

This returns:

null

meaning the mutation and enum are missing from the Admin API schema for this store/app.

My app is using API version 2026-01 and has the scopes:

write_products
write_inventory

I am building a custom embedded app and can successfully fetch the inventory item ID for a product variant using this query:

query VariantBySku($query: String!) {
  productVariants(first: 10, query: $query) {
    edges {
      node {
        id
        sku
        inventoryItem {
          id
          unitCost {
            amount
            currencyCode
          }
        }
      }
    }
  }
}

This returns the correct inventory item ID, for example:

"inventoryItem": {
  "id": "gid://shopify/InventoryItem/44572686024781",
  "unitCost": { "amount": "77.00", "currencyCode": "USD" }
}

However, when I try to update the cost using Shopify’s documented mutation:

mutation InventoryCostAdjustmentWrite(
  $inventoryItemId: ID!
  $unitCost: MoneyInput!
  $reason: InventoryCostAdjustmentReason!
) {
  inventoryCostAdjustmentWrite(
    inventoryItemId: $inventoryItemId
    unitCost: $unitCost
    reason: $reason
  ) {
    userErrors {
      field
      message
    }
  }
}

the API returns:

Error: InventoryCostAdjustmentReason isn't a defined input type

To verify, I tested the schema:

{
  __type(name: "InventoryCostAdjustmentReason") {
    enumValues { name }
  }
}

This returns:

null

meaning the mutation and enum are missing from the Admin API schema for this store/app.

My app is using API version 2026-01 and has the scopes:

write_products
write_inventory

I’ve tested out a mutation that’s structured differently and I’ve been able to update the cost of a variant:

mutation UpdateInventoryCost {
  inventoryItemUpdate(
    id: "gid://shopify/InventoryItem/xxxxxxxxxxxxx",
    input: {
      cost: 12.34
    }
  ) {
    inventoryItem {
      id
      unitCost {
        amount
      }
    }
    userErrors {
      message
    }
  }
}

I ran the above in the GraphiQL app, and when I check the variant in the admin UI, it’s updated: