Listing validator

Since we know sometimes you won’t get your listing done in just one try, we offer you the possibility to check if your listing is exactly the way you want it before publishing. The Items API provides a validation service to check your listing details before publishing. Use it to practice until you get it right!

Contents:

Validation examples

Let’s see an example of how it works. Suppose you send this Json:

Example:

{
"seller_id":,
"id",
"price":"p",
"seller_contact":null,
"pictures": [[1,2,3]] 
}

Make POST to this url:

https://api.mercadolibre.com/items/validate?access_token=$ACCESS_TOKEN

You’ll get an output describing exactly the improvements you need to make on your Json in order to successfully list an item:

{
"message":"body.invalid_field_types",
"error":"[invalid property type: [price] expected Number but was String value: p,
invalid property type: [seller_contact] expected Map but was Null value: null,
invalid property type: [pictures[0]] expected Map but was JSONArray value: [1, 2, 3],
invalid property type: [seller_id] expected Number but was String value: id]",
   "status":400,
   "cause":[

   ]
}

 

Validate your item

 

curl -X POST -H "Content-Type: application/json" -d'{
  "title":"Teacup",
  "category_id":"MLA1902",
  "price":10,
  "currency_id":"ARS",
  "available_quantity":1,
  "buying_mode":"buy_it_now",
  "listing_type_id":"bronze",
  "condition":"new",
  "description": "Item:, Teacup Model: 1. Size: 5cm. Color: White. New in Box",
  "video_id": "YOUTUBE_ID_HERE",
  "pictures":[
    {"source":"http://upload.wikimedia.org/wikipedia/commons/e/e9/Tea_Cup.jpg"}
  ]
}' https://api.mercadolibre.com/items/validate?access_token=$ACCESS_TOKEN

 

Validate an item with variations

 

curl -X POST -H "Content-Type: application/json" -d '{
   "title":"Short",
   "category_id":"MLA126455",
   "price":10,
   "currency_id":"ARS",
   "buying_mode":"buy_it_now",
   "listing_type_id":"bronze",
   "condition":"new",
   "description": "Short with variations", 
   "variations":[
      {
      "attribute_combinations":[
        {
          "id":"93000",
          "value_id":"101993"
        },
        {
          "id":"83000",
          "value_id":"91993"
        }
      ],
      "available_quantity":1,
      "price":10,
      "picture_ids":[
          "http://bttpadel.es/image/cache/data/ARTICULOS/PROVEEDORES/BTTPADEL/BERMUDA%20ROJA-240x240.jpg"
      ]
      },
      {
      "attribute_combinations":[
        {
          "id":"93000",
          "value_id":"101995"
        },
                {
          "id":"83000",
          "value_id":"92013"
        }
      ],
      "available_quantity":1,
      "price":10,
      "picture_ids":[
          "http://www.forumsport.com/img/productos/299x299/381606.jpg"
      ]
      }
   ]
}' https://api.mercadolibre.com/items/validate?access_token=$ACCESS_TOKEN

 

Validate your real estate item

 

curl -X POST -H "Content-Type: application/json" -d' { 
  "site_id": "MLA",
  "title": "Propiedad en Alquiler, Item de Testeo, Por favor, no ofertar",
  "category_id": "MLA52745",
  "price": 5000,
  "currency_id": "ARS",
  "available_quantity": 1,
  "buying_mode": "classified",
  "listing_type_id": "silver",
  "condition": "not_specified",
  "pictures": [
    {
      "source":"http://farm3.staticflickr.com/2417/2176897085_946b7b66b8_b.jpg"
    },
    {
      "source":"http://farm2.staticflickr.com/1056/628680053_3b7c315548_b.jpg"
    }
  ],
  "seller_contact": {
    "contact": "Pepe",
    "other_info": "Additional contact info",
    "area_code": "011",
    "phone": "4444-5555",
    "area_code2": "",
    "phone2": "",
    "email": "contact-email@somedomain.com",
    "webmail": ""
  },
  "location": {
    "address_line": "My property address 1234",
    "zip_code": "1111",
    "neighborhood": {
      "id": "TUxBQlBBUzgyNjBa"
    },
    "latitude": -34.48755,
    "longitude": -58.56987,
  },  
  "attributes": [
    {
      "id": "MLA50547-AMBQTY",
      "value_id": "MLA50547-AMBQTY-1"
    },
    {
      "id": "MLA50547-ANTIG",
      "value_id": "MLA50547-ANTIG-A_ESTRENAR"
    },
    {
      "id": "MLA50547-MTRS",
      "value_name": "500"
    },
    {
      "id": "MLA50547-SUPTOTMX",
      "value_name": "2000"
    },
    {
      "id": "MLA50547-BATHQTY",
      "value_id": "MLA50547-BATHQTY-1"
    },
    {
      "id": "MLA50547-DORMQTYB",
      "value_id": "MLA50547-DORMQTYB-3"
    },
    {
      "id": "MLA50547-EDIFIC",
      "value_id": "MLA50547-EDIFIC-CHALET"
    }
  ],
   "description" : "This is the real estate property description."
}' https://api.mercadolibre.com/items/validate?access_token=$ACCESS_TOKEN

 

Error codes reference

You will receive a “HTTP/1.1 204 No Content” if the JSON is correct to listing or the corresponding error as we saw before in the example.
Note: To see the “HTTP/1.1 204 No Content” using curl you have to add the -i parameter.

Considerations

This validation process is not mandatory, but will most likely come handy when testing your APP. Keep in mind that there is no sandbox nor pre-production environment, so every item listed during your testing phase will be visible for every user that navigates our marketplace. Please check our Testing tutorial to know about particularities and best practices while you’re starting.

Please rate this