National Commerce Docs
Database

Products & SKUs

The three-tier SKU model (Base, Product, and Case SKUs), plus categories and the bill-of-materials junction that ties them together.

This page covers the catalog tables. National Commerce models a product in three tiers: a Base SKU is the physical inventory unit, a Product SKU is the sellable Amazon listing (often a multi-pack of base units), and a Case SKU is a case of base units used for replenishment. A junction table records the bill of materials between Product SKUs and Base SKUs.

Which SKU is which?

A Base SKU is what inventory is counted against. A Product SKU is what Amazon sells; it bundles one or more base units (Bundle_Count per pack). A Case SKU packs a fixed quantity of base units for purchase orders. See the glossary for the full definitions: Base SKU, Product SKU, Case SKU.

Base SKUs

The physical inventory unit. Inventory is tracked against a Base SKU's inventory_sku. Each Base SKU belongs to one Brand.

ColumnTypeNotes
idintegerPrimary key. Default from sequence "Base Item SKUs_id_seq" (a legacy rename).
inventory_skutextThe SKU that inventory is tracked against.
inventory_nametextDenormalized item name.
Activity_StatustextDefault 'Active'.
Product_Weight__lbs_numericUnit weight in pounds.
Product_Weight__Oz_numericUnit weight in ounces.
order_multiplebigintSmallest reorder increment. Default 1.
brand_idinteger→ references Brands.
brand_nametextDenormalized brand name.
created_at, updated_at, created_by, updated_bytimestamp / varcharStandard audit columns.

Automation. brand_name is kept in sync with the linked Brand by triggers (update_brand_name_for_base_sku on update, update_brand_name_for_base_sku_2 on insert). Changes to order_multiple are pushed down to matching Inventory rows by sync_base_sku_order_multiple_with_inventory (after update).

Base SKUs are the hub of the model: Product SKUs, Case SKUs, and the junction all point back to them, and Inventory is tracked against their inventory_sku.

Product SKUs

The sellable Amazon listing. A Product SKU usually represents a multi-pack of one Base SKU, with Bundle_Count units per pack. It carries listing, packing, and shipping metadata.

ColumnTypeNotes
idintegerPrimary key. Default from sequence "Product SKUs_id_seq".
Product_SKUtextThe listing's SKU string.
ASINtextAmazon product identifier.
Brands_idinteger→ references Brands.
Base Item SKUs_idinteger→ references Base SKUs. The base unit this listing is built from.
product_category_idbigint→ references product_categories.
Bundle_CountbigintUnits per pack. Default 1.
product_nametextListing name.
product_name_2textDefault is a generated-style expression: `inventory_name
Abbreviated_Product_TitletextShort title.
inventory_nametextDenormalized base item name.
brand_nametextDenormalized brand name.
Packing_Weight__lbs_numericPacking weight in pounds.
Packing_Weight__Oz_numericPacking weight in ounces.
Shipping_Weight__Oz_numericShipping weight in ounces.
Shipping_Dimensions__LWH_varcharLength/width/height.
ShipHero_Box_NametextBox used in ShipHero.
Product_tag_in_ShipherotextShipHero product tag. See warning below.
Product_Tag_in_ShipHerotextNear-duplicate ShipHero product tag. See warning below.
Postage_ThresholdnumericUnderlies postage threshold tracking.
created_at, updated_at, created_by, updated_bytimestamp / varcharStandard audit columns.

Duplicate ShipHero tag columns

This table has two columns that differ only in capitalization: Product_tag_in_Shiphero and Product_Tag_in_ShipHero. They are distinct columns. Confirm which one your code reads and writes before relying on either.

Automation. brand_name is kept in sync with the linked Brand by update_brand_name_for_product_sku (after update) and _2 (after insert). inventory_name is synced onto the linked Base SKU by update_base_sku_inventory_name_for_product_sku (after update) and _2 (after insert).

Each Product SKU links to one Base SKU (via Base Item SKUs_id), one Brand, and optionally one product_categories row. Its full bill of materials lives in the junction table.

Case SKUs

A case packs a fixed quantity of base units for replenishment. Case SKUs are used to build inventory replenishment purchase orders.

ColumnTypeNotes
idintegerPrimary key. Default from sequence "Case SKUs_id_seq".
case_skutextThe case SKU string. NOT NULL.
base_skuinteger→ references Base SKUs. The base unit packed into the case.
base_sku_quantityintegerBase units per case. Default 12.
brand_idinteger→ references Brands.
product_nametextCase name.
created_at, updated_at, created_by, updated_bytimestamptz / timestamp / varcharStandard audit columns.

Each Case SKU references one Base SKU and one Brand. See Purchase Orders for how cases feed replenishment.

product_categories

Product categories. Each category belongs to a single Brand, and Product SKUs reference categories through product_category_id.

ColumnTypeNotes
idbigintPrimary key. GENERATED ALWAYS AS IDENTITY.
nametextCategory name. NOT NULL.
brand_idinteger→ references Brands. NOT NULL.
created_at, updated_at, created_by, updated_bytimestamptz / varcharStandard audit columns.

A category belongs to exactly one Brand. Product SKUs point to a category via their product_category_id.

product_sku_base_sku_junction

The bill of materials: which Base SKUs, and how many of each, make up a Product SKU. Each row links one Product SKU to one Base SKU with a per-product quantity.

ColumnTypeNotes
idbigintPrimary key. GENERATED ALWAYS AS IDENTITY.
product_skuinteger→ references Product SKUs. NOT NULL.
base_skuinteger→ references Base SKUs. NOT NULL.
brandinteger→ references Brands. NOT NULL.
bundle_countnumericUnits of that base per product. NOT NULL.
created_attimestamptzDefault now().

A Product SKU can be composed of one or more Base SKUs; each pairing is one row here, with bundle_count recording how many base units that product includes.

product_skus_used

A small standalone lookup/tracking table of product SKU strings. It has no foreign keys and is not tied into the rest of the catalog model.

ColumnTypeNotes
idintegerPrimary key. NOT NULL.
product_skutextA product SKU string.

This table stands on its own; treat it as a simple list of SKU strings rather than part of the relational catalog.

More on triggers

The full trigger catalog for these tables lives on the Automation page. See also SKU Sync for how catalog data is reconciled with external systems.

On this page