EdgeWholesale: Native B2B & Wholesale Engine
Production Shopify App on the Shopify App Store
Eliminated the need for a $2,000/mo Shopify Plus contract for merchants requiring B2B wholesale tiered discounts and MOQ validation.
Engineered in pure Rust compiled to WebAssembly (wasm32-wasip1). Executes directly on Shopify's global edge infrastructure during checkout in < 0.8ms, injecting 0.0 KB of theme JavaScript to preserve Google Core Web Vitals.
// Pure Rust Wasm discount evaluator (<0.8ms execution)
#[shopify_function_target(query_path = "src/run.graphql")]
pub fn run(input: input::ResponseData) -> Result<output::FunctionRunResult, Box<dyn Error>> {
let customer_tags = input.cart.buyer_identity.as_ref()
.and_then(|b| b.customer.as_ref())
.map(|c| &c.tags);
// Zero external DB latency - executed synchronously inside edge Wasm sandbox
Ok(calculate_tiered_discounts(input.cart.lines, customer_tags))