Get cart
Changed onGet user's cart with variant-specific items
Retrieves all cart items for the authenticated user with:
- Variant details (quality tier, attributes, display name)
- Listing information (title, seller, status)
- Real-time availability check for each variant
- Price change detection (compare snapshot vs current price)
- Calculated subtotals and cart total
Availability is checked by querying listed stock lots for each variant. Price changes are detected by comparing cart's price_per_unit with current variant pricing from the listing.
Requirements:
- 29.1: GET /api/v2/cart endpoint
- 29.2: Return array of cart items with variant details
- 29.3: Include listing information for each cart item
- 29.4: Include variant attributes (quality_tier, display_name)
- 29.5: Include quantity and price_per_unit snapshot
- 29.6: Calculate subtotal for each item
- 29.7: Calculate total_price for entire cart
- 29.8: Include availability indicator for each item
- 29.9: Include price_changed indicator for each item
- 29.10: Return current_price if price has changed
- 29.11: Return item_count (total number of items)
- 29.12: Filter cart items by authenticated user
Request
- Base URL: /api/v2 (relative, and the document was published on a file host, not at the API’s origin)
- URL: /api/v2/cart
- Auth: loggedin (a scheme the document does not define)
Response
Cart contents with variant details and availability
Changes
- ○
added the optional property
//to the response with the status
- ○
- ▲
removed the required property
///from the response with the status - ▲
removed the required property
///from the response with the status - ▲
removed the required property
///from the response with the status - ▲
removed the required property
///from the response with the status - ▲
removed the required property
///from the response with the status - ●
removed the optional property
///from the response with the status - ○
added the optional property
///to the response with the status - ○
added the required property
///to the response with the status - ○
added the required property
///to the response with the status - ○
added the required property
///to the response with the status - ○
added the required property
///to the response with the status
- ▲