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 results for 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.
- site_items[].error: Present when the destination item could not be created. Inspect its status and cause[].code fields.
Interpret creation results by destination
The source of truth for the business result is site_items[]:
- An entry without
site_items[].errorrepresents a site where the item was created successfully. - An entry with
site_items[].errorrepresents a site where the item was not created. - A global
4xxerror withoutsite_items[]occurs before site-level processing and must not be interpreted as a partial result.
Therefore, your integration must evaluate every result by site instead of marking the creation as fully successful solely because it received a 200 response.
Creation scenarios
| Scenario | Outer response | Result in site_items[] |
Expected integrator action |
|---|---|---|---|
| Full success | 200 OK |
All sites are created and none contain error. |
Store the IDs for all sites as a complete creation. |
| Partial success | 200 OK |
Some sites are created and others contain error. |
Keep successful IDs and examine the rejected sites and their causes. |
| Complete functional failure | 200 OK |
No sites are created; all results contain error. |
Treat the operation as failed and examine the causes before deciding how to proceed. |
| Global request error | 4xx without site_items[] |
No site-level processing occurred. | Correct the global request and submit it again. |
These examples show how to interpret destination-level results. Partial creation can also occur for reasons other than size chart resolution.
Partial success response:
{
"item_id": "CBT_ITEM_ID",
"seller_id": 123456789,
"site_id": "CBT",
"site_items": [
{
"item_id": "MLM2290305111",
"seller_id": 987654321,
"site_id": "MLM",
"logistic_type": "remote"
},
{
"site_id": "MLA",
"logistic_type": "remote",
"error": {
"message": "Size chart resolution failed",
"error": "validation_error",
"status": 400,
"cause": [
{
"department": "cbt-global-listing",
"cause_id": 5131,
"type": "error",
"code": "item.size_chart_resolution.unresolved",
"references": [
"item.attributes",
"item.variations.attributes"
],
"message": "Size chart information could not be resolved."
}
]
}
}
]
}
All destinations rejected before persistence (illustrative response):
{
"site_id": "CBT",
"site_items": [
{
"site_id": "MLA",
"logistic_type": "remote",
"error": {
"message": "Size chart does not match listing domain",
"error": "validation_error",
"status": 400,
"cause": [
{
"department": "cbt-global-listing",
"cause_id": 5131,
"type": "error",
"code": "item.size_chart_resolution.domain_chart_mismatch",
"references": [
"item.attributes",
"item.variations.attributes"
],
"message": "The size chart does not belong to the listing domain."
}
]
}
},
{
"site_id": "MLB",
"logistic_type": "remote",
"error": {
"message": "Size chart does not match listing domain",
"error": "validation_error",
"status": 400,
"cause": [
{
"department": "cbt-global-listing",
"cause_id": 5131,
"type": "error",
"code": "item.size_chart_resolution.domain_chart_mismatch",
"references": [
"item.attributes",
"item.variations.attributes"
],
"message": "The size chart does not belong to the listing domain."
}
]
}
}
]
}
Destination error fields (errors by site)
site_items[].error: Present only when the site item could not be created.site_items[].error.error: Error category reported for that site.site_items[].error.status: Status associated with the error for that site.site_items[].error.cause[]: Array containing the detailed causes reported for that site.site_items[].error.cause[].department: Service that reported the cause.site_items[].error.cause[].cause_id: Identifier of the reported cause.site_items[].error.cause[].type: Type of the reported cause.site_items[].error.cause[].code: Machine-readable code used to identify the remediation path.site_items[].error.cause[].references: Request locations associated with the error.site_items[].error.cause[].message: Description of the reported cause.
Operational handling for integrators
After receiving the response, your integration must:
- Evaluate each
site_items[]result by site. - Persist the IDs of sites that were created successfully.
- Identify sites that were not created through
site_items[].errorand its cause code. - Review each rejected site and its reported cause before taking further action.
Before deciding on any retry, retain the IDs of successful destinations and review each rejected result and its cause. Account for destinations already created when deciding how to proceed.
Create item with multiple variations
You can create an item with multiple size variations, each associated with a different row in the size chart. If a variation cannot be resolved for a destination, the entire item is rejected in that destination; other valid destinations can still be created.
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"}
]
}
]
}'
Create a Legacy item without variations
Legacy items without variations[] are also supported. In this case, send the size-chart and size attributes in the item-level attributes[]. The resolver uses those root attributes and resolves one item unit for each requested destination site.
- Include the chart and row that correspond to the item size in the root attributes.
- Include the size attributes required by the selected category and domain.
- Do not send a variation-level size-chart row when the item has no variations.
- Use the domain technical specification to determine the required attributes and accepted values. Do not copy attribute values from another domain.
Proposed request example (not yet verified in a creation test): use chart and size attributes at the item root, with no variations[]. Replace example values with those valid for your seller, chart, and domain.
{
"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_id": "4339173",
"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"
},
{
"id": "COLOR",
"value_name": "Black"
},
{
"id": "SIZE",
"value_name": "5 US-M"
},
{
"id": "SIZE_GRID_ROW_ID",
"value_id": "4339173:1",
"value_name": "4339173:1"
}
],
"available_quantity": 10
}
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. |
In some cases, cause[].type may be "warning". A warning by itself does not mean the destination was rejected; verify whether an item_id was returned.
Size chart resolution errors by destination (Site)
error.status |
error.error |
error.cause.cause_id |
error.cause.code |
error.cause.message |
error.cause.references |
When it happens |
|---|---|---|---|---|---|---|
400 |
validation_error |
5131 |
item.size_chart_resolution.unresolved |
Size chart information could not be resolved. | item.attributes, item.variations.attributes |
The resolver responded, but no consistent row could be selected for this destination, for example because evidence was missing or ambiguous or the chart was not ready for the site. |
400 |
validation_error |
5131 |
item.size_chart_resolution.invalid_input |
Size chart information is invalid. | item.attributes, item.variations.attributes |
The resolver could not construct a valid resolution input from the supplied listing data; this code does not simply mean that size data is missing. |
404 |
not_found |
5131 |
item.size_chart_resolution.chart_not_found |
The referenced size chart could not be found. | item.attributes, item.variations.attributes |
The referenced size chart does not exist or is not available for the seller. |
400 |
validation_error |
5131 |
item.size_chart_resolution.domain_chart_mismatch |
The size chart does not belong to the listing domain. | item.attributes, item.variations.attributes |
The referenced size chart exists but does not match the listing domain. |
408 |
request_timeout |
5014 |
integration.size_chart_resolution.timeout |
Size chart resolution timed out. Please try again later. | [] |
Size chart resolution does not complete within the available time. |
500 |
internal_server_error |
5014 |
integration.size_chart_resolution.unavailable |
Size chart resolution is temporarily unavailable. Please try again later. | [] |
Size chart resolution is temporarily unavailable. |
500 |
internal_server_error |
5014 |
integration.size_chart_resolution.invalid_contract |
Size chart resolution is temporarily unavailable. Please try again later. | [] |
Size chart resolution cannot process the data required for that destination. |
500 |
internal_server_error |
5014 |
listing.size_chart_resolution.invalid_patch |
Size chart resolution is temporarily unavailable. Please try again later. | item.attributes, item.variations.attributes |
The resolved size chart data cannot be safely applied to the listing. |
500 |
internal_server_error |
5289 |
integration.circuit_open.cbt-sizechart-item-enhancer-api |
A required service is temporarily unavailable. Please try again later. | [] |
A required service is temporarily unavailable. |
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