Skip to content

The colourways the window draws on the simulated garment

GET
/v1/products/{product}/appearance
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.

product
required
string
>= 1 characters <= 120 characters

The product’s SKU / style ID in the store.

colour
string
<= 80 characters

The shop’s selected colour option value; picks selected (case-insensitive key match).

Appearance

Media typeapplication/json

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
product
required
string
colourways
required
Array<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
key
required

The shop’s colour option value (“Rinse indigo”), or “” for the product itself.

string
<= 80 characters
name

Display name of the colour.

string
<= 80 characters
base_color
required

The fabric’s colour, sRGB hex.

string
/^#[0-9a-fA-F]{6}$/
finish
required

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).

string
Allowed values: matte_jersey denim_twill rib satin
print

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
asset_id
required
string format: uuid
width_cm
required

Width of one repeat on the fabric, cm (across the grain before rotation).

number format: double
>= 0.2 <= 200
height_cm
required

Height of one repeat on the fabric, cm (along the grain before rotation).

number format: double
>= 0.2 <= 200
offset_x_cm

Shift of the tile origin across the grain, cm.

number format: double
offset_y_cm

Shift of the tile origin along the grain, cm.

number format: double
rotation_deg

Angle of the tile’s vertical to the grainline, degrees counter-clockwise (0 = upright on the grain).

number format: double
panels
Array<object>
<= 16 items

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
panel
required
string
/^[a-z0-9_]{1,40}$/
hide_repeat

Leave this piece in the base colour (no all-over print).

boolean
placement

Artwork printed once on a pattern piece (a chest print), positioned in cm.

object
asset_id
required
string format: uuid
width_cm
required

Printed width, cm. The height follows the artwork’s aspect ratio.

number format: double
>= 0.5 <= 150
x_cm
required

Centre of the artwork from the piece’s centre line, cm (+ toward the piece’s +u side).

number format: double
y_cm
required

Centre of the artwork down from the piece’s highest point (the high point shoulder on a bodice), cm.

number format: double
rotation_deg
number format: double
selected

Index into colourways of the one matching ?colour= (else 0, the default). Absent when there are none.

integer
assets
required
Array<object>

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
id
required
string format: uuid
filename
required
string
content_type
required
string
Allowed values: image/png image/jpeg image/svg+xml
bytes
required
integer format: int64
width_px
required

Pixel width (SVG, its viewBox width).

integer
height_px
required
integer
url
required

Path of the file on this API (/v1/appearance_assets/{id}), relative to the API base URL.

string
created_at
required
string format: date-time

Example

{
"colourways": [
{
"finish": "matte_jersey"
}
],
"assets": [
{
"content_type": "image/png"
}
]
}

Missing or invalid credentials

Media typeapplication/json

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
error
required
string
status
required
integer
code

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.

string
doc_url
string format: uri
request_id
string

Example

{
"code": "not_found",
"doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"
}

Not allowed

Media typeapplication/json

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
error
required
string
status
required
integer
code

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.

string
doc_url
string format: uri
request_id
string

Example

{
"code": "not_found",
"doc_url": "https://docs.tryyoursize.com/api/errors/#not_found"
}

Was this page helpful?