I'm able to semi-successfully add options to a configurable product using REST API configurableProductOptionRepositoryV1 (/V1/configurable-products/{sku}/options). When the first option gets added, I get a "200 OK" response. However when the second option gets added, I get a "400 Bad Request" even though the option gets added to the configurable product. The JSON that i'm passing in the API call is the following:
'{
"option": {
"attributeId": "size",
"label": "Size",
"position": 0,
"isUseDefault": false,
"values": [
{
"valueIndex": #variables.size#
}
]
}
}'
I'm not quite sure what the use is for attributes "position" and "isUseDefault". If anyone could shed light on either of those then that would be great.
Any suggestions as to why adding the first option returns 200 while adding the subsequent options return 400?
Thanks for your help.
Keith