Skip to content

Replace a product's size map

PUT
/v1/products/{product}/size_map
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.

product
required
string
>= 1 characters <= 120 characters

The product: its TryYourSize ID (UUID) or the brand’s SKU / style ID (external_id). An ID is looked up first.

Media typeapplication/json

Studio size label → the shop’s variant option value (“M” → “Medium”). Must cover every variant to publish.

object
entries
required
Array<object>
object
studio_size
required
string
shop_value
required
string
unmapped_shop_values

Variant size values of the product with no Studio size yet (read only).

Array<string>

Example generated

{
"entries": [
{
"studio_size": "example",
"shop_value": "example"
}
],
"unmapped_shop_values": [
"example"
]
}

OK

Media typeapplication/json

Studio size label → the shop’s variant option value (“M” → “Medium”). Must cover every variant to publish.

object
entries
required
Array<object>
object
studio_size
required
string
shop_value
required
string
unmapped_shop_values

Variant size values of the product with no Studio size yet (read only).

Array<string>

Example generated

{
"entries": [
{
"studio_size": "example",
"shop_value": "example"
}
],
"unmapped_shop_values": [
"example"
]
}

Invalid request

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"
}

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"
}

Not found

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"
}

Values to fix (each issue points at the field, size and POM)

Media typeapplication/json
object
error
required
string
status
required
integer
issues
required
Array<object>
object
severity
required
string
Allowed values: error warning
code
required

E.g. out_of_range, not_graded, missing_pom, composition_total

string
field
required

Category | fit_intent | sizes | poms | grading | import | fabric.

string
size
string
pom
string
params

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
key
additional properties
string
message
required

English text; clients in other languages can word it from code, size, pom and params.

string

Example

{
"issues": [
{
"severity": "error"
}
]
}

Was this page helpful?