Scalev HTML Mode pages can useDocumentation Index
Fetch the complete documentation index at: https://docs.scalev.com/llms.txt
Use this file to discover all available pages before exploring further.
window.Scalev from browser JavaScript. The runtime gives your page access to safe page context, selected store context, checkout helpers, analytics forwarding, and form prefill helpers without exposing private API tokens.
This page is written for both developers and AI agents that generate HTML Mode files. If you are generating an HTML file for Scalev, use this reference instead of calling Scalev backend URLs directly.
Availability
The runtime is available on rendered HTML Mode pages. In local editor previews, some methods can return stubbed preview data. Always guard runtime usage:Promise. Scalev.data.get() is synchronous.
Store context
An HTML Mode page may or may not have Store Context selected in the Scalev editor. When Store Context is selected,Scalev.data.get().store includes only the selected store summary, selected products, and selected bundle price options. It does not include the full store catalog.
When Store Context is not selected, store is not available. Do not build checkout, payment, shipping, discount, product catalog, cart, or order creation flows. Use the page as a regular landing page and rely only on page-safe methods such as Scalev.data.get(), Scalev.analytics.track(), and Scalev.prefill.
Security rules
- Do not request or store API keys, business-user JWTs, storefront API keys, customer tokens, cookies, or credentials.
- Do not call Nexus, Scalev backend URLs, or private APIs directly from page JavaScript.
- Use only documented
window.Scalevmethods. - Create orders only after a visitor intentionally submits a form.
- Call
Scalev.checkout.validateOrder()beforeScalev.checkout.createOrder(). - Do not assume unselected products, bundles, prices, inventory, payment methods, shipping options, or customer identity.
Scalev.data.get()
Returns public page data injected into the rendered page.
store contains selected context only:
store.payment_methods contains the enabled payment methods after Nexus filters the store settings by the business payment capabilities. Use store.sub_payment_methods for enabled VA or bank submethods when present.
Location methods
Use these methods for address and shipping forms.provinces, cities, and subdistricts accept optional query objects:
Scalev.checkout.validateDiscount(payload)
Validates a discount code for a checkout payload.
codegrossRevenueorgross_revenuenetProductPriceornet_product_priceshippingCostorshipping_costpageUniqueIdorpage_unique_idpaymentMethodorpayment_methoddomain
Scalev.checkout.searchWarehouses(payload)
Returns warehouse options for selected variants and destination.
storeId,store_id, orstoredestinationId,destination_id, ordestinationvariants: array of{ variantId | variant_id | id, qty | quantity }orderId,order_id, ororderwhen validating against an existing order flow
Scalev.data.get().store.products.
Scalev.checkout.searchCouriers(payload)
Returns courier service options for a store, destination, warehouse, and payment method.
storeId,store_id, orstorepaymentMethodorpayment_methodlocationId,location_id, ordestinationwarehouseId,warehouse_id, orwarehouseweight
Scalev.checkout.validateOrder(payload)
Validates order payload shape without creating an order.
valid is false, inspect warnings and fix the form payload before creating an order.
Common warnings include missing page id, store id, customer name, customer phone, or order items.
Scalev.checkout.createOrder(payload)
Creates a real public order. Call this only after a visitor intentionally submits the form and validateOrder has passed.
createOrder accepts the same public payload keys used by Scalev’s regular editor checkout flow. The runtime normalizes them before posting to Nexus:
- Customer fields:
customerName,customerPhone,customerEmail,name,phone,address - Store and page fields:
store,page, plus aliases such asstoreUniqueId,store_unique_id,pageUniqueId, andpage_unique_id - Location and shipping fields:
location,postalCode,shippingOrigin,courierService,shippingCost, andcourierAggregator - Payment fields:
paymentMethod,financialEntityId,paymentAccount,paymentAccountHolder,paymentAccountNumber, andsubPaymentMethod - Item fields:
ordervariantswith{ variant_unique_id, quantity },orderbundleswith{ bundle_price_option_unique_id, quantity }, or legacyorderlines - Discount and pricing fields:
discountCodeCode,productDiscount,shippingCost,shippingDiscount - Attribution-safe fields:
fbc,fbp,ttclid,gclid,ttp,clickId,eventSourceUrl,adSource, UTM fields, andaffiliateCode - Optional safety fields:
recaptchaToken,cartId
unique_id values from Scalev.data.get().store; do not submit numeric product, variant, or bundle ids as order item identifiers.
Do not create orders automatically on page load.
Scalev.analytics.track(providerOrPayload, payload?)
Forwards configured analytics events through Scalev.
fbfacebooktiktokkwai
Scalev.prefill.get()
Reads safe browser-scoped form prefill data.
Scalev.prefill.save(form, metadata?)
Saves safe form prefill data for later visits.
Scalev.customer.prefill()
Currently returns null unless Scalev enables mediated customer tokens for the page.
null.

