i want to know the magento 2 rest api for add product to cart am trying post /rest/V1/guest-cart and am getting cart_id then post /rest/V1/:card_id/items in postman and am getting error like

    "message": "%fieldName is a required field.",
    "parameters": {
        "fieldName": "cartItem"

2 Answers 2


This way only for registered customers:

Request path -

Where 3 is your cart id

Method: POST

BODY: { "cartItem" : { "sku": "24-MB01", "qty": "1", "quote_id": 3 } }

Cart Id ( quote_id ) you can retrieve via:

Method: POST

The response will be similar to:


Checked via Postman


here is the swagger documentation of Magento2 Rest endpoints, please search for quoteGuestCartItemRepositoryV1, there are some helpful examples, data structure etc.

swagger doc


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.