A try-on's status, progress and result
const url = 'https://api.tryyoursize.com/v1/tryon/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0?view=full';const options = {method: 'GET', headers: {'TYS-Publishable-Key': '<TYS-Publishable-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.tryyoursize.com/v1/tryon/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0?view=full' \ --header 'TYS-Publishable-Key: <TYS-Publishable-Key>'Key: publishable (pk_test_… / pk_live_…), from an origin registered for the key.
Readable only by the viewer the try-on was issued to: send the viewer_token from POST /v1/tryon as Authorization: Bearer tys_view_…, or the session of the signed-in shopper who started it. Anyone else (another session, no token) gets 404.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”full (default) answers with the whole result (meshes for every size, MBs). summary leaves result out and answers summary instead (the recommended size and the sizes that can be worn, a few bytes): for the size-guide button and the store’s recommended-size event, which never need the meshes.
Responses
Section titled “Responses”The try-on
A try-on: every size of the product’s published garment shown on the body. Poll GET /v1/tryon/{tryon_id} every ~2 s until status is done or failed. A repeated try-on of the same garment version and body answers at once.
object
The try-on’s id (uuid). Empty only for a size estimate (POST ?start=false&view=summary answered with no try-on of this body); there is nothing to poll.
Only in the answer to POST /v1/tryon: the window’s proof that it may read this try-on. Send it as Authorization: Bearer tys_view_… to GET /v1/tryon/{tryon_id}. Stored hashed; never sent again.
object
Present when status is done, and while it runs: the sizes computed so far, each with method (simulated) and state (preview: shown early, may still change; settled; refining: still being computed, no mesh yet; simulated). The try-on result for the window: body mesh and body_state (no basics, no tape measurements), garment with its fabric and estimated POMs, recommended size and per-size meshes, pressure kPa, ease mm and zones. Binary arrays are base64 little-endian; per-vertex values are rounded to display precision.
object
Present when status is done and the request asked for view=summary: what a store may receive (sizes only, never measurements). Size labels are the garment’s (Studio) sizes; map them with shop_sizes from GET /v1/products/{product}/tryon.
object
The recommended size; absent when no size can be worn.
Sizes that can be worn on this body (judged on this body), smallest to largest.
How the size was determined: estimate (a size estimate, no try-on of this body yet) or simulated (from the try-on of this body). A coarse informational label: do not build logic on its values.
The size answer with its method. On the first answer of a try-on it may already be there (method: estimate) while the 3D view is computed; once done it is the try-on’s own size. An estimate is final (ready or none) only when it is certain for this body; otherwise the status is computing, no size is named, and the try-on’s 3D view gives it.
object
Same as summary.method. A coarse informational label; do not build logic on its values.
Present when status is failed.
object
INVALID_BODY, UNSUPPORTED_CATEGORY, MISSING_POM, INVALID_POM, INVALID_FABRIC, NO_SIZES, UNAVAILABLE or ENGINE_ERROR.
Example
{ "status": "queued", "summary": { "method": "estimate" }, "recommendation": { "method": "estimate", "status": "ready" }}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"}Was this page helpful?
Thank you. We read every answer.