Magento 2 API Add Item to cart for Guest Customer

Magento 2 API Add Item to cart for Guest Customer

ENDPOINT :  /rest/V1/guest-carts/{cart_id}/items

   e.g :    http://localhost.magento.com/rest/V1/guest-carts/DnsT4UjkMPPdID4K53h4ToaXMSElc8pI/items

METHOD : POST

HEADERS : Content-Type application/json

                    Authorization : Bearer 

PARAMETERS : 
 SKU
 QTY
 Quote_ID

PAYLOAD:
  {
  "cartItem": {
    "sku": "24-MB01",
    "qty": 1,
    "quote_id": "DnsT4UjkMPPdID4K53h4ToaXMSElc8pI"
  }
 }


Response :

{
    "item_id": 25,
    "sku": "24-MB01",
    "qty": 1,
    "name": "Joust Duffle Bag",
    "price": 80,
    "product_type": "simple",
    "quote_id": "12"
}  

                                           // return the item_id which will use to to update/delete item of the cart.

0   0
Eecrets Magento
profile Larry 14th March 2024

Excellent breakdown of the Magento 2 API process for adding items to a cart as a guest customer. Clear instructions and examples make implementation straightforward.
Commercial Roofing Repair Contractor in Detroit MI

Write a comment ...
Post comment
Cancel
profile Jack 21st April 2023

There are three main types of shocks to choose from: twin-tube, monotube, and remote reservoir. Twin-tube shocks are the most common and are suitable for moderate off-roading and daily driving. https://shocksguide.com/best-shocks-for-jeep-jk/

Write a comment ...
Post comment
Cancel

Related Post

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site