Size charts and measurements
Explicit units and measurement definitions prevent ambiguous size matching.
Create a chart
curl --fail-with-body -X POST "$METR_API_URL/v1/stores/$STORE_ID/size-charts" \
-H "Authorization: Bearer $METR_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"name": "Linen camp-collar shirt approved chart",
"category": "tops",
"unit": "cm",
"basis": "garment",
"verified": true,
"measurements": [
{
"name": "chest",
"method": "flat_width"
},
{
"name": "shoulders",
"method": "linear"
},
{
"name": "length",
"method": "linear"
}
],
"rows": [
{
"size": "S",
"measurements": {
"chest": {
"min": 50,
"max": 50
},
"shoulders": {
"min": 44,
"max": 44
},
"length": {
"min": 68,
"max": 68
}
}
},
{
"size": "M",
"measurements": {
"chest": {
"min": 52,
"max": 52
},
"shoulders": {
"min": 46,
"max": 46
},
"length": {
"min": 70,
"max": 70
}
}
},
{
"size": "L",
"measurements": {
"chest": {
"min": 54,
"max": 54
},
"shoulders": {
"min": 48,
"max": 48
},
"length": {
"min": 72,
"max": 72
}
}
}
]
}'Measurement rules
| Field | Allowed values / rule |
|---|---|
| unit | cm or in. The engine normalizes both to centimetres. |
| basis | body = body-size range; garment = actual garment dimensions. |
| method | circumference, flat_width or linear, declared per measurement. |
| flat_width | Only garment chest, waist, hips and thigh; doubled to circumference. |
| linear | Shoulders, sleeve, length, rise, inseam and foot length; never doubled. |
| rows | 1–30 unique sizes, ordered smallest to largest by primary measurements. |
| verified | Set true only after the merchant checks the chart. Draft charts cannot generate recommendations. |
| brand, share_as_reference | Optional. A verified chart with share_as_reference=true and a brand name is offered to every store's customers as “which size fits you at <brand>?”. Only the brand, sizes and measurements are shared. |
Every row must contain every declared measurement. min and max form an inclusive range; equal values describe one measurement. Do not send an image or HTML table: normalize the approved values first.
Category and approval
A chart’s category must match the product type. Footwear uses a body foot-length chart; a shoe’s outside dimensions are not a body measurement. Charts missing primary body areas are rejected. The API validates structure and ranges, but merchant verification is still required to establish that the values describe the actual garment.
Updating charts
PUT /v1/stores/{store_id}/size-charts/{chart_id} replaces the input fields and increments revision. Category cannot change. Existing sessions retain their original chart snapshot; new sessions use the new revision. Sizes removed from a chart will no longer be candidates for new sessions.