0

How to increase/decrease items quantity of product in cart using REST API in magento 2

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": {}
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.