0

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
asked Jan 30, 2019 at 9:50
2
  • magento.stackexchange.com/questions/163048/… call this api on one product update. Commented 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 cart Commented Jan 30, 2019 at 10:08

1 Answer 1

0

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.