> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spurtcommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cart

Shopping cart lifecycle and pricing.

The cart holds a customer's selected items before order creation. It may be associated with an authenticated customer, an anonymous session, or both; verify the implemented identity model.

## Typical operations

* Retrieve the current cart.
* Add an item and quantity.
* Update quantity or remove an item.
* Revalidate price, stock, product status, and promotions.
* Calculate subtotal, discounts, tax, shipping estimates, and payable total.

## Important rules

The server must recalculate all monetary values. Treat client-submitted price, discount, tax, and total fields as untrusted. Revalidate cart lines at checkout because catalogue prices and stock can change. Ensure duplicate add requests and retries do not create unintended quantities.

## Test cases

Cover empty carts, unavailable products, quantity limits, variant combinations, expired promotions, changed prices, concurrent stock depletion, and guest-to-account cart merging if supported.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.