tys.garments.update_draft()
Replace a draft’s content. Published versions never change (409).
def update_draft(garment_id: str, garment: GarmentInput) -> GarmentVersionParameters
Section titled “Parameters”garment_idstrRequiredThe draft's ID.
garmentGarmentInputRequiredProperties
categoryGarmentCategoryRequiredThe garment type; it sets which POMs are needed.
fit_intentFitIntentRequiredThe designer's intended silhouette; sets the ease targets the fit judgement compares against.
sizesstring[]RequiredSize labels, smallest to largest.
pomsPOMTableRequiredGarment measurements per size: size label → POM code → millimetres. Widths are flat half-measurements. See GET /v1/studio/garment_dictionary for codes and plausible ranges.
gradingGradingRuleOptionalHow 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.
fabricFabricRequiredWhat the tech pack / mill sheet says.
import_idstringOptionalPattern import linked to this version (omit to unlink).
seasonstringOptionalSeason tag, e.g. "SS27".
tolerances_mmTolerancesMMOptionalSpec-sheet tolerance per POM code, ± mm (e.g. {"chest_width": 10}). Optional; the flat preview uses ±5 mm when a POM has none.
spec_sourceSpecSourceOptionalWhere the POM table came from, kept for audit. Set by Studio's paste/import.
Returns
Section titled “Returns”GarmentVersion: The updated draft. Published versions never change (409).
Example
Section titled “Example”tys.garments.update_draft(draft["id"], {**garment, "season": "SS27"}) # replaces the draftawait tys.garments.updateDraft(draft.id, { ...garment, season: "SS27" }); // replaces the draftcurl -X PUT https://api.tryyoursize.com/v1/garments/<garment_id> \ -H "Authorization: Bearer $TRYYOURSIZE_SECRET_KEY" \ -H "TYS-Version: 2026-10-25" \ -H "Content-Type: application/json" \ -d '{"category":"tshirt","fit_intent":"regular","sizes":["S","M","L"],"poms":{"S":{"chest_width":480},"M":{"chest_width":510},"L":{"chest_width":540}},"fabric":{"composition":[{"fiber":"cotton","pct":100}],"weight_gsm":180}}'See also
Section titled “See also”Was this page helpful?
Thank you. We read every answer.