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