Ir al contenido

tys.products.garments.create_draft()

Esta página aún no está disponible en tu idioma.

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
productstrObligatorio

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

garmentGarmentInputObligatorio

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

Propiedades
categoryGarmentCategoryObligatorio

The garment type; it sets which POMs are needed.

fit_intentFitIntentObligatorio

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

sizesstring[]Obligatorio

Size labels, smallest to largest.

pomsPOMTableObligatorio

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.

gradingGradingRuleOpcional

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.

fabricFabricObligatorio

What the tech pack / mill sheet says.

import_idstringOpcional

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

seasonstringOpcional

Season tag, e.g. "SS27".

tolerances_mmTolerancesMMOpcional

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_sourceSpecSourceOpcional

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

idempotency_keyOptional[str]Opcional= 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"])

¿Te ha resultado útil esta página?