Documentation Mercado Libre

Check out all the necessary information about APIs Mercado Libre.
circulos azuis em degrade

Documentation

Last update 09/08/2024

Manage Automations

Price automations on MercadoLibre are essential tools for sellers who want to keep their products competitive and maximize their profit margins. These tools allow for dynamic and strategic price adjustments in response to various market variables. Below are the available functionalities for managing automations.

Important:
If a listing undergoes price changes outside of the price automation system, the automation will be immediately deactivated to prevent inconsistencies and outdated prices.

Get Available Rules for an Item

For a specific item, you can retrieve the list of available rules that can be used for price automation by making a GET request to the resource marketplace/items/{itemId}/prices/automate/rules.

Preconditions for Retrieving Available Rules for an Item

  • The query must be made for an existing item.
  • The item must be eligible for automation.

Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/items/{itemId}/prices/automate/rules

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/items/MLM1886904569/prices/automate/rules

Response:

{
    "item_id": "MLM1886904569",
    "rules": [
        {
         "rule_id": "INT_EXT",
         "title": "Price to Win Sales",
         "description": "Your price will be adjusted to the lowest price among similar listings on Mercado Libre."
        }
    ]
}

Response Fields

A GET request to the /marketplace/items/{itemId}/prices/automate/rules resource will provide the following parameters:

  • item_id: The ID of the item.
  • rules: A list of available rules.
    • rule_id: The ID of the rule.
    • title: The title of the rule.
    • description: A description of the rule.

Errors

Status_Code Error Code Error Message Description
403 unauthorized invalid access token When the user in the parameter does not correspond to a site user of the caller.
404 not_found item MLX1234 is not a cbt item When the item being queried is not from CBT.
404 not_found item price suggestion not found, item id: [MLX1234], error: [kvs: key not found] When the CBT item does not have price suggestions.
412 user_not_authorized User is not allowed to automate items When the user is not authorized.
412 item_not_automatable Item with id [MLM123456] has no rules available When there is no available rule to assign.
422 unprocessable_get_strategies Error calling retrieve item strategies service The established strategy cannot be processed.

Assign a new price automation

To assign a new price automation, you need to perform a POST request to the resource marketplace/items/{itemId}/prices/automate.

Preconditions to Assign Automation

  • The rule must be applied to an existing item.
  • The item must have a minimum price.
  • The prices must not be absurd (Maximum and Minimum).

Request:

curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN'
{
    "rule_id": "INT_EXT",
    "min_price": 100000,
    "max_price": 1000000
}
https://api.mercadolibre.com/marketplace/items/$ITEM_ID/prices/automate

Example:

curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN'
{
    "rule_id" : "INT_EXT",
    "min_price": 100000,
    "max_price": 1000000
}
https://api.mercadolibre.com/marketplace/items/MLM1886904569/prices/automate

Response:

{
    "status": "ACTIVE",
    "item_id": "MLM1886904569",
    "item_rule": {
        "business_unit": "3P",
        "rule_id": "INT_EXT",
        "title": "Price to Win Sales",
        "description": "Your price will be adjusted to the lowest price among similar listings on Mercado Libre."
    },
    "min_price": 100000,
    "max_price": 1000000
}

Response Fields

The response from a POST to the resource marketplace/items/{itemId}/prices/automate will provide the following parameters:

  • status: The status of the assigned price automation.
  • item_id: The unique identifier of the item to which the automation has been assigned.
  • item_rule: The specific rule that is applied to the item.
  • business_unit: Business unit.
  • rule_id: The unique identifier of the applied automation rule.
  • title: The title of the automation rule.
  • description: A detailed description of the automation rule.
  • min_price: The minimum allowed price for the item under this automation.
  • max_price:The maximum allowed price for the item under this automation.

Errors

Status_Code Error Code Error Message Description
400 max_price_greater_than_category The maximum price is higher than the category price.
404 item_not_found iitem_not_found When the item being queried is not from CBT.
412 user_not_authorized User is not allowed to automate items When the user is not authorized
412 automation_already_created automation already created The item has already an automation assigned
412 automation_operation_not_allowed Cannot perform [assign automation] for item with id [MLM1886904569]
422 unprocessable_set_rule Error calling rule assignment service

Retrieve Existing Price Automation of a particular item

To obtain the price automation for an item, you need to query the resource /marketplace/items/{itemId}/prices/automate

Preconditions to retrieve an automation

  • The item must exist.
  • The automation must be already assigned.
  • The request must meet the conditions for retrieval.

Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' 
https://api.mercadolibre.com/marketplace/items/{itemId}/prices/automate

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' 
https://api.mercadolibre.com/marketplace/items/MLM1886904569/prices/automate

