online_store).
Catalog
getStore()
Store metadata (name, currency, settings).getProducts(options?)
getProductById(id) / getProductBySlug(slug)
getProductCategories()
Cart
Cart state lives in the visitor’s browser session (sessionStorage). It is shared across store pages in the same tab until checkout. Nothing is sent to the server until createOrder.
Each cart method returns a Promise resolving to:
getCart()
Read the current cart. Use on checkout pages or for a cart badge count.addToCart(productId, quantity?)
Add a product or increase its quantity. Default quantity is 1. Merges with an existing line for the same product.setCartItems(items)
Replace the entire cart. DuplicateproductId values are merged; quantities are capped at 99 per line.
setCartItemQuantity(productId, quantity)
Set quantity for one product. Pass 0 to remove that line.removeFromCart(productId)
Remove one product from the cart.clearCart()
Empty the cart. Call after a successfulcreateOrder on checkout.
Typical flow
Orders
createOrder(payload)
Signed-in customer orders
Requires User Authentication (user_authentication) and an active site session.

