Do I need to use my own MercadoLibre user to test my application?

While you can use your own MercadoLibre user for testing purposes, we suggest creating a test user with which you will be able to do the same operations and not be charged for the tests made.
Test users cannot buy an item from a non-test user, therefore you should create two test users for buy and selling testing purposes.

• Instructions on how to create a test user are listed here

You can usually differentiate a test user from a non-test one by checking the nickname. Test users’ nickname usually start with a “TT” prefix.

What is OAuth 2.0? How does it work?

OAuth 2.0 is an authentication and authorization protocol, in which the user does not supply his credentials in the system environment, meaning that the user only allows the application to act on its behalf, never sending his credential directly to the application, but instead providing credentials on a trusted site instead. There are two workflows which look like this:

Server-side flow:

image-server-side-flow

Client-side flow:

image-client-side-flow

Both workflows require the creation of an application by the developer in our platform (check this page for more information). The first step is requesting the user to provide information about his credentials. Once it allows your app, you will get an access_token that will allow you to perform actions in MercadoLibre on behalf that user.

Documents:
Authentication and Authorization (Documentation MercadoLibre)

The OAuth 2.0 Authorization Protocol (PDF)

For how long is an access token valid?

Each access_token is valid for until 6 hours (21600 seconds) thats is the sessions life time, therefore if the session was destroyed the token loses its validity, or remains valid until the creation of a new token whichever happens first.

For how long is a refresh token valid?

Refresh tokens do not have a time expiration, but will expire after their first use in exchange for a new access token. Together with the new access token, you will also receive a new refresh token for the next time you need to get an access token. Keep in mind that for your app to receive a refresh token, the scope “offline access” must be checked within you app settings.

How do I recognize categories that allow listings?

When you check a category, you will be able to see the parameter listing_allowed within the settings atributte. If value is true, then listing in that category is allowed, otherwise it is not.

Example:

curl https://api.mercadolibre.com/categories/MLA5529


{
"id": "MLA5529",
"name": "Otras Marcas",
"permalink": null,
"total_items_in_this_category": 1684,
"path_from_root": - [...],
"children_categories": [...],
"attribute_types": "none",
"settings": - {
...
"listing_allowed": true,
...
}
}

How can I check the attributes in a category? How do I know if an attribute is required?

Some categories in MercadoLibre have attributes. To check if a category has attributes, check the attribute_types field.

Example:

curl https://api.mercadolibre.com/categories/MLA109299
{
  "id": "MLA109299",
  "name": "Otras Marcas",
  "permalink": null,
  "total_items_in_this_category": 900,
  "path_from_root": - [...],
  "children_categories": [...],
  "attribute_types": "variations",
  ...
}

If the parameter attribute_types equals “variations” you will find all the attributes in the resource /categories/$CATEGORY_ID/attributes. To check which attributes are mandatory, check the parameter tags and if parameter required exists and its value is true, then its mandatory and you will not be able to list an item in this category until you send this parameter within the body of the item POST.

Example:

curl https://api.mercadolibre.com/categories/MLA109299/attributes
[
  {
    "id": "93000",
    "name": "Talle",
    "type": "size",
    "value_type": "list",
    "tags": - {
      "allow_variations": true,
      "required": true,
    },
    "values": - [
      - {
        "id": "101993",
        "name": "XS",
      },
    ...
    ],
    "attribute_group_id": "DFLT",
    "attribute_group_name": "Otros",
  }
  ...
]

Can I get all categories making just one request?

Check this documentation for further detail about getting a dump of the entire categories tree.

Images sent as “source” in “pictures” attribute are not being uploaded correctly. What’s wrong?

The first step is waiting a few minutes. Our pictures API may take around 5 minutes to get the picture in the url provided, uploading it to our servers and indexed it. If after a while the image has not been uploaded, check if the source of the image can be access by browser (this is the most common error). If you cannot accessed by the browser, please check the url provided. If you can access the image by the browser, then check if the extension of the image is correct (example: the image has a .jpg filename extension, where in reality its format is png or other).

Example for filename extension and file current format check:

$ file image.jpg
image.jpg: PNG image data, 500 x 500, 8-bit/color RGB, non-interlaced

