1

using API /V1/carts/mine/items I got the tutorials / blogs to add configurable, simple and bundle products to cart but how can we add grouped product using this api?

What should be the payload ?

1 Answer 1

0
  1. Authenticate and Obtain Access Token
  2. Create a Cart

POST /V1/carts/mine

  1. Add Product to Cart

POST /V1/carts/mine/items

Jason Body

{ "cartItem": { "sku": "your_group_product_sku", "qty": 1, "quote_id": "your_cart_id" } }

  1. Review Cart

GET /V1/carts/mine/items

4
  • @Parachi "message": "Please specify the quantity of product(s)." Aug 8 at 11:27
  • Please mention quantity according your product
    – Prachi
    Aug 8 at 12:47
  • I got the issue in grouped product you need to individually add items to cart by mentioning the SKU of only childs products. Aug 9 at 5:05
  • curl -X POST "your-magento-domain/rest/V1/carts/YOUR_CART_ID/items" \ -H "Authorization: Bearer YOUR_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "cartItem": { "sku": "YOUR_SKU", "qty": YOUR_QTY, "quote_id": "YOUR_CART_ID", "product_option": { "extension_attributes": { "group_id": YOUR_GROUP_ID } } } }'
    – Prachi
    Aug 12 at 10:46

Your Answer

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

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