Hi,
For a while now, I've struggled to programatically create product variations.
I have successfully created a configurable product though the REST API. Now, I want to generate some variations for it.
Using the admin backend, I can do it by selecting a product and clicking the "Edit Configurations" button... but I am unable to do it by using the REST API.
I believe I need to connect to the configurableProductConfigurableProductManagementV1 API and send a PUT request to the /V1/configurable-products/variation endpoint, however I can't figure out exactly what data I need to include in the request.
I'm using Magento 2.0.9.
Any help is greatly appreciated.
Hi @Riboe,
Since this has been posted several days ago, I would like to know if you were able to find the solution.
Please let us know.
Best regards.
Gabriel
Sadly not.
I gave up after trying almost every single logical combination of data I could think of. No matter what I sent, I would either get an error or no message at all and the variations would not be generated.
I've now resorted to generating the variations manually, one by one, and then creating the configurable product and linking the variations to it. This requires far more code and I imagine it's far slower as well, due to the overhead of making 10-30 extra API calls (depending on the amount of variations) per product I want to generate variations for.
Someone has a better solution to suggest? Thanks.