ProjectR Docs
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)

FunctionDescriptionArgs
getCartItemsGet cart items only (without creating cart){}
getCartSyncStatusGet cart sync status{}
getCartTotalGet cart totals (quick summary){}
getUserCartGet current user's cart with all items and product details Creates cart if it doesn't exist{}

mutation (5)

FunctionDescriptionArgs
addToCartAdd item to cart or update quantity if exists{ productId: v.id("shopifyProducts"), variantId: v.optional(v.id("shopifyVariants")), quantity: v.number(), priceAmount: v.string(), }
changeCartItemVariantChange 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"), }
clearCartClear entire cart{}
removeFromCart—{ cartItemId: v.id("cartItems"), }
updateCartItemUpdate cart item quantity{ cartItemId: v.id("cartItems"), quantity: v.number(), }

internalMutation (1)

FunctionDescriptionArgs
clearCartInternalClear 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…

On this page