Documentation Mercado Libre

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

Documentation

Last update 21/12/2022

Product identifiers

Identifiers are codes used to unequivocally locate a product. For example, GTIN is mandatory in the listing for all their variations. Learn more about how to identify the product universal code.

GTIN and identifiers types

GTIN (Global Trade Item Number) is the global trade item number used to unequivocally identify any product or item about which there is a need to both retrieve specific information and put a price to. The GTIN will save all the PIs in this field, concatenating values. This is a standard that includes EAN, UPC, JAN, GTIN14, ISBN, ISBN10 and ISBN13 codes.
Currently, the attribute has the tag new_required and indicates that it is mandatory if the publication has a new condition.


Send product identifier information

You can send this information just like you post attributes, regardless of the category.

Note:
In case the item has variations, you can specify each variation in the product identifier attribute section.

Example of item without variations:

curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' http://api.mercadolibre.com/items
  -d '{
  "title": "Test Item with GTIN code",
  "listing_type_id": "gold_pro",
  "available_quantity": 10,
  "category_id": "CBT11796",
  "buying_mode": "buy_it_now",
  "currency_id": "USD",
  "condition": "new",
  "site_id": "CBT",
  "price": 55.44,
  "accepts_mercadopago": true,
  "warranty": "1 year",
  "sale_terms": [
    {
      "id": "WARRANTY_TIME",
      "value_name": "90 days"
    },
    {
      "id": "WARRANTY_TYPE",
      "value_id": "2230279"
    }
  ],
  "attributes": [
    {
      "id": "PACKAGE_HEIGHT",
      "value_name": "10 cm"
    },
    {
      "id": "FOOTWEAR_TYPE",
      "value_name": "Zapatilla"
    },
    {
      "id": "PACKAGE_WIDTH",
      "value_name": "10 cm"
    },
    {
      "id": "PACKAGE_LENGTH",
      "value_name": "10 cm"
    },
    {
      "id": "PACKAGE_WEIGHT",
      "value_name": "0.7 lb"
    },
    {
      "id": "GTIN",
      "value_name": "7015057271221"
    },
    {
      "id": "BRAND",
      "name": "Brand",
      "value_id": null,
      "value_name": "DOMINIQ",
      "value_struct": null,
      "values": [
        {
          "id": null,
          "name": "DOMINIQ",
          "struct": null,
          "source": 1054850885297509
        }
      ],
      "attribute_group_id": "OTHERS",
      "attribute_group_name": "Otros",
      "source": 1054850885297509
    },
    {
      "id": "ITEM_CONDITION",
      "name": "Item condition",
      "value_id": "2230284",
      "value_name": "New",
      "value_struct": null,
      "values": [
        {
          "id": "2230284",
          "name": "New",
          "struct": null,
          "source": 1054850885297509
        }
      ],
      "attribute_group_id": "OTHERS",
      "attribute_group_name": "Otros",
      "source": 1054850885297509
    },
    {
      "id": "MODEL",
      "name": "Model",
      "value_id": null,
      "value_name": "A-59081-6",
      "value_struct": null,
      "values": [
        {
          "id": null,
          "name": "A-59081-6",
          "struct": null,
          "source": 1054850885297509
        }
      ],
      "attribute_group_id": "OTHERS",
      "attribute_group_name": "Otros",
      "source": 1054850885297509
    }
  ],
  "pictures": [
    {
      "source": "http://www.mercadolibre.com/jm/img?s=STC&v=O&f=proccesing_image_es.jpg"
    }
  ],
  "description": {
    "plain_text": "this is a test item"
  }
}'

Example of item with variations:

curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' http://api.mercadolibre.com/items
  -d '{
    "title": "Test Item with GTIN code and variations",
    "listing_type_id": "gold_pro",
    "available_quantity": 10,
    "category_id": "CBT1645",
    "buying_mode": "buy_it_now",
    "currency_id": "USD",
    "condition": "new",
    "site_id": "CBT",
    "price": 33.55,
    "accepts_mercadopago": true,
    "warranty": "1 year",
    "sale_terms": [
      {
        "id": "WARRANTY_TIME",
        "value_name": "90 days"
      },
      {
        "id": "WARRANTY_TYPE",
        "value_id": "2230279"
      }
    ],
    "attributes": [
      {
        "id": "PACKAGE_HEIGHT",
        "value_name": "100 cm"
      },
      {
        "id": "PACKAGE_WIDTH",
        "value_name": "100 cm"
      },
      {
        "id": "PACKAGE_LENGTH",
        "value_name": "10 cm"
      },
      {
        "id": "PACKAGE_WEIGHT",
        "value_name": "1.7 lb"
      },
      {
        "id": "BRAND",
        "value_id": "18527"
      },
      {
        "id": "MODEL",
        "value_name": "HSD"
      },
      {
        "id": "FAN_TYPE",
        "value_id": "6350778"
      }
    ],
    "variations": [
      {
        "attribute_combinations": [
          {
            "id": "STRUCTURE_COLOR",
            "value_id": "52005"
          }
        ],
        "price": 30.11,
        "available_quantity": 5,
        "attributes": [
          {
            "id": "UPC",
            "value_name": "743562848603"
          },
          {
            "id": "GTIN",
            "value_name": "4006381333931"
          }
        ],
        "picture_ids": [
          "http://image-us.bigbuy.win/upload/image/assistant/TJA01327/TJA01327-2.jpg"
        ]
      },
      {
        "attribute_combinations": [
          {
            "id": "STRUCTURE_COLOR",
            "value_id": "52049"
          }
        ],
        "price": 30.11,
        "available_quantity": 5,
        "attributes": [
          {
            "id": "UPC",
            "value_name": "743562848623"
          },
          {
            "id": "GTIN",
            "value_name": "7015057271221"
          }
        ],
        "picture_ids": [
          "http://image-us.bigbuy.win/upload/image/assistant/TJA01327/TJA01327-2.jpg"
        ]
      }
    ],
    "pictures": [
      {
        "source": "http://www.mercadolibre.com/jm/img?s=STC&v=O&f=proccesing_image_es.jpg"
      }
    ],
    "description": {
      "plain_text": "this is a test item"
    }
  }'

Add information to an existing item

Example of item variation:

Adding the GTIN attribute with the corresponding product code.
No variations

curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/CBT939729408
  -d '{
  "attributes": [
    {
      "id": "GTIN",
      "value_name": "7015057271221"
    }
  ]
}'

With variations

In the same way that any attribute in a variation is added or modified, to add or modify them you must indicate the list of variations that you want to remain in the item (indicating its variation ID), and adding the list of attributes that you want remain in each of the variations.

curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/CBT945341307
  -d '{
  "variations": [
    {
      "id": 61382392580,
      "attributes": [
        {
          "id": "GTIN",
          "value_name": "4006381333931"
        }
      ]
    },
    {
      "id": 61382392584,
      "attributes": [
        {
          "id": "GTIN",
          "value_name": "7015057271221"
        }
      ]
    }
  ]
}'

Remember, if the item have the GTIN attribute to item level, cannot specify again to variant level. In this case, you have to quit to item level and then, specify to variation level.


Query information about product identifiers

To get this information, you should make a GET to the API:
Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$ITEM_ID?include_attributes=all

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/CBT945341307?include_attributes=all

Response:

