Skip to content

Magento 2 add to cart a product with customisable option and calcualted value using REST

When i am working on Magento 2.3 REST api for add to cart a product with customizable options of checkbox and its value is x% of product price. Below is the images for website admin and front-end that makes more clear to you.

Admin customizable options

enter image description here

Product details page :
enter image description here

Cart Page:
enter image description here

Now need to add customizable options using REST API /rest/V1/carts/{quoteid}/items, i am trying payload is

{
“cart_item”: {
“quote_id”: 7962,
“sku”: “MR932HB1AB”,
“qty”: 1,
“product_option”: {
“extension_attributes”: {
“custom_options” : [
{
“option_id”: “5791”
“option_value”: <what to put here? its in % in admin for a products>
}
]
}
}
}
}

Also the customizable options didn’t coming in cart /rest/V1/carts/{quote_id}. Please help on this.