App. Docs
Variant
The core sellable unit that holds inventory, pricing context, and channel listings.
Setup
- Navigate to the item you want to edit.
- Add item options (e.g., Size, Color). Stockmate will auto-generate the possible variant combinations in the Variants table.
- Remove any variants you don't plan to sell; you can re-add them anytime using the "Add Variant" button at the bottom of the Variants table on the item edit page.
- To create or re-add a variant, click "Add Variant" and provide the required details.
- Optionally set MPN, cost, thresholds, pack size, and a note.
- Save the variant, then add one or more Listings to track different prices or alternaitvity (import listings from a sales channel intergration).
Tip
Variants manage shared inventory across all of their listings. Use pack size to handle multi-quantity units (e.g., cases of 6).
Attributes
variant.schema.ts
1type Variant = {
2 // Unique identifier within company scope
3 id: string; // uuid
4 companyId: string; // uuid
5 productId: string; // uuid
6
7 // Identifiers and costing
8 mpn?: string;
9 cost?: decimal;
10
11 // Options and customisation
12 options?: Json; // key-value option map (e.g. size, color)
13 customFields?: Json; // user-defined fields
14 note?: string;
15
16 // Inventory thresholds and last ordered context
17 lowStockThreshold?: number;
18 shortDatedThreshold?: number;
19 lastOrderedQuantity?: number;
20
21 // Sales channel staging toggle
22 salesChannelStaging?: boolean;
23
24 // Packaging and media
25 packSize?: number; // e.g. units per pack/case
26 imageId?: string; // uuid
27
28 // Audit fields
29 createdAt?: Date;
30 modifiedAt?: Date;
31 modifiedById?: string; // uuid
32 modifiedByEmail?: string;
33 modifiedByEndpoint?: string;
34
35 // Relations
36 product: Item;
37 stocks: Stock[];
38 orderItems: OrderItem[];
39 combinations: Combination[];
40 image?: File;
41 listings: Listing[];
42}
Inventory & Sales
Shared Inventory
A variant represents the single source of truth for stock. All linked listings decrement the same inventory pool.
Overselling Prevention
Inventory updates from orders, returns, or manual adjustments propagate across all sales channels instantly.
Automatic Sync
Sales, returns, and purchase receipts adjust variant stock in real time.
Central Management
Configure options, images, pack size, and thresholds at the variant level.
Options & Pack Size
Variants can carry option data (like size, color, or any custom attribute) via theoptions
field. Use packSize
to represent multi-unit packs (e.g., a case of 12). Listings can apply a variantMultiplier to control how many units are deducted per sale.