{
   "id":"CBT945341307",
   "site_id":"CBT",
   "title":"Test Item With Gtin Code And Variations",
   "subtitle":null,
   "seller_id":567809758,
   "category_id":"CBT1645",
   "official_store_id":null,
   "price":30.11,
   "base_price":30.11,
   "original_price":null,
   "currency_id":"USD",
   "initial_quantity":10,
   "available_quantity":2,
   "sold_quantity":0,
   "sale_terms":[
      {
         "id":"WARRANTY_TYPE",
         "name":"Type of warranty",
         "value_id":"2230279",
         "value_name":"Factory warranty",
         "value_struct":null,
         "values":[
            {
               "id":"2230279",
               "name":"Factory warranty",
               "struct":null
            }
         ]
      },
      {
         "id":"WARRANTY_TIME",
         "name":"Warranty time",
         "value_id":null,
         "value_name":"90 days",
         "value_struct":{
            "number":90,
            "unit":"days"
         },
         "values":[
            {
               "id":null,
               "name":"90 days",
               "struct":{
                  "number":90,
                  "unit":"days"
               }
            }
         ]
      }
   ],
   "buying_mode":"buy_it_now",
   "listing_type_id":"gold_pro",
   "start_time":"2020-08-05T16:25:04.000Z",
   "stop_time":"2040-07-31T04:00:00.000Z",
   "condition":"new",
   "permalink":"",
   "thumbnail":"http://cbt-s2-p.mlstatic.com/758781-CBT43037911711_082020-I.jpg",
   "secure_thumbnail":"https://cbt-s2-p.mlstatic.com/758781-CBT43037911711_082020-I.jpg",
   "pictures":[
      {
         "id":"861758-CBT43037911712_082020",
         "url":"http://http2.mlstatic.com/resources/frontend/statics/processing-image/1.0.0/O-ES.jpg",
         "secure_url":"https://http2.mlstatic.com/resources/frontend/statics/processing-image/1.0.0/O-ES.jpg",
         "size":"500x500",
         "max_size":"500x500",
         "quality":""
      },
      {
         "id":"758781-CBT43037911711_082020",
         "url":"http://cbt-s2-p.mlstatic.com/758781-CBT43037911711_082020-O.jpg",
         "secure_url":"https://cbt-s2-p.mlstatic.com/758781-CBT43037911711_082020-O.jpg",
         "size":"490x500",
         "max_size":"1597x1629",
         "quality":""
      }
   ],
   "video_id":null,
   "descriptions":[
      {
         "id":"CBT945341307-2838163975"
      }
   ],
   "accepts_mercadopago":true,
   "non_mercado_pago_payment_methods":[

   ],
   "shipping":{
      "mode":"not_specified",
      "methods":[

      ],
      "tags":[

      ],
      "dimensions":null,
      "local_pick_up":false,
      "free_shipping":false,
      "logistic_type":"not_specified",
      "store_pick_up":false
   },
   "international_delivery_mode":"none",
   "seller_address":{
      "city":{
         "id":"Q04tQkpCZWlqaW5n",
         "name":"Beijing"
      },
      "state":{
         "id":"CN-BJ",
         "name":"Beijing"
      },
      "country":{
         "id":"CN",
         "name":"China"
      },
      "id":1103366569
   },
   "seller_contact":null,
   "location":{

   },
   "coverage_areas":[

   ],
   "attributes":[
      {
         "id":"BRAND",
         "name":"Brand",
         "value_id":"18527",
         "value_name":"Durabrand",
         "value_struct":null,
         "values":[
            {
               "id":"18527",
               "name":"Durabrand",
               "struct":null
            }
         ],
         "attribute_group_id":"OTHERS",
         "attribute_group_name":"Others"
      },
      {
         "id":"FAN_TYPE",
         "name":"Fan type",
         "value_id":"6350778",
         "value_name":"Window fan",
         "value_struct":null,
         "values":[
            {
               "id":"6350778",
               "name":"Window fan",
               "struct":null
            }
         ],
         "attribute_group_id":"OTHERS",
         "attribute_group_name":"Others"
      },
      {
         "id":"MODEL",
         "name":"Model",
         "value_id":null,
         "value_name":"HSD",
         "value_struct":null,
         "values":[
            {
               "id":null,
               "name":"HSD",
               "struct":null
            }
         ],
         "attribute_group_id":"OTHERS",
         "attribute_group_name":"Others"
      },
      {
         "id":"PACKAGE_HEIGHT",
         "name":"Package height",
         "value_id":null,
         "value_name":"100 cm",
         "value_struct":{
            "number":100,
            "unit":"cm"
         },
         "values":[
            {
               "id":null,
               "name":"100 cm",
               "struct":{
                  "number":100,
                  "unit":"cm"
               }
            }
         ],
         "attribute_group_id":"OTHERS",
         "attribute_group_name":"Others"
      },
      {
         "id":"PACKAGE_LENGTH",
         "name":"Package length",
         "value_id":null,
         "value_name":"10 cm",
         "value_struct":{
            "number":10,
            "unit":"cm"
         },
         "values":[
            {
               "id":null,
               "name":"10 cm",
               "struct":{
                  "number":10,
                  "unit":"cm"
               }
            }
         ],
         "attribute_group_id":"OTHERS",
         "attribute_group_name":"Others"
      },
      {
         "id":"PACKAGE_WEIGHT",
         "name":"Package weight",
         "value_id":null,
         "value_name":"1.7 lb",
         "value_struct":{
            "number":1.7,
            "unit":"lb"
         },
         "values":[
            {
               "id":null,
               "name":"1.7 lb",
               "struct":{
                  "number":1.7,
                  "unit":"lb"
               }
            }
         ],
         "attribute_group_id":"OTHERS",
         "attribute_group_name":"Others"
      },
      {
         "id":"PACKAGE_WIDTH",
         "name":"Package width",
         "value_id":null,
         "value_name":"100 cm",
         "value_struct":{
            "number":100,
            "unit":"cm"
         },
         "values":[
            {
               "id":null,
               "name":"100 cm",
               "struct":{
                  "number":100,
                  "unit":"cm"
               }
            }
         ],
         "attribute_group_id":"OTHERS",
         "attribute_group_name":"Others"
      }
   ],
   "warnings":[

   ],
   "listing_source":"",
   "variations":[
      {
         "id":61382392580,
         "price":30.11,
         "attribute_combinations":[
            {
               "id":"STRUCTURE_COLOR",
               "name":"Structure color",
               "value_id":"52005",
               "value_name":"Brown",
               "value_struct":null,
               "values":[
                  {
                     "id":"52005",
                     "name":"Brown",
                     "struct":null
                  }
               ]
            }
         ],
         "available_quantity":1,
         "sold_quantity":0,
         "sale_terms":[

         ],
         "picture_ids":[
            "758781-CBT43037911711_082020"
         ],
         "catalog_product_id":null,
         "attributes":[
            {
               "id":"GTIN",
               "name":"Universal product code",
               "value_id":null,
               "value_name":"4006381333931",
               "value_struct":null,
               "values":[
                  {
                     "id":null,
                     "name":"4006381333931",
                     "struct":null
                  }
               ]
            }
         ]
      },
      {
         "id":61382392584,
         "price":30.11,
         "attribute_combinations":[
            {
               "id":"STRUCTURE_COLOR",
               "name":"Structure color",
               "value_id":"52049",
               "value_name":"Black",
               "value_struct":null,
               "values":[
                  {
                     "id":"52049",
                     "name":"Black",
                     "struct":null
                  }
               ]
            }
         ],
         "available_quantity":1,
         "sold_quantity":0,
         "sale_terms":[

         ],
         "picture_ids":[
            "758781-CBT43037911711_082020"
         ],
         "catalog_product_id":null,
         "attributes":[
            {
               "id":"GTIN",
               "name":"Universal product code",
               "value_id":null,
               "value_name":"7015057271221",
               "value_struct":null,
               "values":[
                  {
                     "id":null,
                     "name":"7015057271221",
                     "struct":null
                  }
               ]
            }
         ]
      }
   ],
   "status":"active",
   "sub_status":[

   ],
   "tags":[
      "immediate_payment"
   ],
   "warranty":"Factory warranty: 90 days",
   "catalog_product_id":null,
   "domain_id":"CBT-FANS",
   "parent_item_id":null,
   "differential_pricing":null,
   "deal_ids":[

   ],
   "automatic_relist":false,
   "date_created":"2020-08-05T16:25:04.000Z",
   "last_updated":"2020-08-05T20:06:17.000Z",
   "health":null,
   "catalog_listing":false
}
Note:
Remember that if you relist an item, the Product Identifier that you sent for the original listing will automatically remain.

