Backend (Convex)
API — cartSync
Generated catalog of Convex functions in convex/cartSync/. Regenerated by `bun run docs:api`.
Auto-generated from source. Do not edit by hand — run
bun run docs:api.
query (4)
| Function | Description | Args |
|---|---|---|
getCartItems | Get cart items only (without creating cart) | {} |
getCartSyncStatus | Get cart sync status | {} |
getCartTotal | Get cart totals (quick summary) | {} |
getUserCart | Get current user's cart with all items and product details Creates cart if it doesn't exist | {} |
mutation (5)
| Function | Description | Args |
|---|---|---|
addToCart | Add item to cart or update quantity if exists | { productId: v.id("shopifyProducts"), variantId: v.optional(v.id("shopifyVariants")), quantity: v.number(), priceAmount: v.string(), } |
changeCartItemVariant | Change a cart item's variant in place (TikTok-style inline variant swap). Validates the new variant belongs to the same product, reprices the line from the variant, and merges with an existing line that already has the target variant. | { cartItemId: v.id("cartItems"), variantId: v.id("shopifyVariants"), } |
clearCart | Clear entire cart | {} |
removeFromCart | — | { cartItemId: v.id("cartItems"), } |
updateCartItem | Update cart item quantity | { cartItemId: v.id("cartItems"), quantity: v.number(), } |
internalMutation (1)
| Function | Description | Args |
|---|---|---|
clearCartInternal | Clear cart (internal - used after order completion) | { userId: v.string(), // When provided (non-empty), clear ONLY the cart lines matching a purchased // variant or product — a partial (selected-subset) checko… |