Skip to content

tys.recommendations.create()

Method@tryyoursize/node

handle comes from the browser SDK (await tys.recommendationHandle()), products are your SKUs / style IDs. Key scope: fit_checks:read.

create(params: RecommendationsRequest, options?: RequestOptions): Promise<RecommendationList>
paramsRecommendationsRequestRequired
Properties
handlestringRequired

A recommendation handle from the browser SDK (tys.recommendationHandle()).

productsstring[]Required

Product SKUs / style IDs (what you pass to the element as product).

optionsRequestOptionsOptional

Promise<RecommendationList>: { data: ServerRecommendation[] }, one per product, in your size labels. Sizes only, never measurements.

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.

// handle: from the browser SDK, `await tys.recommendationHandle()`, sent to your server
const { data } = await tys.recommendations.create({
handle,
products: ["SKU-123", "SKU-456"],
});
for (const r of data) {
if (r.status === "ready") console.log(r.product, r.size, r.wearable_sizes);
}

Was this page helpful?