All I found so far is from the User Guide in Step 4 under 2.:
The Quantity is determined by the product variations, so you can leave it blank for now.
The Stock Status of a configurable product is determined by each associated configuration. Because the product was saved without entering a quantity, the Stock Status is now set to “Out of Stock.”
According to this the Quantity is determined by the product variations but how about the Stock Status? If you have variations that are "In Stock" shouldn't be the configurable "In Stock" too?
My background:
Our products are created via rest api like this:
- All simples
- The configurables with the simple ids that belong to them in
configurable_product_links
In our case all configurables are set to "Out of Stock". Even when I reindex the Stock Status is not getting updated. Is this expected behavior?
I've already tried:
- Clearing cache
- Reindexing
Here an example json we post to create a configurable:
{
"product": {
"typeId": "configurable",
"sku": "sku",
"status": 1,
"attributeSetId": 44,
"name": "Configurable product name",
"extensionAttributes": {
"configurable_product_options": [
{
"attribute_id": 861,
"label": "Some Label",
"values": [
{
"value_index": 15929
},
{
"value_index": 15945
},
{
"value_index": 15967
}
]
}
],
"configurable_product_links": [
18449,
18450,
18451
],
"category_links": [
{
"position": 0,
"category_id": 899
}
]
},
"customAttributes": [
{
"attributeCode": "description",
"value": "Our description"
}
]
}
}