Cart
Get Cart
Return the active location's cart, re-priced and re-validated. Each line reports its current unit price, line total, availability, and any warnings (`price_changed`, `out_of_stock`); the cart reports subtotal and minimum-order-value progress.
Empty Cart
Remove every line from the active cart.
Add Cart Line
Add or increase a product line. `product_id` and `quantity` are required. Rejected with 422 and a `reason` (`invalid_quantity`, `below_moq`, `increment_mismatch`, `unknown_product`) when quantity rules or catalog visibility fail.
Update Cart Line
Set the quantity on an existing line (enforces MOQ + increment). Send the line's last-seen `expected_updated_at` for shared-cart concurrency: if another buyer changed it first, the write still applies (last-write-wins) but the returned cart's `conflict` flag is true so the client can refresh.
Remove Cart Line
Remove a single line from the active cart.
Quick Add to Cart
Bulk-add lines by SKU and/or product id. Send structured `items` ([{sku, quantity}] and/or [{product_id, quantity}]) or a pasted `text` block of `SKU,QTY` lines. Returns the added lines, the rejected lines with a reason (`unknown_sku`, `unknown_product`, `below_moq`, `increment_mismatch`), and the refreshed cart.
Import Cart from CSV
Upload a 2-column `sku,quantity` CSV to bulk-add lines. The parser strips a BOM, handles quotes, skips blank rows, sums duplicate SKUs, and reports malformed rows (`missing_sku`, `invalid_quantity`, `row_limit_exceeded`). Valid rows are added; the response summarizes added/rejected and returns the refreshed cart.
Import Cart from PO Document
Upload a purchase-order document (PDF) to extract order lines by OCR. High-confidence, catalog-matched rows are added automatically; low-confidence or unmatched rows are returned as `candidates` requiring confirmation and are never added silently. Returns 422 when document import is not enabled or the document cannot be processed.