POST /product fails with "The variant Default Title already exists"

Hi there,

We are trying to import all products from our WooCommerce shop to Shopify, as we’d like to test out your platform.

However, we do have some issues in this process. Most products get created (via the API) just fine, however, we stumbled upon this product which fails to get created, when we POST it:

{
   "title":"Halo Bangle Gold, White Diamonds 1.72 ct",
   "body_html":"Some text....",
   "product_type":"Armringe",
   "vendor":"Georg Jensen",
   "sku":"10014130",
   "tags":"designer:Georg Jensen, size:S, size:M, size:L, colour-filter:Gold, colour-filter:White, material:Gold, karat:18K Gold, stone:Diamond, stone-colour:White, collection:Halo, delivery-time:1-3 days, category:Armringe",
   "options":[
      {
         "name":"Size",
         "position":1,
         "values":[
            "S",
            "M",
            "L"
         ]
      }
   ],
   "variants":[
      {
         "title":"S1622031350",
         "sku":"10014130-S",
         "price":60000,
         "presentment_prices":[
            {
               "price":{
                  "currency_code":"SEK",
                  "amount":81736
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"NOK",
                  "amount":81072
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"GBP",
                  "amount":6952
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"EUR",
                  "amount":8072
               },
               "compare_at_price":null
            }
         ],
         "option":"S"
      },
      {
         "title":"M1622031350",
         "sku":"10014130-M",
         "price":60000,
         "presentment_prices":[
            {
               "price":{
                  "currency_code":"SEK",
                  "amount":81736
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"NOK",
                  "amount":81072
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"GBP",
                  "amount":6952
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"EUR",
                  "amount":8072
               },
               "compare_at_price":null
            }
         ],
         "option":"M"
      },
      {
         "title":"L1622031350",
         "sku":"10014130-L",
         "price":60000,
         "presentment_prices":[
            {
               "price":{
                  "currency_code":"SEK",
                  "amount":81736
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"NOK",
                  "amount":81072
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"GBP",
                  "amount":6952
               },
               "compare_at_price":null
            },
            {
               "price":{
                  "currency_code":"EUR",
                  "amount":8072
               },
               "compare_at_price":null
            }
         ],
         "option":"L"
      }
   ],
   "images":[
      {
         "src":"https://storage.googleapis.com/shop_images/Georg%20Jensen/10014130_SBB_BANGLE_1633A_YG_DIAMOND_PAVE.jpeg"
      },
      {
         "src":"https://storage.googleapis.com/shop-look-photos/Georg%20Jensen/halo-jewellerystyling-2.jpg"
      },
      {
         "src":"https://storage.googleapis.com/shop-look-photos/Georg%20Jensen/GJ-bangle-styling.jpg"
      }
   ]
}

It will fail:

{
   "method":"POST",
   "code":422,
   "body":"{\"errors\":{\"base\":[\"The variant 'Default Title' already exists.\"]}}",
   "headers":{
      "date":[
         "Wed, 26 May 2021 12:15:50 GMT"
      ],
      "content-type":[
         "application/json; charset=utf-8"
      ],
      "x-sorting-hat-podid":[
         "182"
      ],
      "x-sorting-hat-shopid":[
         "55534026935"
      ],
      "referrer-policy":[
         "origin-when-cross-origin"
      ],
      "x-frame-options":[
         "DENY"
      ],
      "x-shopid":[
         "55534026935"
      ],
      "x-shardid":[
         "182"
      ],
      "x-stats-userid":[
         ""
      ],
      "x-stats-apiclientid":[
         "5294541"
      ],
      "x-stats-apipermissionid":[
         "318669652151"
      ],
      "x-shopify-api-terms":[
         "By accessing or using the Shopify API you agree to the Shopify API License and Terms of Use at https://www.shopify.com/legal/api-terms"
      ],
      "http_x_shopify_shop_api_call_limit":[
         "1/40"
      ],
      "x-shopify-shop-api-call-limit":[
         "1/40"
      ],
      "x-shopify-api-version":[
         "2021-04"
      ],
      "strict-transport-security":[
         "max-age=7889238"
      ],
      "x-shopify-stage":[
         "production"
      ],
      "content-security-policy":[
         "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=create&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=f5cd7ed4-3178-4086-a8e3-7f7e3685796c"
      ],
      "x-content-type-options":[
         "nosniff"
      ],
      "x-download-options":[
         "noopen"
      ],
      "x-permitted-cross-domain-policies":[
         "none"
      ],
      "x-xss-protection":[
         "1; mode=block; report=/xss-report?source%5Baction%5D=create&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=f5cd7ed4-3178-4086-a8e3-7f7e3685796c"
      ],
      "x-dc":[
         "gcp-us-east1,gcp-us-central1,gcp-us-central1"
      ],
      "x-request-id":[
         "f5cd7ed4-3178-4086-a8e3-7f7e3685796c"
      ],
      "cf-cache-status":[
         "DYNAMIC"
      ],
      "cf-request-id":[
         "0a4a333e1e0000d895a6ba5000000001"
      ],
      "expect-ct":[
         "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""
      ],
      "server":[
         "cloudflare"
      ],
      "cf-ray":[
         "6556ee436d79d895-CPH"
      ],
      "alt-svc":[
         "h3-27=\":443\"; ma=86400, h3-28=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"
      ]
   }
}

I have also tried:

  1. Removing the “title” from the variants

  2. Changing SKU (from main product + the variants) to some random text to ensure that it’s not because its conflicting with other SKUs

I still receive the same error. It’s very, very, weird.

I have tried removing the variants key from the product, and then it will create the product just fine.

After some more investigation I found out that in some cases the “option index” wouldn’t be found, and this error wasn’t handled, thus the variants option key could be “option” instead of “option1”.

It would be nice with some better error validation on Shopify’s end, so it would be more clear what the error was, however it is now resolved.

Hi, having the same issue, how did you fix this?

Agree with Mkirstetter - how did you fix this? “option index”? WTF is that?