How to add sku to product variant via graphQL

Topic summary

Core Issue:
Developers are struggling to add or update SKUs for product variants using Shopify’s GraphQL API without relying on deprecated methods.

Initial Problem (API 2024-04):

  • The productVariantUpdate mutation’s sku field is deprecated
  • Documentation suggests using inventoryItem.sku instead, but InventoryItemInput doesn’t accept sku as an argument
  • This creates a conflict between avoiding deprecated methods and functional implementation

Solution for API 2024-07:
Upgrading to version 2024-07 allows passing sku within the inventoryItem object, resolving the initial issue.

New Challenge (API 2025-01):

  • Users report inability to save SKUs when creating new products
  • Products without variants cannot have SKUs assigned during creation
  • Prices also fail to save during productCreate mutations

Workaround for 2025-01:

  1. Create the product first (generates a default variant)
  2. Retrieve the variant ID
  3. Use productVariantsBulkUpdate mutation to add SKU and price to the variant’s inventoryItem

The discussion remains open as developers adapt to the two-step process required in the latest API version.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

I’m using the Shopify GraphiQL App to set up my mutations, and I’m using the GraphQL docs as a reference. The docs say that updating the sku using the productVariantUpdate mutation is deprecated and to use inventoryItem.sku instead, however InventoryItemInput does not have sku as an option and I get a type error when I try to use it in this mutation “InputObject ‘InventoryItemInput’ doesn’t accept argument ‘sku’”.

Using the deprecated ‘sku’ value works like this,

mutation MyMutation {
  productVariantUpdate(
    input: {id: "gid://shopify/ProductVariant/49897690000000", price: "20.45", sku: "test5/20-51s"}
  ) {
    productVariant {
      id
      sku
    }
  }
}

But the whole point of updating our application was to get away from deprecated REST API usage, and I can’t seem to find a way to update a sku for a product variant using a GraphQL mutation that isn’t deprecated as well.

I had the same problem. Please try to use API version 2024-07. With the newest version you can pass sku in the inventoryItem*.*

1 Like

Thank you.

is it worked ??

Well, we have the same problem as we use SKUs for product identification in the warehouse. Now with the 2025-01 update can’t find a way to save SKUs for new products. Is there any solution to update/add SKU for a product?

Not even the price is saved when productCreate GraphQL.

I’m also trying to update to 2025-01. Same issue, I have new products without variants that need to have SKUs. It looks like I need to create a variant and to do that I need to create a variantOption. All of our existing items still have SKUs without variants/variantOptions, it seems creating new varitant-less products with a SKU is impossible in 2025-01…

With the last version 2025-01 you need to create first the product

this create a variant option by default get id of this variant.

as a second step to add sku, price you need to update the variant by productVariantsBulkUpdate

https://shopify.dev/docs/api/admin-graphql/latest/mutations/productVariantsBulkUpdate?example=Modify+an+existing+Product+Variant


"variants": [
{
"id": "gid://shopify/ProductVariant/50796440158513",
"price": "500",
"inventoryItem": {
"sku": "1234567890"
}
}
],

1 Like