Cart Management
Clear Cart
Removes all line items from the cart, returning an empty cart
DELETE
Clear Cart
Overview
The Clear Cart endpoint removes all items from the shopping cart while maintaining the session. This operation:- Complete Reset: Removes all line items, shipments, and addon selections
- Session Continuity: Cart ID and authentication remain active
- Preserved Settings: Maintains shipping info, payment methods, and cart-level preferences
- Zero Totals: Returns empty cart with all monetary values reset to zero
Authentication
Device authentication token to identify and map the session
Path Parameters
Domain of the merchant website (e.g.,
staging.luma.gift)Response
Returns an empty shopping cart. All arrays are empty and monetary values are zero.What Gets Cleared:
- Line Items: All products removed from cart
- Shipments: All shipment groups deleted
- Addons: All addon selections removed (offers may remain available)
- Totals: All monetary totals reset to zero
- Promo Codes: Applied coupons are cleared
What Gets Preserved:
- Cart ID: Session continues with same cart identifier
- Shipping Info: Customer address information retained
- Payment Methods: Available payment options maintained
- Shipping Options: Available shipping methods preserved
- Session State: Authentication and device binding remain active
Code Examples
Error Responses
400 Bad Request
400 Bad Request
Missing or invalid authentication header
401 Unauthorized
401 Unauthorized
404 Not Found
404 Not Found
Cart not found for the given domain
Use Cases
Start Fresh
Customer wants to completely restart their shopping session:Bulk Item Management
Before adding a new product set, clear existing items:Session Reset
After checkout completion or session timeout:Implementation Details
The clear cart operation removes all items from the cart while maintaining the session and cart identifier. Depending on the merchant’s platform, this may either:
- Use a native clear cart operation for optimal performance
- Remove items individually to ensure compatibility
Related Endpoints
- Get Cart - View current cart state
- Add Line Item - Add new items to cart
- Update Line Item - Modify cart items
Clear Cart