I am struggling to understand how variations really work. For below I use the iPad Mini 4 example.
I understand from the documentation https://docs.moltin.com/inventory/product/modifiers and the blog post https://www.moltin.com/blog/2017/06/introducing-variations-options-modifiers/ that you
Create a variation (which returns, among others, the variation ID)
$storedVariation = $moltin->variations->create([ "type" => "product-variation", "name" => $variationName ])->data();
Create a variation option
$option = $moltin->variationOptions->create([ 'type' => 'product-variation-option', 'name' => "blue", 'description' => "blue colour" ])->data();
Link the variation option to the variation
$moltin->variations->createRelationships($storedVariation->id, 'variation-options', [$option->id]);
Above query (2) unfortunately does not work for me (I receive a 404 error). According to your blog “it doesn’t really make sense for an option to exist outside the context of a variation”. I assume therefore the CURL request on your blog includes the variation ID. This is however not included in the create option query in the PHP SDK. If I look at the PHP SDK file changes on Github, the function createOption (which included the ID) was depreciated.
Any thoughts on how to solve this?