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 ?
asked Aug 8, 2023 at 9:34
1 Answer 1
- Authenticate and Obtain Access Token
- Create a Cart
POST /V1/carts/mine
- Add Product to Cart
POST /V1/carts/mine/items
Jason Body
{ "cartItem": { "sku": "your_group_product_sku", "qty": 1, "quote_id": "your_cart_id" } }
- Review Cart
GET /V1/carts/mine/items
-
@Parachi "message": "Please specify the quantity of product(s)."Syed Hassan Zamir– Syed Hassan Zamir2023年08月08日 11:27:02 +00:00Commented Aug 8, 2023 at 11:27
-
Please mention quantity according your productPrachi– Prachi2023年08月08日 12:47:08 +00:00Commented Aug 8, 2023 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.Syed Hassan Zamir– Syed Hassan Zamir2023年08月09日 05:05:50 +00:00Commented Aug 9, 2023 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– Prachi2023年08月12日 10:46:58 +00:00Commented Aug 12, 2023 at 10:46
default