cancel
Showing results for 
Search instead for 
Did you mean: 

REST API doesn't update cart Item PUT problem Magento2

REST API doesn't update cart Item PUT problem Magento2

HI,
I've got a problem while PUT the card item. What I am doing:
1) Find all products of the cart: # GET: http://my_host.dev/index.php/rest/V1/carts/8/items ( I don't know yet how to find client cartId....) I found correct number by increasing the number from 1.
2) the answer was:

[
{
"item_id": 11,
"sku": "MH07-M-Green",
"qty": 1,
"name": "Hero Hoodie",
"price": 54,
"product_type": "configurable",
"quote_id": "8",
"product_option":{
"extension_attributes":{
"configurable_item_options":[{"option_id": "90", "option_value": 53 }, {"option_id": "138",…]
}
}
}
]

2) Update cart item price by:

 

{
"cartItem": {
"itemId": 11,
"sku": "MH07-M-Green",
"qty": 2,
"name": "Hero Hoodie",
"price": 1000,
"productType": "configurable ",
"quoteId": "8"
}
}

3) I get not Updated item price in cart. My response is the same as in point 1). I have to say also that I can delete Items from cart.
Any solution for this?

Thank you

2 REPLIES 2

Re: REST API doesn't update cart Item PUT problem Magento2

Anyone tried to do PUT in Magento2 on cart items??

Re: REST API doesn't update cart Item PUT problem Magento2

Hi,

For update the item of the cart you should use PUT api call (/V1/carts/{cartId}/items/{itemId}).