Size Guide
Contents
→Get the measurement attributes →Create a Size Guide ↳Possible errors →Modify a Guide →Associate items to a Guide →Query a specific Guide →Query the Guides created by the seller →Query the items associated to a guide →Delete a Guide
Get the measurement attributes
To know the available attributes to create the guide, you should query which ones are available in the country where you wish to publish.
Call:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/measurements?site_id={site_id}
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/measurements?site_id=MLA
Response:
[
{
"id": "BELT_LENGTH",
"name": "Largo del cinturón",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "CHEST_CIRCUMFERENCE",
"name": "Contorno del pecho",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "FOOTWEAR_LENGTH",
"name": "Largo del calzado",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "FOOTWEAR_WIDTH",
"name": "Ancho del calzado",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "HEAD_CIRCUMFERENCE",
"name": "Circunferencia de la cabeza",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "HIP_CIRCUMFERENCE",
"name": "Contorno de la cadera",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "INSEAM_LENGTH",
"name": "Largo de la entrepierna",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "PALM_WIDTH",
"name": "Ancho de la palma",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "SLEEVE_LENGTH",
"name": "Largo de manga",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "TOTAL_LENGTH",
"name": "Largo total",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "WAIST_CIRCUMFERENCE",
"name": "Contorno de la cintura",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
}
]
Create a Size Guide
If you want to create a guide, you should make a PUT to the resource /size_charts sending the following parameters:
- Name: String with the name of the guide
- Sizes: List of measurements that the guide is going to have
- Sizes -> Name: String with the size
- Sizes -> Measurements: Measurements attribute list
- Sizes -> Measurements -> Id: String with the measurement attribute
- Sizes -> Measurements -> Value: String with a value, for example “5”, or a range “5-10”
Example:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts
{
"name" : "test",
"sizes" : [
{
"name": "L",
"measurements" : [
{
"id": "CHEST_CIRCUMFERENCE",
"value" : 25
},
{
"id": "TOTAL_LENGTH",
"value" : 55
}
]
},{
"name": "M",
"measurements" : [
{
"id": "CHEST_CIRCUMFERENCE",
"value" : 25
},
{
"id": "TOTAL_LENGTH",
"value" : 33
}]
}]
}
Response:
status: 201
{
"id": 10,
"name": "test",
"columns": [
{
"id": "CHEST_CIRCUMFERENCE",
"name": "Contorno del pecho",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "TOTAL_LENGTH",
"name": "Largo total”,
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
}
],
"sizes": [
{
"name": "L",
"measurements": [
{
"id": "CHEST_CIRCUMFERENCE",
"value": "25"
},
{
"id": "TOTAL_LENGTH",
"value": "55"
}
]
},
{
"name": "M",
"measurements": [
{
"id": "CHEST_CIRCUMFERENCE",
"value": "25"
},
{
"id": "TOTAL_LENGTH",
"value": "33"
}
]
}
]
}
Possible errors
The user does not belong to the site where he wants to create the guide.
{
"error": "VALIDATION_SITE",
"message": "The feature is not available for the site",
"status": 403
}
The measurement that the user is sending is not the correct one.
{
"error": "MEASUREMENT_NOT_FOUND",
"message": "Measurement CHEST_CIRCUMFERENCE2 not found",
"status": 400
}
The measurement that the user is sending is duplicated.
{
"error": "DUPLICATE_MEASUREMENT_VALIDATION",
"message": "Duplicate measurement attributes",
"status": 400,
"errors": [
{
"code": "DUPLICATE_MEASUREMENT_VALIDATION",
"message": "Duplicate measurement attributes CHEST_CIRCUMFERENCE"
}
]
}
The amount of measurement attributes that the user is sending are not within the maximum and minimum parameters.
{
"error": "MEASUREMENT_NOT_ALLOWED",
"message": "Measurement attributes count not allowed. Max (5) Min (1)",
"status": 400
}
The sizes the user is sending are duplicated.
Response status: 400
Response body:
{
"error": "DUPLICATE_SIZE_VALIDATION",
"message": "Size duplicated",
"status": 400
}
Modify a Guide
To modify a guide you should make a PUT to the resource /size_charts with the ID of the relevant guide. Send all the information, both the one you want to change and the one you want to keep.
Call:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/{size_chart_id}
Example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/123456
{
"name" : "test1",
"sizes" : [{
"name": "L",
"measurements" : [{
"id": "CHEST_CIRCUMFERENCE",
"value" : 25
},
{
"id": "TOTAL_LENGTH",
"value" : 56
}]
},
{
"name": "M",
"measurements" : [{
"id": "CHEST_CIRCUMFERENCE",
"value" : 25
},
{
"id": "TOTAL_LENGTH",
"value" : 33
}]
}]}
Associate items to a Guide
Once the guide is created, it can be associated to any publication belonging to the user that created it. Keep in mind that a same guide can be used by different items.
Call:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/{size_chart_id}/items
Example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/123456/items
{
"items": [
"MLA646854744",
"MLA240984332",
"MLA676711123"
]
}
Query a specific Guide
To find out the information of a specific guide, you must make the following query:
Call:curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/123456
Ejemplo:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/123456
Response:
{
"id": 10,
"name": "test",
"columns": [
{
"id": "CHEST_CIRCUMFERENCE",
"name": "Contorno del pecho",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
},
{
"id": "TOTAL_LENGTH",
"name": "Largo total",
"type": {
"id": "NUMBER_UNIT",
"default_unit": "cm"
}
}
],
"sizes": [
{
"measurements": [
{
"id": "CHEST_CIRCUMFERENCE",
"value": "25"
},
{
"id": "TOTAL_LENGTH",
"value": "55"
}
],
"name": "L"
},
{
"measurements": [
{
"id": "CHEST_CIRCUMFERENCE",
"value": "25"
},
{
"id": "TOTAL_LENGTH",
"value": "33"
}
],
"name": "M"
}]}
Query the Guides created by the seller
To see the information of the registered guides by the seller, you must make the
following query:
Call:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts
Response:
[
{
"id": 10,
"name": "{nombre1}"
},
{
"id": 11,
"name": "{nombre2}"
},
{
"id": 12,
"name": "{nombre3}"
},
{
"id": 13,
"name": "{nombre4}"
},
{
"id": 14,
"name": "{nombre5}"
}
]
Query the items associated to a guide
To see all the items associated to one seller’s guide, you must make the following query:
Call:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/size_chart_id/items
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/123456/items
Response:
{
"items": [
"MLA646854744"
],
"paging": {
"total": 1,
"offset": 0,
"limit": 50
}
}
Delete a Guide
If you want to eliminate a previously created guide, a DELETE must be done with the ID that you wish to eliminate.
Call:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts
Example:
curl -X DELETE -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/size_charts/123456