Add to Cart API Documentation¶
Add to Cart¶
POST /cart/storefront/api/carts/add/
Description¶
This endpoint allows users to add items to their shopping cart.
Request Body¶
{
"product_variant_id": 0,
"quantity": 1
}
Example¶
{
"product_variant_id": 1,
"quantity": 5
}
List of Cart Items¶
GET /cart/storefront/api/carts/
This endpoint retrieves all items currently in the user’s shopping cart.
Remove Item from Cart¶
DELETE /cart/storefront/api/carts/remove/<product_variant_id>/
This endpoint removes the specified item from the user’s shopping cart.
Update Cart Quantity¶
PUT /cart/storefront/api/carts/update/
Description¶
This endpoint updates the quantity of a specific item in the user’s shopping cart.
Payload¶
{
"product_variant_id": 0,
"quantity": 1
}