Storefront API is the browser-facing API for custom storefronts. Use it when you want to create your own storefront frontend and use Scalev as the backend for catalog, cart, checkout, customer account, delivery location, order, and payment flows. Storefront API is separate from hosted Storefront settings. Hosted Storefront settings control Scalev-rendered pages, custom domains, homepage and checkout builders, footer pages, OTP, custom HTML, and analytics. Storefront API setup is for API-only storefronts where you own the frontend 100%.Documentation Index
Fetch the complete documentation index at: https://docs.scalev.com/llms.txt
Use this file to discover all available pages before exploring further.
Architecture
A Storefront API storefront can be a static app deployed on Cloudflare Pages, Vercel, Netlify, or any CDN. The browser callshttps://api.scalev.com directly.
Use fetch with credentials: "omit" for browser-only Storefront API calls:
What to configure
In the dashboard, open the store configuration page and use the Storefront API section. Copy the public Store ID. New integrations should use the storeunique_id, for example:
X-Scalev-Storefront-Api-Key, X-Scalev-Guest-Token, Authorization, and Content-Type.
Core endpoints
has_next is true, use next_cursor to fetch the next page.
Browser-only checkout flow
- Load catalog with
GET /public/products,GET /public/categories, and product detail routes. - Create or read the guest cart with
GET /public/cart; store the returnedX-Scalev-Guest-Token. - Send
X-Scalev-Guest-Tokenon cart add, update, remove, checkout, and later cart reads. - Discover checkout options with
GET /public/payment-methodsand the public location/postal-code endpoints. - List shipping options with
POST /public/checkout/shipping-options. The cart fromX-Scalev-Guest-Tokenis the item source; otherwise passitems[]with variant IDs in the request body. - Recompute totals with
POST /public/checkout/summaryafter the shopper picks a courier service and payment method. The API ignores client-suppliedshipping_costand recomputes it from the selected courier service, warehouse, payment method, destination, and cart items. - Optionally validate a discount code with
POST /public/discount-codes/check. Send{ "code": "..." }in the request body, along with optional checkout context (payment_method,destination,courier_service_id,warehouse_unique_id,courier_aggregator_code,net_product_price,gross_revenue,shipping_cost). IfX-Scalev-Guest-Tokenresolves a non-empty guest cart, the cart is used as the item source; otherwise pass directitems[]with variant IDs. Unknown or ineligible codes returnis_eligible: false; the route only returns404when the store cannot be resolved. - Create the order with
POST /public/guest-checkout. - Read the order through
GET /public/orders/{secret_slug}and update buyer-facing fields such astransferproof_url,transfer_time, ornoteswithPATCH /public/orders/{secret_slug}. - Call
POST /public/orders/{secret_slug}/payment; render the returned or existing payment instructions in your own payment page and usepayment_urlonly as a hosted fallback. - For customer accounts, start with
/public/auth/login, then call/customers/me/*with the customer JWT.
Payment responses
The public order endpoint returns buyer-facing order status, totals, shipping, items, and payment instructions. It does not return dashboard-only store or handler configuration. The public payment endpoint is idempotent when payment instructions orpayment_url already exist.
Payment responses describe how the storefront should render the next payment step. Manual methods such as bank_transfer and cod can return an empty pg_payment_info while the public order carries the buyer-facing instructions to render. Virtual account methods expose provider reference and account details under the provider’s payment_method object. QRIS responses expose QR data or a QR image payload. E-wallet, card, and invoice methods may expose provider actions or hosted provider URLs. Storefronts should render their own payment page from these fields and use payment_url only as a hosted fallback.

