Commerce Architecture
WASM Checkout (WebAssembly at Checkout)
Definition
The use of WebAssembly modules to run merchant-defined logic inside checkout. Shopify Functions, the replacement for Ruby-based Shopify Scripts, is the best-known implementation: logic is compiled to WebAssembly and executed in a sandbox within Shopify's checkout.
By Herzel MishelFounder, AgentisLast reviewed
WASM checkout refers to executing merchant-defined logic during checkout as WebAssembly modules. The most concrete example is Shopify Functions: developers write discount, validation, delivery, payment, or cart-transform logic in Rust, JavaScript, or another language that compiles to WebAssembly, and Shopify runs the compiled module inside its own checkout infrastructure. Shopify moved to this model to replace Shopify Scripts, its earlier Ruby-based surface, which stopped executing on June 30, 2026. WebAssembly suits this job for three reasons: it executes quickly and predictably, which matters for anything inserted into checkout; it is sandboxed, so one merchant's code cannot reach the file system or other tenants; and it is language-flexible, so one runtime can serve many developers. The trade-offs against Scripts are mostly about effort and data. Functions can do more than Scripts did and are the supported path, but they require a developer comfortable with the toolchain and Shopify's input and output schemas. They also run under strict resource limits and, for most function types, cannot call external systems during execution, so any data a rule depends on, such as cost or margin thresholds, has to be staged ahead of time (for example in metafields) and kept current by a separate process. For margin governance, that means a WASM-based checkout rule can only be as accurate as the data that was staged for it. Agentis does not use WebAssembly or Shopify Functions and does not run in checkout. It reads each order after it is placed, computes true net margin within 60 seconds from live store data, NetSuite COGS, freight, fees, and FX, and flags the order or holds it before fulfillment under merchant-approved rules. WASM checkout and a post-order margin check answer different questions: the first shapes what a buyer can submit, the second decides whether a submitted order should ship.
Sources
Related Terms
Profit Governance
Checkout Governance
The set of rules applied inside checkout that decide which discount combinations, shipping options, payment methods, and order configurations a buyer can complete. It acts before the order is placed, which makes it distinct from post-order margin controls that act before fulfillment.
Profit Governance
Policy Engine
The configurable rules layer of a profit firewall, where finance teams declaratively define margin floors, discount limits, MAP rules, and other enforcement criteria.
Profit Governance
Profit Firewall
A decision layer between order placed and order shipped that checks every order against margin policy and flags or holds the ones that fail before fulfillment, analogous to how a network firewall stops traffic that violates security rules.
More in Commerce Architecture
See how Agentis compares to other ecommerce profit tools → View all comparisons