Documentación Mercado Libre
Descubre toda la información que debes conocer sobre las APIs de Mercado Libre.Documentación
Manage questions & answers
Search questions
There are a few ways to search questions.
Questions received by a seller
Request:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?seller_id=$SELLER_ID
Example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?seller_id=523130418
Response:
{
"total": 80,
"limit": 1,
"questions": [
{
"id": 6789511129,
"seller_id": 523130418,
"text": "Ask from buyer",
"text_translated": "Pregunta desde el comprador",
"status": "ANSWERED",
"item_id": "CBT910505150",
"marketplace_item_id": "MLM755638064",
"date_created": "2020-02-05T22:13:53.000-04:00",
"hold": false,
"deleted_from_listing": false,
"answer": {
"text": "Respuesta a question 6462231012",
"text_translated": "answer to question 6462231012",
"status": "ACTIVE",
"date_created": "2020-02-05T22:27:23.052-04:00"
},
"from": {
"id": 441782523
},
"site_id": "MLM"
}
],
"filters": {
"limit": 1,
"offset": 0,
"is_admin": "false",
"sorts": [],
"caller": 523130418,
"seller": 523130418
},
"available_filters": [
{
"id": "item",
"name": "Item",
"type": "text"
},
{
"id": "from",
"name": "From user id",
"type": "number"
},
{
"id": "totalDivisions",
"name": "total divisions",
"type": "number"
},
{
"id": "division",
"name": "Division",
"type": "number"
},
{
"id": "status",
"name": "Status",
"type": "text",
"values": [
"ANSWERED",
"BANNED",
"CLOSED_UNANSWERED",
"DELETED",
"DISABLED",
"UNANSWERED",
"UNDER_REVIEW"
]
}
],
"available_sorts": [
"item_id",
"from_id",
"date_created",
"seller_id"
]
}
The available filters are:
- totalDivisions
- division
- status
- from
- item
Order results
To order the results you can add the following query params:
sort_fields: allows sorting the search results by one or some specific fields.
Accepts the item_id, seller_id, from_id and date_created fields separated by comma.
Example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?seller_id=$SELLER_ID&sort_fields=$ITEM_ID,$DATA_CREATED
sort_types: allows you to determinate if the sort_fields fields in the order will be ASC (ascending) or DESC (descending).
Example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?seller_id=$SELLER_ID&sort_fields=item_id,date_created&sort_types=ASC
Questions received on an item
Request:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?item=$ITEM_ID
Example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?item=CBT910505150
Response:
{
"total": 80,
"limit": 1,
"questions": [
{
"id": 6789511129,
"seller_id": 523130418,
"text": "Ask from buyer",
"text_translated": "Pregunta desde el comprador",
"status": "ANSWERED",
"item_id": "CBT910505150",
"marketplace_item_id": "MLM755638064",
"date_created": "2020-02-05T22:13:53.000-04:00",
"hold": false,
"deleted_from_listing": false,
"answer": {
"text": "Respuesta a question 6462231012",
"text_translated": "answer to question 6462231012",
"status": "ACTIVE",
"date_created": "2020-02-05T22:27:23.052-04:00"
},
"from": {
"id": 441782523
},
"site_id": "MLM"
}
],
"filters": {
"limit": 1,
"offset": 0,
"is_admin": "false",
"sorts": [],
"caller": 523130418,
"seller": 523130418
},
"available_filters": [
{
"id": "item",
"name": "Item",
"type": "text"
},
{
"id": "from",
"name": "From user id",
"type": "number"
},
{
"id": "totalDivisions",
"name": "total divisions",
"type": "number"
},
{
"id": "division",
"name": "Division",
"type": "number"
},
{
"id": "status",
"name": "Status",
"type": "text",
"values": [
"ANSWERED",
"BANNED",
"CLOSED_UNANSWERED",
"DELETED",
"DISABLED",
"UNANSWERED",
"UNDER_REVIEW"
]
}
],
"available_sorts": [
"item_id",
"from_id",
"date_created",
"seller_id"
]
}
Questions made by a user on an item
Request:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?item=$ITEM_ID&from=$CUST_ID
Example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?item=CBT910505150&from=466076859
Response:
{
"total": 3,
"limit": 1,
"questions": [
{
"id": 6802857141,
"seller_id": 523130418,
"text": "Test Message to Reply",
"text_translated": "Mensaje de Prueba para responder",
"status": "ANSWERED",
"item_id": "CBT910505150",
"marketplace_item_id": "MLM755638064",
"date_created": "2020-02-13T10:40:14.000-04:00",
"hold": false,
"deleted_from_listing": false,
"answer": {
"text": "It is a new test message",
"text_translated": "Es un nuevo mensaje de prueba",
"status": "ACTIVE",
"date_created": "2020-02-13T10:40:58.589-04:00"
},
"from": {
"id": 441782523
},
"site_id": "MLM"
}
],
"filters": {
"limit": 1,
"offset": 0,
"is_admin": "false",
"sorts": [],
"caller": 466076859,
"seller": 0
},
"available_filters": [
{
"id": "seller",
"name": "Seller id",
"type": "number"
},
{
"id": "item",
"name": "Item",
"type": "text"
},
{
"id": "from",
"name": "From user id",
"type": "number"
},
{
"id": "totalDivisions",
"name": "total divisions",
"type": "number"
},
{
"id": "division",
"name": "Division",
"type": "number"
},
{
"id": "status",
"name": "Status",
"type": "text",
"values": [
"ANSWERED",
"BANNED",
"CLOSED_UNANSWERED",
"DELETED",
"DISABLED",
"UNANSWERED",
"UNDER_REVIEW"
]
}
],
"available_sorts": [
"item_id",
"from_id",
"date_created",
"seller_id"
]
}
Questions by ID
Request:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/$QUESTION_ID
Example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/6891108811
Response:
{
"id": 6891108811,
"seller_id": 523130418,
"text": "Test Question 2",
"text_translated": "Pregunta de prueba 2",
"status": "ANSWERED",
"item_id": "CBT911087484",
"marketplace_item_id": "MLM763996017",
"date_created": "2020-03-17T22:33:32.000-04:00",
"hold": false,
"deleted_from_listing": false,
"answer": {
"text": "answer from seller 5",
"text_translated": "respuesta del vendedor 5",
"status": "ACTIVE",
"date_created": "2020-03-18T17:42:36.138-04:00"
},
"from": {
"id": 441782523
},
"site_id": "MLM"
}
Attributes description
seller_id: Product seller's ID
id: Question ID
text: Question text
status: Question status
Possibles values:
- unanswered:The question has not been answered yet
- answered:The question was not answered
- closed_unanswered:The product is closed and the question has never been answered
- under_review:Both product and question are under review
item_id: ID of the question-related product
date_created: Question creation date
answer: Seller's answer
text: Answer text
status: Answer status
Possible values:
- active: The answer is available
- disabled: The answer was disabled.
- date_created: Answer creation date.
Great! Now you know the aspects to take into account in terms of questions. Have a look at the available actions based on question search.
Allowed methods
Method | Description |
---|---|
GET /marketplace/questions/:id | Returns a question with that id. |
POST /marketplace/answers/ | POST an answer to a given question. |
DELETE /questions/:id | Deletes a question. |
As you can see, you can search questions by item, by seller, by the user who made them and filter them by status or period.
Answer questions
When you have a large amount of items listed on Mercado Libre you’re probably gonna receive lots of questions so we recommend you develop a way to answer those questions in a semi-automatic way, where answers are suggested to operators basing on frequent keywords. To do so, you need to know how to answer a question by API. This is gonna be easy. First, let’s check all the questions you got on your item. Just make a question search by item like in the example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/search?item_id=$ITEM_ID
You’ll see questions have a status, so you’ll probably gonna have to keep those under “unanswered” status. Now let’s answer a single question:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X POST -H "Content-Type: application/json" -d '{
"question_id": 3957150025,
"text":"Test answer...",
"text_translated": "Translated answer..."
}' https://api.mercadolibre.com/marketplace/answers
Response:
{
"id": 6894368802,
"seller_id": 523130418,
"text": "Hello, I like the product, do home deliveries?",
"status": "ANSWERED",
"item_id": "CBT911112427",
"date_created": "2020-03-20T09:15:01.000-04:00",
"hold": false,
"deleted_from_listing": false,
"answer": {
"text": "This is the answer from the seller",
"status": "ACTIVE",
"date_created": "2020-11-24T15:27:07.321-04:00",
"text_translated": "Esta es la respuesta del vendedor"
}
}
Get questions detail
Request:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/$QUESTION_ID
Example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X GET https://api.mercadolibre.com/marketplace/questions/3957150025
Response:
{
"id": 6891108811,
"seller_id": 523130418,
"text": "Test Question 2",
"text_translated": "Pregunta de prueba 2",
"status": "ANSWERED",
"item_id": "CBT911087484",
"marketplace_item_id": "MLM763996017",
"date_created": "2020-03-17T22:33:32.000-04:00",
"hold": false,
"deleted_from_listing": false,
"answer": {
"text": "answer from seller 5",
"text_translated": "respuesta del vendedor 5",
"status": "ACTIVE",
"date_created": "2020-03-18T17:42:36.138-04:00"
},
"from": {
"id": 441782523
},
"site_id": "MLM"
}
When working with questions is very useful to listen to Notifications since it enables you to have a real-time feed of events that occur regarding to them.
Delete questions
If you have the need to delete a question an user made on your item just use the DELETE method with the question ID and the seller’s access token.
Request:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X DELETE http://api.mercadolibre.com/marketplace/questions/$QUESTION_ID
Example:
curl -H 'Authorization: Bearer $ACCESS_TOKEN' -X DELETE http://api.mercadolibre.com/marketplace/questions/6988272427
Response:
[
"Question deleted."
]
How does your application know about any news on a question?
A question on an item is an event that occurs on Global Selling side, so you'll need to subscribe to our questions feed to be aware in real time when that event occurs. First of all, we have to configure our application to be capable of getting notifications. This can be done by subscribing your application to questions notifications. Go to our Application Manager and edit your application Notifications Settings. For more information about creating and configuring a new app, please check this guide. You must choose a Callback URL: configure the public URL of your domain where you want to receive all the notifications from MercadoLibre. E.g.: "https://backend.soleorigami.com/notification". Also you need to specify which “topic” you will list, in this case you must select questions. This configuration allows you to interact with MercadoLibre notifications. All the events regarding new questions will be notified to your callback URL.
Receiving a notification
Mercado Libre will send you notifications through a POST message with information inside items body. The most important attribute in the message is the user_id which is related to the notification and second one is the resource. The resource is the element that has been updated or it has been created.
{
"user_id": 1234,
"resource": "/marketplace/questions/139876",
"topic": "marketplace_questions",
"received": "2011-10-19T16:38:34.425Z",
"sent" : "2011-10-19T16:40:34.425Z",
}
After receiving the notification you must send an acknowledgment (ACK 200) to MercadoLibre in order to stop receiving the notification. Check our Notifications documentation to know further.
Error codes reference
Error | Description | Possible solution |
---|---|---|
invalid_question: The question is invalid. | Can not answer question. | The parameter question_id must be a integer number. (To search your question call the resource /marketplace/questions/search). |
invalid_post_body: Invalid JSON. Valid attributes are: {0}. | Invalid parameters. | Expected parameters are question_id and text. |
Next: Manage sales.