"You need to add option values for Color" Bug

Hello,

I am having an issue while trying to create a simple product.

This is the URL I am calling

'https://my-marketplace.myshopify.com/admin/api/2024-01/products.json'

This is what my post data looks like:

'product': {
    'title': row['Title'],
    'body_html': row['Body (HTML)'],
    'vendor': row['Vendor'],
    'product_type': row['Type'],
    'handle': row['Handle'].lower(),
    'published_scope': 'web',
    'tags': row['Tags'],
    'status': row['Status'],
    'options': [
        {
            'name': 'Size',
            'position': 1,
            'values': [
                '16', '17'
             ]
         },
         {
             'name': 'Color',
             'position': 2,
             'values': [
                 'Red', 'Green'
              ]
          },
    ],
}

And this is the response I am getting:

"You need to add option values for Color"

When trying to create the data without the “Color” option, it works fine.

Here is an example:

'product': {
    'title': row['Title'],
    'body_html': row['Body (HTML)'],
    'vendor': row['Vendor'],
    'product_type': row['Type'],
    'handle': row['Handle'].lower(),
    'published_scope': 'web',
    'tags': row['Tags'],
    'status': row['Status'],
    'options': [
        {
            'name': 'Size',
            'position': 1,
            'values': [
                '16', '17'
             ]
         },
    ],
}

Adding anything (e.g. Size, Color…) as the first option works, but the second or third options never work.

So my question is: why is it that I cannot add a second option to my product?

Hey @hustlewithdream ,

I am using POST method on the url I already specified: ‘https://my-marketplace.myshopify.com/admin/api/2024-01/products.json’, and the JSON from the original post.