To update an existing product option, send a PUT request to the endpoint with the option ID in the URL.
PUT /api/options/27
Include the option details in the HTTP request body according to the specified Content-Type
. None of the fields are required.
Parameter | Type | Required | Description |
---|---|---|---|
option_type |
string | No | Type of option (e.g., "S" for Select box, "R" for Radiogroup, "C" for Checkbox) |
main_pair |
object | No | Image pairs for the option |
variants |
object | No | Option variants (choices) available for this option |
{ "option_type": "S", "main_pair": { "icon": { "image_path": { "2": "https://www.venddor.com.br/image3.jpg", "3": "https://www.venddor.com.br/image4.jpg" } } }, "variants": { "2": { "variant_name": "Gift wrap" }, "3": { "variant_name": "Present box", "modifier_type": "P", "modifier": "20" } } }
This request changes several aspects of the option:
variants
object, you must specify all variants that should be included in the option. Any variants not included in the request will be deleted.
Type | Description |
---|---|
A |
Absolute value (fixed amount) |
P |
Percentage (% of product price) |
{ "option_id": "27" }
Status Code | Description |
---|---|
200 OK |
Option was updated successfully |
400 Bad Request |
Invalid request parameters |
404 Not Found |
Option with the specified ID does not exist |