The productVariantsBulkCreate mutation returns “Option does not exist” although the option exists

When upgrading a product with just one “Default title” variant to a product with (multiple) product options and variants, we are seeing failures with the mutation productVariantsBulkCreate in the Shopify GraphQL Admin API.

The mutation returns the following userErrors:

{
  "field": ["variants", "0", "optionValues", "0"],
  "message": "Option does not exist"
}

However, the referenced product option does exist on the product. In fact, they were created just before sending this mutation.

Context

This happens when a product was originally created in Shopify (through the GraphQL API) without product options and with only the default standalone variant. Later, our integration adds product options and immediately attempts to create variants for those options using
productVariantsBulkCreate.

This appears to have worked previously, and we believe this might have been introduced with version 2026-04.

Example mutation variables

{
    "productId": "gid://shopify/Product/10234679994222",
    "variants": [
      {
        "price": "10.00",
        "compareAtPrice": null,
        "taxable": true,
        "optionValues": [
          {
            "optionName": "Maat",
            "name": "20x20x10 cm"
          },
          {
            "optionName": "Vorm",
            "name": "Rond"
          }
        ]
      }
    ],
    "strategy": "REMOVE_STANDALONE_VARIANT"
  }

Response

{
    "data": {
      "productVariantsBulkCreate": {
        "productVariants": [],
        "userErrors": [
          {
            "field": ["variants", "0", "optionValues", "0"],
            "message": "Option does not exist"
          }
        ]
      }
    },
    "extensions": {
      "cost": {
        "requestedQueryCost": 30,
        "actualQueryCost": 30,
        "throttleStatus": {
          "maximumAvailable": 2000.0,
          "currentlyAvailable": 1970,
          "restoreRate": 100.0
        }
      }
    }
  }

Steps to reproduce

  1. Create a product in Shopify without product options or custom variants.
  2. The product has only the default standalone variant.
  3. Add product options to that product through the GraphQL Admin API.
  4. Immediately call productVariantsBulkCreate with strategy: REMOVE_STANDALONE_VARIANT.
  5. Pass optionValues using optionName and name, where the option names match the newly created product options.

Expected behavior

The variants should be created successfully because the product options exist and the optionValues.optionName values match those options.

Actual behavior

The mutation fails with:

Option does not exist

The error points to the first option value of the first variant.

Additional observation

During investigation, we noticed that the existing default variant does receive values for the newly added product options. The failure then occurs when creating the new variants while removing the standalone variant.

Workaround

We implemented a workaround where, when this error occurs, we link the existing Shopify default variant to the first variant in our own database. On the next synchronization, that linked variant is updated with the new product options instead of being
removed/replaced immediately.

This appears to work reliably, but it seems like the original mutation should also work.

Questions

  1. Is this a known issue with productVariantsBulkCreate and REMOVE_STANDALONE_VARIANT after adding options to a previously optionless product?
  2. Is there a required delay, separate mutation order, or product refresh step after adding options before calling productVariantsBulkCreate?

Any guidance would be appreciated.

Hey @WebWhales - thanks for flagging this. Could you share both x-request-ids and the exact productOptionsCreate input/response, including variantStrategy?

It would also help to know whether using the returned option/value IDs instead of names changes the result. There are a few reasons this could potentially happen, but I can dig further on our end with those details so I can confirm. Hope to hear from you soon!

Hey @Alan_G , Thanks for you reply!

I was able to find ax-request-id for the productVariantsBulkCreate mutation: 03a05377-4d5d-43b3-b41d-feb4ea423f1b-1783518696, although we tested multiple times. I’m afraid I cannot find a request ID for the productOptionsCreatemutation requests anymore, but these happened just before the variant mutations.

When creating product options, we always use variantStrategy: LEAVE_AS_IS. We don’t store request/response data for successful requests, but we use the following mutation format when creating product options:

mutation createOptions($productId: ID!, $options: [OptionCreateInput!]!) {
  productOptionsCreate(productId: $productId, options: $options, variantStrategy: LEAVE_AS_IS) {
    userErrors {
      field
      message
      code
    }
    product {
      id
      options {
        id
        name
      }
    }
  }
}

We always use option names in the productVariantsBulkCreatemutation, but while debugging this, we also tried using option IDs. It did not make any difference.

Hey @WebWhales - I was able to trace the request, and there’s a productVariantsBulkDelete call between productOptionsCreate and productVariantsBulkCreate that deletes the product’s only existing variant.

With LEAVE_AS_IS, Shopify updates that existing variant with the first value from each new option. Deleting it before bulk-create appears to leave the newly added options unavailable, which is likely why the next mutation returns “Option does not exist.”

Could you try skipping that explicit delete and call productVariantsBulkCreate directly with REMOVE_STANDALONE_VARIANT? That strategy is intended to remove the standalone variant while creating its replacements, so a delay or refresh shouldn’t be required.

If that two-mutation flow still fails, just send over both request IDs and I’ll dig further on our end.