Hello!
I’ve created product, its options and its variants via endpoint POST /admin/api/2022-10/products.json:
{
"product": {
"title": "Main Product",
"body_html": null,
"vendor": "Brand name",
"options": [
{
"name": "Color",
"values": [
"Red",
"White"
]
},
{
"name": "Size",
"values": [
"S",
"M",
"L"
]
}
],
"variants": [
{
"title": "Prod 1",
"sku": null,
"barcode": null,
"option1": "White",
"option2": "S"
},
{
"title": "Prod 2",
"sku": null,
"barcode": null,
"option1": "Red",
"option2": "M"
},
{
"title": "Prod 3",
"sku": null,
"barcode": null,
"option1": "Red",
"option2": "L"
}
]
}
}
Then, I’ve tryed to update this product to add option value “Green” via endpoint PUT /admin/api/2022-10/products/12345.json:
{
"product": {
"id": 12345,
"title": "Main product",
"body_html": null,
"vendor": "Brand name",
"options": [
{
"id": 111,
"name": "Color",
"position": 1,
"values": [
"White",
"Red",
"Green"
]
},
{
"id": 222,
"name": "Size",
"position": 2,
"values": [
"S",
"M",
"L"
]
}
]
}
}
If I try to change option name, this endpoint work perfectly. But options values didn’t change.
Also I looked for a way to update options values via GraphQL Admin API. But a working solution couldn’t be reached.
Can anyone suggest a way to update option values via Admin API (REST or GraphQL doesn’t matter)?
Thanks in advance!