Logo

Are you dreaming of a freshly
designed website? Book a consultation today!

Contact Us

MeritSKU

Case Study

AI E-Commerce Intelligence & Landed Cost Optimization

MeritSKU is a high-performance e-commerce intelligence platform that solves the critical blind spot facing multi-channel merchants: hidden margin erosion. While traditional analytics track top-line GMV, MeritSKU computes the true CM2 contribution margin of every inventory unit across Shopify, WooCommerce, and Amazon SP-API.

Engineered with an unwavering 100% draft-only invariant, the platform protects client catalogs by ensuring no AI recommendation or automated repricing changes live storefront listings without human authorization.

Project Type:

Enterprise SaaS Platform

Status:

Production — Live

Live URL:

meritsku.com

Architecture:

Turborepo Monorepo

Database:

PostgreSQL 16 (RLS)

Hosting:

Google Cloud Run

12+

Landed Cost Factors

6+

MeritScore Dimensions

100%+

Draft-Only Invariant

Product Showcase

The Live Platform

MeritSKU live intelligence platform dashboard — landed cost calculation, SKU ranking, and multi-channel metrics

Problem Statement

The Challenge

Modern e-commerce brands often see rising revenues alongside vanishing bank balances. Standard dashboard metrics conceal insidious operational costs: overseas shipping surcharges, demurrage fees, import tariffs, 3PL storage penalties for slow-moving inventory, platform transaction take-rates, and return processing losses.

Furthermore, merchants feared automated tools that aggressively push listing changes or price updates directly into active marketplaces, risking compliance flags, search rank penalties, or unintended inventory dumps. The industry demanded an enterprise-grade system combining rigorous financial math with ironclad operational safeguards.

The 12 Factors of True Landed Cost (CM2)

MeritSKU replaces flawed gross-margin guesswork with surgical per-unit economics:

1. Wholesale Unit Cost
2. Inbound Ocean/Air Freight
3. Customs Duties & Tariffs
4. Port Drayage & Clearance
5. 3PL Receiving & Prep
6. Monthly Storage Cost Drag
7. Pick & Pack Outbound Fees
8. Channel Sales Commission
9. Payment Gateway Fees
10. Return & Restock Rate
11. Allocated Ad Spend (CAC)
12. Packaging & Collateral

Platform Architecture

Core Platform Capabilities

Icon

12-Factor Landed Cost (CM2)

Calculates true contribution margin factoring inbound freight, customs duties, 3PL storage fees, pick & pack, platform commissions, payment processing, returns, and allocated ad spend.
Icon

6-Dimension MeritScore

Proprietary composite index scoring every SKU from 0–100 across margin health, velocity, return rate, fulfillment drag, advertising efficiency, and seasonality risk.
Icon

100% Draft-Only Invariant

Strict architectural guarantee: AI optimization proposals and listing adjustments never push live automatically. Every mutation is staged as a draft requiring human merchant signoff.
Icon

Multi-Channel Ingestion

Seamless bi-directional synchronization across Shopify GraphQL, WooCommerce REST API, and Amazon Selling Partner API (SP-API) into a unified SKU catalog.
Icon

Margin Erosion Warning

Real-time anomaly detection alerts merchandising teams the instant shipping rate hikes or supplier cost changes push a profitable item into cash-negative territory.
Icon

Automated Tariff & HS Code AI

Dual-engine LLMs assist in classifying harmonized tariff codes (HS Codes), resolving volumetric dimensional freight weight discrepancies, and forecasting landed customs fees.

Algorithmic SKU Intelligence

The 6-Dimension MeritScore

Instead of sorting inventory purely by sales volume or basic markup, MeritSKU scores each SKU dynamically from 0 to 100 across six weighted operational vectors:

  • CM2 Margin Health (30%): True net profitability after all 12 landed cost factors.
  • Sales Velocity (20%): Turn rate and sales cadence across connected active channels.
  • Return Propensity (15%): Historical RMA frequency, customer dissatisfaction risk, and return freight penalty.
  • Storage Cost Drag (15%): Days in inventory relative to warehouse storage fees and volumetric footprint.
  • Advertising Efficiency (10%): Blended TACoS and incremental ROAS attribution per product.
  • Seasonality & Lead Time Risk (10%): Supplier lead time variance vs. demand cycle fluctuations.

The 100% Draft-Only Invariant

A cornerstone of Razor Consulting's architectural design: MeritSKU enforces an unbreakable invariant across all store connections:

INVARIANT: All SKU title revisions, description rewrites, price adjustments, and bundle suggestions must be saved exclusively as merchant drafts. Direct production mutation is denied by design.

This eliminates catastrophic pricing errors and ensures human brand governance over every AI-generated asset.

Built With

Technology Stack & Architecture

Monorepo Architecture

Turborepo (TypeScript 5.8 + Node 22)

Frontend Framework

Next.js 15 (App Router + Server Components)

Database & Isolation

PostgreSQL 16 with Row-Level Security (RLS)

Data Access Layer

Drizzle ORM (Type-Safe Schema & Migrations)

Cloud Infrastructure

Google Cloud Run + Cloud SQL (Private VPC)

AI Reasoning Engines

Multi-Engine LLM (Google Gemini & Claude)

E-Commerce Integrations

Shopify GraphQL, WooCommerce REST, Amazon SP-API

Test Suite & Rigor

2,209 Passing Automated Tests (Unit, RLS, Invariant)

Design System

Tailwind CSS + Radix UI Primitives

Security & Auth

Multi-Tenant RBAC + Session Security Middleware

Enterprise Tenant Isolation

PostgreSQL Row-Level Security (RLS)

In multi-tenant SaaS, tenant isolation cannot rely on developer discipline or application-level WHERE org_id = ? clauses alone. MeritSKU delegates isolation to the PostgreSQL kernel itself.

  • PostgreSQL 16 native Row-Level Security enabled across all tenant tables
  • Connection session configuration sets app.current_org_id per transaction
  • Drizzle ORM schema with strict tenant verification wrappers
  • Automated RLS test suite actively verifying cross-tenant query rejections
  • Zero tenant leakage possible even in the event of an application-layer bug
  • Encrypted marketplace credentials stored with KMS-backed envelope encryption

-- PostgreSQL Kernel RLS Policy

ALTER TABLE inventory_skus ENABLE ROW LEVEL SECURITY;

CREATE POLICY tenant_isolation_policy ON inventory_skus

USING (org_id = current_setting('app.current_org_id')::uuid);

✓ 2,209 Tests Passed | 100% Tenant Boundary Enforced

Ready to engineer your next
enterprise platform?

Book an Architecture Call