"Something went wrong, please try again" from productVariantsBulkCreate

Topic summary

Issue: Users encounter a generic “Something went wrong, please try again” error when using the productVariantsBulkCreate mutation, making troubleshooting difficult.

Root Cause Identified:

  • The error occurs when both id and optionId are passed within the optionValues array
  • Removing the REMOVE_STANDALONE_VARIANT strategy and passing option values directly in the query (instead of using both ID fields) resolves the issue

Additional Problems:

  • Similar non-descriptive errors appear in productSet mutation (API versions 2024-07 and 2024-10)
  • Older API versions provide more useful error messages (e.g., “daily variation limit exceeded”)
  • Documentation at shopify.dev appears outdated

Shopify Response:

  • Team member Liam acknowledged the issue and flagged it to the product team for improved error messaging

Status: Workaround confirmed by multiple users, but underlying error message clarity remains unresolved

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

Hi, I am trying to run a mutation to create variants for a product.

My steps:

  • Create product

  • Create product options

  • Create variants

I create the options, then get their IDs and add them in the input for the variants. When running that productVariantsBulkCreateMutation, I get only the message “Something went wrong, please try again”. I checked my input and I’m sure it’s correct (the documentation page for https://shopify.dev/docs/api/admin-graphql/2024-10/mutations/productvariantsbulkcreate is a bit outdated by the way). I have tried using different API versions but same result. If I for example give it a wrong ID, then in the response I get “blabla was given wrong ID”.

Only one thing I notice, I have for example 10 values in the “Color” option, but after making product options only 1 is shown in the /admin on the site. In graphql I do get all of the values, and it says it created the “color” option with those 10 values.

How can I troubleshoot this more?

mutation productVariantsBulkCreate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
productVariantsBulkCreate(
productId: $productId
variants: $variants
strategy: REMOVE_STANDALONE_VARIANT
) {
product {
id
}
productVariants {
id
}
userErrors {
code
field
message
}
}
}

input:

{
  "productId": "gid://shopify/Product/8722327568643",
  "variants": [
    {
      "price": "249.95",
      "optionValues": [
        {
          "id": "gid://shopify/ProductOptionValue/2489644384515",
          "name": "Beige",
          "optionId": "gid://shopify/ProductOption/11058914492675",
          "optionName": "Color"
        },
        {
          "id": "gid://shopify/ProductOptionValue/2489644712195",
          "name": "Ingen længde",
          "optionId": "gid://shopify/ProductOption/11058914558211",
          "optionName": "Length"
        },
        {
          "id": "gid://shopify/ProductOptionValue/2489644679427",
          "name": "One size",
          "optionId": "gid://shopify/ProductOption/11058914525443",
          "optionName": "Size"
        }
      ]
    }
  ]
}
1 Like

I have the same problem. I copied the example from the documentation, slightly changed the input data and got an error that is not clear how to fix it.
I am using api version - 2024-07.

mutation productVariantsBulkCreate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
  productVariantsBulkCreate(productId: $productId, variants: $variants) {
    userErrors {
      field
      message
    }
    product {
      id
      options {
        id
        name
        values
        position
        optionValues {
          id
          name
          hasVariants
        }
      }
    }
    productVariants {
      id
      title
      selectedOptions {
        name
        value
      }
    }
  }
}

Input:

{
  "productId": "gid://shopify/Product/8279288611120",
  "strategy": "REMOVE_STANDALONE_VARIANT",
  "variants": [
    {
      "optionValues": [
        {
          "name": "Red",
          "optionName": "Color"
        }
      ],
      "price": 22
    },
    {
      "optionValues": [
        {
          "name": "Brand new style",
          "optionName": "Style"
        }
      ],
      "price": 23.5
    }
  ]
}

Response:

{
    "data": {
        "productVariantsBulkCreate": {
            "userErrors": [
                {
                    "field": null,
                    "message": "Something went wrong, please try again."
                }
            ],
            "product": null,
            "productVariants": null
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 13,
            "actualQueryCost": 10,
            "throttleStatus": {
                "maximumAvailable": 2000.0,
                "currentlyAvailable": 1990,
                "restoreRate": 100.0
            }
        }
    }
}

I managed to make it work

Turns out in my case, if you pass id and optionId in the optionValues it starts giving that error

I think it might work if you remove the strategy from input and pass it directly in the query

productVariantsBulkCreate(
productId: $productId
variants: $variants
strategy: REMOVE_STANDALONE_VARIANT
)

I think shopify should update those error messages

2 Likes

Hi - thanks for flagging this, the error message should indeed be improved. I’ll flagged this feedback to our product team.

Life saver. This worked for me :folded_hands:

Hey @Liam i am having the same non descriptive error while using productSet mutation with GraphQL API 2024-07 and 2024-10 release candidate, the problem is not reported back to the user in a descriptive way only a generic message saying “Something went wrong” but when I used a previous API version and the mutation productCreate, then I receive a more useful error about daily variation limit exceeded, please communicate this to fix the error message.
Here is my cURL that was triggering the error:

curl --location 'https://xxxxx.myshopify.com/admin/api/2024-07/graphql.json' \
--header 'Content-Type: application/json' \
--header 'X-Shopify-Access-Token: xxxxxxxxxxx' \
--data '{"query":"mutation productSet($input: ProductSetInput!) {\n    productSet(synchronous: true, input: $input) {\n        product {\n        id\n        title\n        }\n        userErrors {\n        message\n        field\n        }\n    }\n}","variables":{"input":{"title":"draft","status":"DRAFT"}}}'
1 Like