if i add a item to cart via api it set Magento 2 default price of the item instead price set via API

1st i create a cart for a customer:


via POST


via POST


{ "cartItem": { "quote_id": "cart_id_from_1st_response", "sku": "test_sku", "qty": 1, "price": "11" } }

the response is like that:

stdClass Object
        [item_id] => 186
        [sku] => test_sku
        [qty] => 1
        [name] => Testarticle
        [price] => 15
        [product_type] => simple
        [quote_id] => 287

the price should be 11 as in the post, but the API response the prie of 15

  • want You to post custom price which you have sent from post parameters
    – Amit Bera
    Commented May 23, 2019 at 9:21

1 Answer 1


/V1/carts/{cartId}/items is an endpoint for GET request.
Try with the following endpoint instead:




  • quoteId and cartId are still the same? the response of POST V1/customers/631/carts is the id to which i post the items
    – Jan
    Commented May 23, 2019 at 14:07
  • @Jan I'm not really sure but I think is the same. The id from V1/customers/631/carts is the quoteId you use to POST items to cart using /V1/carts/{quoteId}/items endpoint and then from there, you get the cart id from response which you use to update the cart items using /V1/carts/{cartId}/items/{itemId} endpoint
    – fmsthird
    Commented May 24, 2019 at 4:05
  • yes i think im right but...i send to the endpoint this json: { "cartItem": { "item_id": 189, "quoteId":289, "price": 89, "qty":1 } } and get this response: { "cartItem": { "item_id": 189, "quoteId":289, "price": 89, "qty":1 } } so the price will not accept
    – Jan
    Commented May 25, 2019 at 11:01

Your Answer

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

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