Response:

{
    "item_id": "MLM1886904569",
    "item_rule": {
        "business_unit": "3P",
        "rule_id": "INT"
    },
    "min_price": 100000,
    "max_price": 1000000,
    "status": "ACTIVE | PAUSED"
    "status_detail": {
        "cause": "ITEM_NO_ACTIVE| PROMO|COMPETITORS",
        "message": "Item paused message"
     }
}

Response Fields

The response from a GET request to the resource /marketplace/items/{itemId}/prices/automate will provide the following parameters:

  • item_id: The unique identifier for the item.
  • item_rule: The specific rule applied to the item for automation.
  • rule_id:The unique identifier for the rule used in the automation.
  • business_unit: Business unit.
  • rule_id: The unique identifier of the applied automation rule.
  • min_price: The minimum allowed price for the item under this automation.
  • max_price:The maximum allowed price for the item under this automation.
  • status: The current status of the automation (e.g., active, inactive).
  • status_detail: Additional details about the status of the automation.

Errors

Status_Code Error Code Error Message Description
400 bad_request Invalid value
404 item_not_found iitem_not_found When the item being queried is not from CBT.
404 automation_not_found Automation not found for item with id MLM1886904569 Automation not found
412 user_not_authorized User is not allowed to automate items When the user is not authorized
412 automation_operation_not_allowed Cannot perform [assign automation] for item with id [MLM1886904569] Automation not allowed
422 unprocessable_set_rule Error calling rule assignment service The established rule cannot be processed

Update Price Automation

To update a price automation rule for an item that is already assigned, you need to perform a PUT request to the resource /marketplace/items/{itemId}/prices/automate.

Preconditions for updating automation:

  • The rule must be applied to an existing item.
  • A minimum price must be specified.
  • Prices must be reasonable (both maximum and minimum).

Request:

curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' 
{
	"rule_id" : "INT_EXT",
	"min_price": 100000,
	"max_price": 1000000
}
https://api.mercadolibre.com/marketplace/items/{itemId}/prices/automate

Example:

curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' 
{
	"rule_id" : "INT_EXT",
	"min_price": 100000,
	"max_price": 1000000
}
https://api.mercadolibre.com/marketplace/items/MLM1886904569/prices/automate

Response:

{
 "item_id": "MLM1886904569",
 "item_rule": {
               "business_unit": "3P",
               "rule_id": "INT_EXT"
             },
 "min_price": 100000,
 "max_price": 1000000,
 "status": "ACTIVE"
}

Response Fields

The response from a PUT request to the resource /pricing-automation/items/{itemId}/automation will include the following parameters:

  • item_id: The unique identifier of the item for which the price automation was updated.
  • item_rule: The specific rule that is applied to the item.
  • business_unit: Business unit.
  • rule_id: The unique identifier of the applied automation rule.
  • title: The title of the automation rule.
  • description: A detailed description of the automation rule.
  • min_price: The minimum allowed price for the item under this automation.
  • max_price:The maximum allowed price for the item under this automation.
  • status:The current status of the price automation update (e.g., success, failure).

Errors

Status_Code Error Code Error Message Description
400 max_price_greater_than_category The maximum price is higher than the category price.
404 item_not_found iitem_not_found When the item being queried is not from CBT.
412 user_not_authorized User is not allowed to automate items When the user is not authorized
412 automation_already_created automation already created The item has already an automation assigned
412 automation_operation_not_allowed Cannot perform [assign automation] for item with id [MLM1886904569]
422 unprocessable_set_rule Error calling rule assignment service

Delete a Price Automation

To delete a price automation rule from an item that is currently assigned, a DELETE request must be made to the resource /marketplace/items/{itemId}/prices/automate

Preconditions for deleting an automation:

  • Existing Item: The automation rule must be applied to an item that exists in the system.
  • Existing Rule: The automation rule you wish to delete must be currently assigned to the item.

Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' 
https://api.mercadolibre.com/marketplace/items/{itemId}/prices/automate

Example:

ccurl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' 
https://api.mercadolibre.com/marketplace/items/MLM12345678/prices/automate

Errors

Status_Code Error Code Error Message Description
404 item_not_found Invalid value When the item being queried is not from CBT.
404 automation_not_found Automation not found for item with id MLM12345678 Automation not found
412 user_not_authorized User is not allowed to automate items When the user is not authorized
412 automation_operation_not_allowed Cannot perform [assign automation] for item with id [MLM1886904569]
422 unprocessable_delete_rule Error calling rule assignment service