Documentation Mercado Libre
Check out all the necessary information about APIs Mercado Libre.Documentation
Item description
Tips for describing a post
- First load the important data in the data sheet, that is to say all the specifications without forgetting the universal product code.
- Verify that the data that you are going to write in the description are the details that are not in the data sheet.
- Nests the information so that it is well organized. Use uppercase, hyphens, spacing, etc.
- Be brief and read your own description to check its length.
Consult item description
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/items/$ITEM_ID/description?site_id=$SITE_ID&logistic_type=$LOGISTIC_TYPE
Example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/items/CBT123456/description?site_id=MLM&logistic_type=remote
Response:
{
"text": "",
"plain_text": "Esta descripción está en su idioma local",
"translated_plain_text": "This description is in your local language",
"last_updated": "2021-12-10T14:48:05Z",
"date_created": "2021-04-08T16:29:47Z"
}
Response fields text: description text
plain_text: description text in local lenguaje
translated_plain_text: description text translated
last_updated: last description updated
date_created: description created date
Upload item description
Once the global item is created, you can load its description with the following POST. Remember that they must contain plain text and you will not be able to change the fonts, sizes or mark texts in bold. You can only perform line breaks as follows: \n.
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
{
"site_id": "MLM",
"logistic_type": "remote",
"plain_text": "plain text description \n"
}
https://api.mercadolibre.com/marketplace/items/$ITEM_ID/description
When trying to POST with description on a publication that already has it, you will receive a bad request error and you will have to replace an existing description.
Benefits of using plain text
- They will have better results in searches.
- Descriptions can be downloaded 5 times faster.
- They will be properly displayed in all devices (mobile, tablets, computer).
- Besides, you will be able to upload up to 10 item pictures and/or a link with a YouTube video.
Find below an example of the best practice to prepare a description:
Item:“Babolat Pure Control 3 Racket” [su_custom_gallery source="media: 10252" limit="1" link="lightbox" width="870" height="890"]
Replace an existing description
To make modifications to the existing descriptions you will have to carry out the following PUT.
Example:
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" https://api.mercadolibre.com/global/items/CBT1513113226 -d
{
"site_id": "MLM",
"logistic_type": "remote",
"description": {
"plain_text": "Test Description"
}
}
Errors
Listing description
In the event that you POST items by creating a post with a description that contains some unacceptable character, the response will contain more information about the error, such as the position of the wrong character.
Example:
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
{
"site_id": "MLM",
"logistic_type": "remote",
"plain_text":"Texto < br > 😀
"
}
https://api.mercadolibre.com/marketplace/items/$ITEM_ID/description
In the response you can identify that the errors are in position 12:
{
"message":"Validation error",
"error":"validation_error",
"status":400,
"cause":[
{
"department":"items",
"cause_id":398,
"type":"error",
"code":"item.description.type.invalid",
"references":[
"plain_text[12]"
],
"message":"The description must be in plain text"
}
]
}
Modifying an existing description
curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' -H "Content-Type: application/json" -d
{
"site_id": "MLM",
"logistic_type": "remote",
"plain_text":"< br > 😀
"
}
https://api.mercadolibre.com/global/items/$ITEM_ID/description
For the response to return the position of the character that generates error, you must add the parameter api_version=2.
The error will be:
{
"message": "Validation error",
"error": "validation_error",
"status": 400,
"cause": [
{
"department": "items",
"cause_id": 398,
"type": "error",
"code": "item.description.type.invalid",
"references": [
"plain_text[7]"
],
"message": "The description must be in plain text"
}
]
}
In the references node you can get the exact location of the character that generates the error. In this case 7.
Next: Specific Regulations.