Documentation Mercado Libre
Check out all the necessary information about APIs Mercado Libre.
Documentation
Create Item with associate size chart
Associate size chart to an item
To associate a size chart to listings within the required domains, you will have to execute a POST on the items, sending the new attributes of type SIZE_GRID_ID, the size chart which we want to associate the item or variation and SIZE_GRID_ROW_ID with reference to the row in the size chart. The size_grid_id and size_grid_row_id fields are new attributes in the payload at item creation.
- size_grid_id: is the ID of the size chart that was created.
- size_grid_row_id: is the ID of the grid row.
- The user that creates the item must be the same one that created the chart.
- The chart gender must be corresponding to item gender.
- It is not possible to associate a chart without row_id associated.
Required fields
The following fields are required when creating an item with size chart:
- sites_to_sell: Array with site_id and logistic_type
- title: Item title (maximum 60 characters)
- category_id: Category identifier
- price: Item price
- currency_id: Currency code (e.g., USD)
- condition: Item condition (new, used)
- pictures: Array of picture URLs
- sale_terms: Warranty and sale terms
- attributes: Including SIZE_GRID_ID, BRAND, GENDER, MODEL
- PACKAGE_WEIGHT, PACKAGE_LENGTH, PACKAGE_WIDTH, PACKAGE_HEIGHT: Package dimensions
In the creation of the footwear article, the attributes of the size guide number created in the previous steps must be included. It should be inserted in the attribute block, following the example below:
- SIZE_GRID_ID:
- id: the new field "SIZE_GRID_ID".
- value_name: the ID (number) of the guide.
"attributes": [
{
"id": "SIZE_GRID_ID",
"value_name": "664737"
},
We also need to associate the size guide rows with the variations of the article being created. In other words, each variation must be associated with a row from the size table. Therefore, the "SIZE_GRID_ROW_ID" field should be included in the variation attributes:
- SIZE_GRID_ROW_ID:
- id: the new field "SIZE_GRID_ROW_ID".
- value_name: the ID (number) of the guide + ":" + the corresponding row number in the size table. For example apply to footwear:
"attributes": [
{
"id": "SIZE_GRID_ROW_ID",
"value_name": "664737:1"
},
Create item with size chart
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" https://api.mercadolibre.com/global/items -d '{
"sites_to_sell": [
{
"site_id": "MLM",
"logistic_type": "remote"
}
],
"title": "Test Sneaker with Size Chart",
"category_id": "CBT3724",
"price": 25,
"currency_id": "USD",
"condition": "new",
"listing_type_id": "gold_pro",
"pictures": [
{"source": "https://http2.mlstatic.com/D_644516-CBT51699767208_092022-O.jpg"}
],
"sale_terms": [
{
"id": "WARRANTY_TYPE",
"value_id": "6150835",
"value_name": "No warranty"
}
],
"attributes": [
{"id": "SIZE_GRID_ID", "value_name": "4339173"},
{"id": "BRAND", "value_name": "Generic"},
{"id": "GENDER", "value_id": "339666"},
{"id": "MODEL", "value_name": "Generic Model"},
{"id": "PACKAGE_WEIGHT", "value_name": "1 kg"},
{"id": "PACKAGE_LENGTH", "value_name": "30 cm"},
{"id": "PACKAGE_WIDTH", "value_name": "20 cm"},
{"id": "PACKAGE_HEIGHT", "value_name": "15 cm"},
{"id": "ITEM_CONDITION", "value_id": "2230284", "value_name": "New"}
],
"variations": [
{
"attribute_combinations": [
{"id": "COLOR", "value_name": "Black"},
{"id": "SIZE", "value_name": "5 US-M"}
],
"price": 25,
"available_quantity": 10,
"picture_ids": ["https://http2.mlstatic.com/D_644516-CBT51699767208_092022-O.jpg"],
"attributes": [
{"id": "SIZE_GRID_ROW_ID", "value_name": "4339173:1"}
]
}
]
}'
Response: 200 OK
{
"item_id": "CBT3169302956",
"seller_id": 2487485082,
"site_id": "CBT",
"site_items": [
{
"item_id": "MLM2615766915",
"seller_id": 2488208976,
"site_id": "MLM",
"logistic_type": "remote"
}
]
}
Response fields
- item_id: The created CBT item ID.
- seller_id: The seller's ID.
- site_id: The origin site (CBT).
- site_items: Array of items created in destination sites.
- site_items[].item_id: The item ID in the destination site.
- site_items[].seller_id: The seller ID in the destination site.
- site_items[].site_id: The destination site ID (MLM, MLB, MLC, MCO).
- site_items[].logistic_type: The logistic type configured.
Create item with multiple variations
You can create an item with multiple size variations, each associated with a different row in the size chart:
Request:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" https://api.mercadolibre.com/global/items -d '{
"sites_to_sell": [
{
"site_id": "MLM",
"logistic_type": "remote"
}
],
"title": "Test Sneaker Multiple Variations",
"category_id": "CBT3724",
"price": 30,
"currency_id": "USD",
"condition": "new",
"listing_type_id": "gold_pro",
"pictures": [
{"source": "https://http2.mlstatic.com/D_644516-CBT51699767208_092022-O.jpg"},
{"source": "https://http2.mlstatic.com/D_862503-CBT51700450573_092022-O.jpg"}
],
"sale_terms": [
{
"id": "WARRANTY_TYPE",
"value_id": "6150835",
"value_name": "No warranty"
}
],
"attributes": [
{"id": "SIZE_GRID_ID", "value_name": "4326431"},
{"id": "BRAND", "value_name": "Generic"},
{"id": "GENDER", "value_id": "339665"},
{"id": "MODEL", "value_name": "Generic Model"},
{"id": "PACKAGE_WEIGHT", "value_name": "1 kg"},
{"id": "PACKAGE_LENGTH", "value_name": "30 cm"},
{"id": "PACKAGE_WIDTH", "value_name": "20 cm"},
{"id": "PACKAGE_HEIGHT", "value_name": "15 cm"},
{"id": "ITEM_CONDITION", "value_id": "2230284", "value_name": "New"}
],
"variations": [
{
"attribute_combinations": [
{"id": "COLOR", "value_name": "Black"},
{"id": "SIZE", "value_name": "7 US-W"}
],
"price": 30,
"available_quantity": 5,
"picture_ids": ["https://http2.mlstatic.com/D_644516-CBT51699767208_092022-O.jpg"],
"attributes": [
{"id": "SIZE_GRID_ROW_ID", "value_name": "4326431:1"}
]
},
{
"attribute_combinations": [
{"id": "COLOR", "value_name": "Black"},
{"id": "SIZE", "value_name": "8 US-W"}
],
"price": 30,
"available_quantity": 5,
"picture_ids": ["https://http2.mlstatic.com/D_644516-CBT51699767208_092022-O.jpg"],
"attributes": [
{"id": "SIZE_GRID_ROW_ID", "value_name": "4326431:2"}
]
},
{
"attribute_combinations": [
{"id": "COLOR", "value_name": "Blue"},
{"id": "SIZE", "value_name": "9 US-W"}
],
"price": 30,
"available_quantity": 5,
"picture_ids": ["https://http2.mlstatic.com/D_862503-CBT51700450573_092022-O.jpg"],
"attributes": [
{"id": "SIZE_GRID_ROW_ID", "value_name": "4326431:3"}
]
}
]
}'
Verify created item
After creating an item, you can verify it was created correctly with the size chart associated:
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/items/$ITEM_ID
Response: 200 OK or 206 Partial Content
The response will include the SIZE_GRID_ID in the attributes and SIZE_GRID_ROW_ID in each variation's attributes.
Result items with size chart
The publication result in Mercado Libre is that:
Validations
- Title length: The item title must not exceed 60 characters for certain categories.
- Unique variations: Each variation must have a unique combination of attributes. Duplicate variations (same COLOR and SIZE) are not allowed.
Errors
Size Chart Errors
| Status code | Error code | Error message | Description |
|---|---|---|---|
400 |
missing.fashion_grid.grid_id.values |
Size Chart: attribute [SIZE_GRID_ID] is missing | The SIZE_GRID_ID attribute is required but was not provided. |
422 |
size_grid.id.not_found |
Size chart: Size chart not found | The SIZE_GRID_ID provided does not exist or is invalid. |
400 |
invalid.fashion_grid.size.values |
Attribute [SIZE] is not valid | The SIZE value does not exist in the size chart rows. |
Item Validation Errors
| Status code | Error code | Error message | Description |
|---|---|---|---|
400 |
body.required_fields |
The body does not contains the following properties [...] | Required fields are missing. Check the list of required fields above. |
400 |
body.invalid_fields |
Attribute [field] is not valid | A field has an invalid value (e.g., invalid category_id, site_id, or price). |
400 |
item.title.length.invalid |
Category does not support titles greater than 60 characters long | The title exceeds the maximum allowed length of 60 characters. |
400 |
attributes.duplicated |
Variation attribute is duplicated | Two or more variations have the same attribute combination (COLOR + SIZE). |
400 |
picture.id.invalid |
Invalid pictures.id | The picture URL or ID provided is invalid. |
400 |
bad_request |
syntax_error: invalid character looking for beginning of value | The request body contains invalid JSON. |
404 |
not_found |
Item with id {ITEM_ID} not found | The item ID does not exist when trying to GET an item. |
400 |
item_not_modifiable |
Cannot delete listing because one or more site listing related are active | Cannot close an item that has active listings in destination sites. |
Next: Validations