Considerations

  • They are not internal SKUs.
  • Now, you should take this into account when loading Product Identifiers. The GTIN will save all the PIs in this field, concatenating values. Just like the ISBN, with the identifiers that it includes.
  • Check if the attribute has the tag new_required and the condition of the item is new, since the attribute is mandatory to publish.
  • The number of characters varies by code type: they can have 8, 10, 12, 13 or 14 characters. You can even rewrite the same code with left zero padding and it will still be valid.
  • GTINs sent are validated and, if not valid, the POST will not be allowed.
  • It is advisable to include the Brand and, at least, one additional identifier. These are the conditions required to participate in third-party product listings, such as Google Shopping.

Message code reference

Error_code Error type Error message Description Possible solution
7710 ERROR Product Identifier [GTIN] has invalid values: [00000000] The Product Identifier inserted isn´t valid. Introduce a valid Product Identifier.
7711 WARNING Product Identifier [GTIN] has invalid format values: [abc12345] The Product Identifier inserted isn´t valid. Introduce a valid Product Identifier.

Resource identifier description

BRAND: Brand.
MPN: Manufacturer Part Number.
GTIN: Global Trade Item Number.

Part Number

The codes used to unequivocally locate an automotive spare part by defining the spare part compatibilities, among others, are referred to as Part Numbers. Based on a specific part number we can learn the car for which it is used.


Next: Variations.