Skip to content

SKUs & Products

SKUs are the atomic unit of the PrintStudio product catalog. Every printable product is pre-costed as a SKU — the pricing engine computes margins before any order is placed.

A SKU specifies everything needed to produce and price a product:

{
id: string; // e.g. "sku-pla-black-20mm-cube"
name: string; // Human-readable name
description: string;
machineType: "fdm_large" | "fdm_standard" | "resin" | "laser";
material: string; // Material ID
estimatedPrintTime: number; // minutes
estimatedMaterialGrams: number;
basePrice: number; // Floor cost in USD
qualityTiers: {
draft: { multiplier: number };
standard: { multiplier: number };
fine: { multiplier: number };
};
options: Array<{
key: string;
label: string;
type: "select" | "number" | "boolean";
choices?: string[];
priceModifier?: number;
}>;
active: boolean;
}
Terminal window
# All active SKUs
curl http://localhost:8787/api/skus \
-H "X-API-Key: your-api-key"
# Filter by machine type
curl "http://localhost:8787/api/skus?machineType=fdm_large" \
-H "X-API-Key: your-api-key"
# Include inactive SKUs
curl "http://localhost:8787/api/skus?includeInactive=true" \
-H "X-API-Key: your-api-key"
Terminal window
curl http://localhost:8787/api/skus/sku-pla-black-20mm-cube \
-H "X-API-Key: your-api-key"
Terminal window
curl -X POST http://localhost:8787/api/skus \
-H "Content-Type: application/json" \
-H "X-API-Key: your-admin-key" \
-d '{
"name": "PLA Enclosure Panel",
"description": "Flat 3mm PLA panel for enclosure walls",
"machineType": "fdm_large",
"material": "pla",
"estimatedPrintTime": 180,
"estimatedMaterialGrams": 85,
"basePrice": 22.00,
"qualityTiers": {
"draft": { "multiplier": 0.8 },
"standard": { "multiplier": 1.0 },
"fine": { "multiplier": 1.4 }
},
"options": [
{
"key": "color",
"label": "Color",
"type": "select",
"choices": ["black", "white", "grey", "red"]
},
{
"key": "thickness",
"label": "Thickness (mm)",
"type": "number",
"priceModifier": 2.5
}
]
}'

The pricing engine applies multipliers in order:

finalPrice = basePrice
× qualityTierMultiplier
× demandMultiplier (computed from recent order volume)
× materialCostMultiplier (from current filament price)
+ rushSurcharge (if delivery < 48h)
× batchDiscount (if quantity ≥ 5)
+ optionModifiers

To preview pricing for a specific configuration:

Terminal window
curl -X POST http://localhost:8787/api/skus/sku-uuid/quote \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"quantity": 3,
"options": { "color": "black", "quality": "fine" },
"rush": false
}'

Deactivated SKUs are hidden from the storefront but remain on existing orders.

Terminal window
curl -X PATCH http://localhost:8787/api/skus/sku-uuid \
-H "Content-Type: application/json" \
-H "X-API-Key: your-admin-key" \
-d '{ "active": false }'