I can't seem to create a product with multiple options. I've tried everything and the documentation from Shopify's official library is poor. I've looked all over the API reference guide and search other forms, but can't seem to find the proper syntax. Code is below. I'm trying to create a product with two options, for instance option1 is size and option2 is color. There are no error messages shown too for the printed output, but variant options doesn't appear in the Shopify store, only the product with 0 variants appears.
new_product = shopify.Product()
new_product.title = "My Product"
new_product.handle = "test-product"
##what I've tried... and countless others
#First example of new_product.variants
new_product.variants = shopify.Variant({'options': {'option1' : ['S', 'M', 'L', 'XL'], 'option2' : ['Black', 'Blue', 'Green', 'Red']}, 'product_id': '123456789'})
#Second example of new_product.variants
new_product.variants = shopify.Variant({'options': [{'option1': 'Size', 'option2': 'Colour','option3': 'Material'}]})
#Thrid example of new_product.variants
new_product.variants = shopify.Variant([
{'title':'v1', 'option1': 'Red', 'option2': 'M'},
{'title':'v2', 'option1' :'Blue', 'option2' :'L'}
])
new_product.save()
##No errors are output, but doesn't create variants with options
if new_product.errors:
print new_product.errors.full_messages()
print "Done"