6

I am trying to add product to cart with Magento 2 default API.

POST : http://{{magento2}}/rest/V1/carts/mine/items

Request : {
    "cartItem": {
        "sku": "p2",
        "qty": 1,
        "price": 100,
        "quote_id": 7227
    }   
}

but when i first time add product to cart using API than it set product price 0 in Quote Item table. After second time add product to cart using same API than it working fine.

I have try with Fresh Magento 2 but facing same issue.

1

1 Answer 1

1

Please try with below updated code :

you mention price with int format that's why it is not support try with float value.

POST : http://{{magento2}}/rest/V1/carts/mine/items

Request : {
    "cartItem": {
        "sku": "p2",
        "qty": 1,
        "price": 100.00,
        "quote_id": 7227
    }   
}

hope it works for you

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.