Architecture

Unified Types

The @commercejs/types package provides a single data model that works across every eCommerce platform.

The @commercejs/types package is the foundation of CommerceJS. It defines TypeScript interfaces for every eCommerce domain β€” products, carts, orders, customers, payments, and more.

Why Unified Types?

Every eCommerce platform represents data differently. Salla calls it name, Shopify calls it title. Salla uses regular_price, Shopify uses price. The unified types normalize these differences into a single vocabulary.

// Same Product type, regardless of source
interface Product {
  id: string
  name: LocalizedString
  slug: string
  description: LocalizedString
  price: DiscountablePrice
  variants: ProductVariant[]
  images: Image[]
  // ... more fields
}

Adapters map platform-specific data into these types, so application code never deals with platform differences directly.

Domain Coverage

Domain Coverage

Unified Type System

Implemented Domains
πŸ›Catalog
πŸ›’Cart
πŸ“¦Orders
πŸ‘€Customers
πŸ’³Checkout
⭐Reviews
🏷Brands
🌍Countries
❀️Wishlist
🎟Promotions
πŸ“‹Returns
πŸͺStore
Planned Domains
🎁Gift Cards
πŸ“Locations
🏭Wholesale
πŸ”¨Auctions
Implemented
Planned
Documentation Asset // COMMERCE_JS_TYPES_01