Skip to main content
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

string
required
Device authentication token to identify and map the session

Path Parameters

string
required
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

Missing or invalid authentication header
Invalid JWT token
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
Both approaches result in the same empty cart state.