Replace a product's size map
const url = 'https://api.tryyoursize.com/v1/products/example/size_map';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"entries":[{"studio_size":"example","shop_value":"example"}],"unmapped_shop_values":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.tryyoursize.com/v1/products/example/size_map \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "entries": [ { "studio_size": "example", "shop_value": "example" } ], "unmapped_shop_values": [ "example" ] }'Key scopes: products:write. A secret key (sk_) has every scope; a restricted key (rk_) needs the scopes listed.
Recommendations are returned in your labels through this map (“M” → “Medium”). Publishing needs every shop size mapped.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The product: its TryYourSize ID (UUID) or the brand’s SKU / style ID (external_id). An ID is looked up first.
Request Bodyrequired
Section titled “Request Bodyrequired”Studio size label → the shop’s variant option value (“M” → “Medium”). Must cover every variant to publish.
object
object
Variant size values of the product with no Studio size yet (read only).
Example generated
{ "entries": [ { "studio_size": "example", "shop_value": "example" } ], "unmapped_shop_values": [ "example" ]}Responses
Section titled “Responses”OK
Studio size label → the shop’s variant option value (“M” → “Medium”). Must cover every variant to publish.
object
object
Variant size values of the product with no Studio size yet (read only).
Example generated
{ "entries": [ { "studio_size": "example", "shop_value": "example" } ], "unmapped_shop_values": [ "example" ]}Invalid request
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"}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"}Values to fix (each issue points at the field, size and POM)
object
object
E.g. out_of_range, not_graded, missing_pom, composition_total
Category | fit_intent | sizes | poms | grading | import | fabric.
The values in message, for clients that word the finding in their own language (keys depend on code, e.g. value_mm, min_mm, max_mm, prev_size, fiber, max). Numbers are plain decimals (“.” separator); lengths in mm.
object
English text; clients in other languages can word it from code, size, pom and params.
Example
{ "issues": [ { "severity": "error" } ]}Was this page helpful?
Thank you. We read every answer.