The colourways the window draws on the simulated garment
const url = 'https://api.tryyoursize.com/v1/products/example/appearance';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/products/example/appearance \ --header 'TYS-Publishable-Key: <TYS-Publishable-Key>'Key: publishable (pk_test_… / pk_live_…), from an origin registered for the key.
Called by the window (or the brand’s page) with the publishable key, from an allowed origin of the store or the window’s own domain. Never 404: an unknown product, or one without appearance, has no colourways. Cached by the browser for a minute.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The product’s SKU / style ID in the store.
Query Parameters
Section titled “Query Parameters”The shop’s selected colour option value; picks selected (case-insensitive key match).
Responses
Section titled “Responses”Appearance
What the shopper’s window shows on the simulated garment: the product’s colourways and their artwork. Product data only (no shopper data). Switching colourway is instant (no new try-on). colourways is empty when the product has no appearance (or is unknown).
object
One colour of a product. A product that is itself a colourway (colourways are separate products in one fit group) has one, with an empty key. A product that carries several colours as variants (a Shopify product with a Color option) has one per option value, keyed by that value. The first is the default.
object
The shop’s colour option value (“Rinse indigo”), or “” for the product itself.
Display name of the colour.
The fabric’s colour, sRGB hex.
Fabric finish preset. The viewer draws its surface detail (normal and roughness) from small procedural maps at true scale: matte_jersey (knit loops, soft sheen), denim_twill (diagonal 2/1 twill), rib (wales along the grain), satin (smooth, low roughness, sheen).
An all-over print: one tile of the brand’s artwork repeated at its real size, placed in each pattern piece’s own frame (u across the grain, v along it), like printed fabric under the cutter. The print is continuous inside a piece and breaks at seams, as on a real garment.
object
Width of one repeat on the fabric, cm (across the grain before rotation).
Height of one repeat on the fabric, cm (along the grain before rotation).
Shift of the tile origin across the grain, cm.
Shift of the tile origin along the grain, cm.
Angle of the tile’s vertical to the grainline, degrees counter-clockwise (0 = upright on the grain).
Changes the print on one pattern piece. panel is the piece name, as in the try-on result’s panels and the flat preview: front, back, sleeve_pos, sleeve_neg (T-shirt); front_pos, back_pos, front_neg, back_neg, waistband (jeans).
object
Leave this piece in the base colour (no all-over print).
Artwork printed once on a pattern piece (a chest print), positioned in cm.
object
Printed width, cm. The height follows the artwork’s aspect ratio.
Centre of the artwork from the piece’s centre line, cm (+ toward the piece’s +u side).
Centre of the artwork down from the piece’s highest point (the high point shoulder on a bodice), cm.
Index into colourways of the one matching ?colour= (else 0, the default). Absent when there are none.
Print artwork uploaded by the brand: a repeat tile or a placement print (PNG, JPEG or SVG). Immutable. The same file uploaded twice to a store is the same asset.
object
Pixel width (SVG, its viewBox width).
Path of the file on this API (/v1/appearance_assets/{id}), relative to the API base URL.
Example
{ "colourways": [ { "finish": "matte_jersey" } ], "assets": [ { "content_type": "image/png" } ]}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"}Was this page helpful?
Thank you. We read every answer.