Storefront API v3 lets you build your own storefront UI while Scalev handles catalog, carts, checkout, customer accounts, delivery locations, orders, and payment instructions. Start here to understand the setup you need and the API flow your frontend uses from product browsing to checkout and customer account pages. A Storefront API storefront can be hosted as a static frontend, for example on Cloudflare Pages, Vercel, Netlify, or any CDN, without building a custom backend or same-origin proxy. The frontend callsDocumentation Index
Fetch the complete documentation index at: https://docs.scalev.com/llms.txt
Use this file to discover all available pages before exploring further.
https://api.scalev.com directly.
Architecture
Use these rules for storefront frontends:- Use the store
unique_idin public storefront runtime URLs. - Use a publishable storefront public API key in frontend code.
- Send the key as
X-Scalev-Storefront-Api-Keyfor/public/*endpoints. - Send the customer JWT as
Authorization: Bearer <access>for/customers/me/*endpoints. - Store and resend
X-Scalev-Guest-Tokenfor guest cart flows. - Do not expose business API keys in frontend code.
- Do not build a custom backend endpoint for catalog, cart, checkout, payment instructions, order tracking, or customer account flows.
Setup checklist
- Create or retrieve a storefront public API key.
- Register the storefront origin, for example
https://demo.example.com, as an allowed origin. - Configure the frontend with:
SCALEV_API_BASE=https://api.scalev.comSCALEV_STORE_UNIQUE_ID=<store_unique_id>SCALEV_STOREFRONT_API_KEY=<publishable_storefront_key>
- Serve the frontend from the registered origin.
- Make API calls directly from the browser.
unique_id. Storefront setup endpoints are authenticated business endpoints. The setup endpoints may accept legacy numeric store IDs for compatibility, but the storefront frontend should be configured with the store unique_id.
Minimal fetch helpers
Use one helper for anonymous public storefront routes:Catalog flow
Use this catalog sequence:GET /public/items/countGET /public/items- Use
entity_typeto distinguish:productbundle_price_option
- For product details, call
GET /public/products/{slug}. - For bundle price option details, call
GET /public/bundle-price-options/{slug}. - For variant pricing, call
GET /public/variants/pricing?ids=.... - For availability, call
GET /public/variants/{variant_id}/availability.
variant_id for product variants. Use bundle_price_option_id for bundle price options. Both can be placed in cart and checkout payloads with the typed item union.
Checkout item shapes
Use this shape for product variants:Guest cart and guest checkout flow
Use this flow for anonymous buyers:GET /public/cart- save
x-scalev-guest-token
- save
POST /public/cart/itemsPATCH /public/cart/items/{item_id}DELETE /public/cart/items/{item_id}POST /public/checkout/shipping-optionsPOST /public/checkout/summaryPOST /public/checkoutGET /public/orders/{secret_slug}POST /public/orders/{secret_slug}/payment
- If
itemsis supplied, the order is created from directitems. - If
itemsis omitted, the order is created from the guest cart referenced byX-Scalev-Guest-Token. - If both direct
itemsandX-Scalev-Guest-Tokenare supplied, directitemsis the source and the guest cart is cleared after successful order creation.
Customer auth flow
Call:access and refresh, login is complete.
If the response is an OTP challenge, show an OTP input and call:
- Store
accessfor authenticated customer calls. - Store
refreshif you implement persistent sessions. - Refresh tokens are single-use.
- After calling refresh, discard the old refresh token and store the new one.
- Logout uses
POST /public/auth/jwt/blacklist.
Customer account flow
Use these customer endpoints in the natural account UI order:GET /customers/mePATCH /customers/mePOST /customers/me/set-new-passwordGET /customers/me/addressesPOST /customers/me/addressesGET /customers/me/addresses/{address_id}PATCH /customers/me/addresses/{address_id}DELETE /customers/me/addresses/{address_id}
Customer cart and checkout flow
Use this flow for signed-in customers:GET /customers/me/cartPOST /customers/me/cart/itemsPATCH /customers/me/cart/items/{item_id}DELETE /customers/me/cart/items/{item_id}GET /customers/me/checkout/addressesGET /customers/me/checkout/payment-methodsPOST /customers/me/checkout/shipping-optionsPOST /customers/me/checkout/summaryPOST /customers/me/checkoutGET /customers/me/ordersGET /customers/me/orders/{id}
- If
itemsis supplied, the order is created from directitems. - If
itemsis omitted,cart_idselects the customer cart source. - If both
itemsandcart_idare supplied, directitemsis the source and the referenced cart is cleared after successful order creation.
Location flow
Use either supported location selection pattern. Pattern A:- Select province:
GET /public/locations/provinces - Select city:
GET /public/locations/cities?province_id=... - Select subdistrict:
GET /public/locations/subdistricts?city_id=... - Postal codes:
GET /public/locations/{location_id}/postal-codes
- Direct search:
GET /public/locations?search=... - Use the returned location or subdistrict directly.
- Postal codes:
GET /public/locations/{location_id}/postal-codes
Password reset flow
Implement password reset as a link-based browser flow:- User enters email.
- Frontend calls
POST /public/auth/forget-password. - Scalev sends an email link to
/reset-password?token=<reset-token>. - Frontend reads
tokenfrom the URL. - User enters new password and confirmation.
- Frontend calls
POST /public/auth/save-password.
Origin.
Payment rendering
Use these order fields to render the payment page:product_priceproduct_discountshipping_costshipping_discountother_incomegross_revenuepayment_methodsub_payment_methodpayment_account_holderpayment_account_numberpayment_urlpg_payment_infostore.payment_accountshandler_phonechat_message
store.payment_accounts when no specific order-level account has been selected. Hosted or provider-backed methods may use payment_url or pg_payment_info. gross_revenue is the amount the buyer pays.
See Checkout and Payments for method-specific rendering rules.
Customer subscriptions and courses
For customer account pages, use:GET /customers/me/subscriptionsGET /customers/me/subscriptions/{id}POST /customers/me/subscriptions/{id}/cancelPOST /customers/me/subscriptions/{id}/resumeGET /customers/me/subscription-items/{id}/upgradePOST /customers/me/subscription-items/{id}/upgradeGET /customers/me/subscription-items/{id}/downgradePOST /customers/me/subscription-items/{id}/downgradeGET /customers/me/variants/{uuid}/courseGET /customers/me/course-sections/{uuid}GET /customers/me/course-contents/{uuid}PATCH /customers/me/course-contents/{uuid}
403 or 404 can mean the customer does not own the course variant, not that the storefront integration is broken.
Minimal full checkout payload
Use a complete variant checkout payload like:Agent checklist
An implementation is complete when it can:- list catalog items
- show product detail
- show bundle price option detail
- check pricing and availability
- persist guest cart using
X-Scalev-Guest-Token - add, update, and remove cart items
- select delivery location
- compute shipping options and checkout summary
- create public checkout orders
- show public order status and payment instructions
- create or fetch payment instructions
- login customer with direct-token or OTP branch
- refresh and blacklist JWTs
- manage customer profile and addresses
- use customer cart
- create authenticated checkout orders
- list and view authenticated orders
- list subscriptions and render entitlement-gated courses when present
- do all of the above from the frontend without a custom backend

