How to programmatically create a configurable Magento 2 product
If the simple and configurable products are not assigned together like in the folowing example, there is a reliable solution.
You can review on API functional test aimed at
It is also necessary to mention that the API does not generate simple product, so there is the need to create in advance.
More tips from Magento 2 Developer’s Cookbook