This example shows an image that has a wrong extension (jpg) with a current png file format.

How do I publish a real estate or a vehicle item?

All real estate and vehicle listings have attributes. Learn more about real estate listing at this link.

How many times can I relist an item?

You can only relist an item once. The new relisted item is a totally different item but will inherit the same charateristics as its present item. Only once this new relisted item is closed will you be able to relist the latter, and so on. To check if an item is already relisted, check the resource /items/$ITEM_ID and check the parent_item_id attribute.

Example:

curl https://api.mercadolibre.com/items/MLA123123
{
    "id": "123123",
    "name": "Test item",
    ...
    "status": "closed",
    "sub_status": - [
        "deleted",
    ],
    ...
    "parent_item_id": "MLB321321",
    ...
}

Relisting is only possible up to 60 days after an item is closed. After this period, the sub_status will get an “expired” value.

I receive more than one notification per purchase. Whats happening?

We send notifications on every change done to an order, item, payment or question.
Regarding payments, you will receive two notifications (from different resources). Orders and payments are examples because a change in the payment affects an order as well.

How do I request a payment refund in MercadoPago?

To refund or cancel a payment, you will need to send a request to the Collections resource. Check this page for further information.

Request a payment refund

You may request a payment refund up to 60 days after its approval (operation status: approved).
Payments made by credit card will be refunded to the credit card.
Payments made by offline payment methods will be returned by a deposit in the buyer’s MercadoPago account.

Request – Curl:

curl -X PUT 
-H "Content-Type: application/json" 
'https://api.mercadolibre.com/collections/$PAYMENT_ID?access_token=$ACCESS_TOKEN' 
-d '{"status":"refunded"}'

Response:

Status code: 200 OK

Payments cancellation

You may request payments cancellations for payments that are in one of the following operation status: rejected, pending, in_mediation or in_process.
Payments made by credit card that are cancelled will not change their status.
Payments made by offline payment methods (by deposit and/or electronic transfer) that are canceled will be returned in a deposit, in the buyer’s MercadoPago account.

Request – Curl:

curl -X PUT 
-H "Content-Type: application/json" 
'https://api.mercadolibre.com/collections/$PAYMENT_ID?access_token=$ACCESS_TOKEN' 
-d '{"status":"cancelled"}'

Response:

Status code: 200 OK

How can I list all filters and sort types in a resource?

To see the available filters and sortings in a resource, check the available_filters and available_sorts attributes. This will only work in a GET request.

Example:

curl https://api.mercadolibre.com/sites/MLA/search?category=MLA5529&sort=relevance&price=25.0-95.0
{
  "site_id": "MLB",
  "paging": - {
    "total": 928,
    "offset": 0,
    "limit": 1,
  },
  "results": - [...],
  ...
  "sort": - {...}, // Sorting in use
  "available_sorts": - [ // Sortings available
    - {
      "id": "price_asc",
      "name": "Lower price",
    },
    - {
      "id": "price_desc",
      "name": "Higher price",
    },
  ],
  "filters": - [...], // Filters in use
  "available_filters": - [ // Filters available
    ...
    - {
      "id": "price",
      "name": "Price range",
      "type": "range",
      "values": - [
        - {
          "id": "*-25.0",
          "name": "Up to R$25",
          "results": 270,
        },
        - {
          "id": "25.0-95.0",
          "name": "R$25 to R$95",
          "results": 326,
        },
        - {
          "id": "95.0-*",
          "name": "More than R$95",
          "results": 332,
        },
      ],
    },
    - {
      "id": "accepts_mercadopago",
      "name": "MercadoPago filter",
      "type": "boolean",
      "values": - [
        - {
          "id": "yes",
          "name": "With MercadoPago",
          "results": 922,
        },
      ],
    },
    ...
  ],
}

How can I revoke permission to a user who allowed my application?

To revoke access, you will need make a DELETE request to our Applications resource.

Example:

curl -X DELETE -H "Content-Type: application/json" https://api.mercadolibre.com/users/$USER_ID/applications/6092?access_token=$ACCESS_TOKEN
{
    "user_id": "$USER_ID",
    "app_id": "6092",
    "msg": "Autorización eliminada"
}

Please, rate this article