How to increase/decrease items quantity of product in cart using REST API in magento 2
Shoaib Munir
9,59210 gold badges54 silver badges109 bronze badges
-
magento.stackexchange.com/questions/163048/… call this api on one product update.Hitesh Vaghasiya– Hitesh Vaghasiya2019年01月30日 09:54:37 +00:00Commented Jan 30, 2019 at 9:54
-
Using this api update product in quantity not increasing quantity of existing product, Any option to decrease product in cartGagan– Gagan2019年01月30日 10:08:13 +00:00Commented Jan 30, 2019 at 10:08
1 Answer 1
You can use Update cart API [updates the specified item to the specified cart.]
PUT /V1/carts/{cartId}/items/{itemId}
$body data
{
"cartItem": {
"itemId": 0,
"sku": "string",
"qty": 0,
"name": "string",
"price": 0,
"productType": "string",
"quoteId": "string",
"productOption": {
"extensionAttributes": {
"customOptions": [
{
"optionId": "string",
"optionValue": "string",
"extensionAttributes": {
"fileInfo": {
"base64EncodedData": "string",
"type": "string",
"name": "string"
}
}
}
],
"downloadableOption": {
"downloadableLinks": [
0
]
},
"giftcardItemOption": {
"giftcardAmount": 0,
"customGiftcardAmount": 0,
"giftcardSenderName": "string",
"giftcardRecipientName": "string",
"giftcardSenderEmail": "string",
"giftcardRecipientEmail": "string",
"giftcardMessage": "string",
"extensionAttributes": {}
},
"configurableItemOptions": [
{
"optionId": "string",
"optionValue": 0,
"extensionAttributes": {}
}
],
"bundleOptions": [
{
"optionId": 0,
"optionQty": 0,
"optionSelections": [
0
],
"extensionAttributes": {}
}
]
}
},
"extensionAttributes": {}
}
}
answered Jan 31, 2019 at 8:05
Aditya Shah
7,6813 gold badges41 silver badges79 bronze badges
default