Publish a complete draft
const url = 'https://api.tryyoursize.com/v1/garments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/publish';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryyoursize.com/v1/garments/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/publish \ --header 'Authorization: Bearer <token>'Key scopes: garments:publish. A secret key (sk_) has every scope; a restricted key (rk_) needs the scopes listed.
The version shoppers are fitted against from now on, for every product of its fit group. The same checks as Studio: every required point of measure for every size, fabric, the fit approval when the store requires it, every shop size mapped, and the plan’s styles (402). Test answers drafts, live answers published versions only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A garment version (garment_versions.id). A fit group (garments table) is fit_group_id.
Header Parameters
Section titled “Header Parameters”A unique value per logical request (a UUID v4 is ideal), 1-255 printable ASCII characters. With a secret or restricted key, the first response is stored for 24 hours per store and mode: a retry with the same key and the same body gets the stored response back (header Idempotent-Replayed: true); the same key with a different body is 422 idempotency_key_reused; a retry while the first request still runs is 409 idempotency_key_in_use. Responses with a 5xx status are not stored, so a retry runs again.
Responses
Section titled “Responses”Published
object
The garment type; it sets which POMs are needed.
The designer’s intended silhouette; sets the ease targets the fit judgement compares against.
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.
object
object
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.
object
object
What the tech pack / mill sheet says.
object
object
Areal density, g/m².
Stretch along the warp (lengthwise), percent.
Stretch along the weft (crosswise), percent.
What still blocks publishing (errors) or deserves a look (warnings).
object
E.g. out_of_range, not_graded, missing_pom, composition_total
Category | fit_intent | sizes | poms | grading | import | fabric.
The values in message, for clients that word the finding in their own language (keys depend on code, e.g. value_mm, min_mm, max_mm, prev_size, fiber, max). Numbers are plain decimals (“.” separator); lengths in mm.
object
English text; clients in other languages can word it from code, size, pom and params.
Spec-sheet tolerance per POM code, ± mm (e.g. {“chest_width”: 10}). Optional; the flat preview uses ±5 mm when a POM has none.
object
Where the POM table came from, kept for audit. Set by Studio’s paste/import.
object
The fit group (garments row) this version belongs to (absent until grouped).
Example
{ "status": "draft", "category": "tshirt", "fit_intent": "skinny", "fabric": { "construction": "jersey", "composition": [ { "fiber": "cotton" } ] }, "issues": [ { "severity": "error" } ], "spec_source": { "kind": "manual" }}Missing or invalid credentials
Every error has this shape. error is a human-readable message, status the HTTP status. code is stable and machine-readable; doc_url links its explanation; request_id identifies the request (also in the X-Request-ID response header): quote it to support.
object
Stable error code, e.g. invalid_request, unauthorized, reauth_required, payment_required, forbidden, not_found, conflict, unprocessable, rate_limited, internal_error, not_implemented, unavailable, invalid_api_version, idempotency_key_in_use, idempotency_key_reused, invalid_idempotency_key, handle_expired, handle_invalid.
Example
{ "code": "not_found", "doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"}Not allowed
Every error has this shape. error is a human-readable message, status the HTTP status. code is stable and machine-readable; doc_url links its explanation; request_id identifies the request (also in the X-Request-ID response header): quote it to support.
object
Stable error code, e.g. invalid_request, unauthorized, reauth_required, payment_required, forbidden, not_found, conflict, unprocessable, rate_limited, internal_error, not_implemented, unavailable, invalid_api_version, idempotency_key_in_use, idempotency_key_reused, invalid_idempotency_key, handle_expired, handle_invalid.
Example
{ "code": "not_found", "doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"}Not found
Every error has this shape. error is a human-readable message, status the HTTP status. code is stable and machine-readable; doc_url links its explanation; request_id identifies the request (also in the X-Request-ID response header): quote it to support.
object
Stable error code, e.g. invalid_request, unauthorized, reauth_required, payment_required, forbidden, not_found, conflict, unprocessable, rate_limited, internal_error, not_implemented, unavailable, invalid_api_version, idempotency_key_in_use, idempotency_key_reused, invalid_idempotency_key, handle_expired, handle_invalid.
Example
{ "code": "not_found", "doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"}Conflicts with the current state (duplicate SKU, editing a published version)
Every error has this shape. error is a human-readable message, status the HTTP status. code is stable and machine-readable; doc_url links its explanation; request_id identifies the request (also in the X-Request-ID response header): quote it to support.
object
Stable error code, e.g. invalid_request, unauthorized, reauth_required, payment_required, forbidden, not_found, conflict, unprocessable, rate_limited, internal_error, not_implemented, unavailable, invalid_api_version, idempotency_key_in_use, idempotency_key_reused, invalid_idempotency_key, handle_expired, handle_invalid.
Example
{ "code": "not_found", "doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"}Values to fix (each issue points at the field, size and POM)
object
object
E.g. out_of_range, not_graded, missing_pom, composition_total
Category | fit_intent | sizes | poms | grading | import | fabric.
The values in message, for clients that word the finding in their own language (keys depend on code, e.g. value_mm, min_mm, max_mm, prev_size, fiber, max). Numbers are plain decimals (“.” separator); lengths in mm.
object
English text; clients in other languages can word it from code, size, pom and params.
Example
{ "issues": [ { "severity": "error" } ]}Was this page helpful?
Thank you. We read every answer.