Skip to content

tys.recommendations.create()

Methodtryyoursize

The shopper’s size for up to 25 products (SKUs), from a browser SDK handle.

Sizes only, in your labels: data`i has product, status`` (ready/computing/none/unavailable), size, studio_sizeandwearable_sizes. Never starts a simulation. Scope fit_checks:read`.

def create(*, handle: str, products: Iterable[str], idempotency_key: Optional[str] = None) -> RecommendationList
handlestrRequired

The handle from the browser SDK (await tys.recommendationHandle()), sent to your server.

productsIterable[str]Required

Up to 25 of your SKUs / style IDs.

idempotency_keyOptional[str]Optional= None

RecommendationList: {"data": [...]}, one recommendation per product, in your size labels. Sizes only.

productstringRequired
status"ready" | "computing" | "none" | "unavailable"Required

ready: a size. computing: a simulation the shopper started is running (ask again later). none: simulated, no size can be worn. unavailable: no published garment for this product, not simulated on this body yet, or the store's plan has no fit checks left. A page view or this API never starts a simulation.

sizestringRequired

The recommended size in the store's label (the product's size map), or null.

studio_sizestringRequired

The same size as entered in TryYourSize Studio, or null.

wearable_sizesstring[]Required

Sizes that can be worn on this body, in the store's labels.

tryon_idstringOptional

The try-on that produced the size, when there is one. Send it back with orders for attribution.

answer = tys.recommendations.create(handle=handle, products=["SKU-123", "SKU-456"])
for rec in answer["data"]:
if rec["status"] == "ready":
print(rec["product"], rec["size"], rec["wearable_sizes"])

Was this page helpful?