Skip to content

tys.products.garments.create_draft()

Methodtryyoursize

Start a draft version: sizes, points of measure (mm) per size, grading, fabric.

A 422 raises InvalidRequestError with the issues in err.body["issues"].

def create_draft(product: str, garment: GarmentInput, *, idempotency_key: Optional[str] = None) -> GarmentVersion
productstrRequired

The product's TryYourSize ID or your SKU (URL-encoded for you).

garmentGarmentInputRequired

The garment: category, fit intent, sizes, points of measure per size (mm), grading and fabric.

Properties
categoryGarmentCategoryRequired

The garment type; it sets which POMs are needed (footwear has a size chart instead).

fit_intentFitIntentRequired

The designer's intended silhouette; sets the ease targets the fit judgement compares against.

sizesstring[]Required

Size labels, smallest to largest.

pomsPOMTableRequired

Garment measurements per size: size label → POM code → millimetres. Widths are flat half-measurements. See GET /v1/studio/garment_dictionary for codes and plausible ranges.

gradingGradingRuleOptional

How the POM table was derived: the base size's values plus, per POM, the increment (mm) between each pair of consecutive sizes (len = number of sizes - 1). The table stays the source of truth.

fabricFabricRequired

What the tech pack / mill sheet says.

import_idstringOptional

Pattern import linked to this version (omit to unlink).

seasonstringOptional

Season tag, e.g. "SS27".

tolerances_mmTolerancesMMOptional

Spec-sheet tolerance per POM code, ± mm (e.g. {"chest_width": 10}). Optional; the flat preview uses ±5 mm when a POM has none.

spec_sourceSpecSourceOptional

Where the POM table came from, kept for audit. Set by Studio's paste/import.

footwearFootwearChartOptional

A footwear version's size chart (category footwear). The version's sizes must be the chart's labels in the chart's size_system, in row order (fittings collapsed). Footwear has no POMs and no 3D fit check.

elastic_waistbooleanOptional

Waistband of trousers, shorts, skirts and leggings: true = elastic pull-on waistband, false = fixed band (button or zip), null or absent = not stated. Giving waist_extended_width in the POM table implies elastic. Ignored (with the warning elastic_waist_ignored) for other categories.

elastic_waist_inferredbooleanOptional

True when elastic_waist was inferred from text (product name, fabric, description) rather than stated by the brand.

rise_type"low" | "mid" | "high"Optional

Bottoms (jeans, trousers, shorts, skirt, leggings): where the waistband is worn, low, mid or high rise; null or absent = not stated. Ignored (with the warning worn_at_ignored) for other categories.

rise_type_inferredbooleanOptional

True when rise_type was inferred from text (product name, description) rather than stated by the brand.

worn_at_mmnumberOptional

Bottoms: height of the waistband top relative to the natural waist, mm, negative = below. Null or absent = derived from the rise measurements.

idempotency_keyOptional[str]Optional= None

GarmentVersion: The draft garment version, with issues that still block publishing.

garment = {
"category": "tshirt",
"fit_intent": "regular",
"sizes": ["S", "M", "L"],
"poms": {"S": {"chest_width": 480}, "M": {"chest_width": 510}, "L": {"chest_width": 540}}, # mm
"fabric": {"composition": [{"fiber": "cotton", "pct": 100}], "weight_gsm": 180},
}
draft = tys.products.garments.create_draft("TEE-001", garment)
print(draft["version"], draft["issues"])

Was this page helpful?