← Back to EcomCentral
MERCADO LIBRE REST API

Mercado Libre Setup Guide

Connect your Mercado Libre seller account to EcomCentral using OAuth 2.0 Bearer token authentication.

About Mercado Libre

Mercado Libre (MELI) is Latin America's largest e-commerce marketplace, operating in 18 countries including Argentina, Brazil, Mexico, Colombia, Chile, and Peru. This integration targets the standard Marketplace API using OAuth 2.0 Bearer tokens, giving EcomCentral access to orders, items, stock management, and shipment tracking for ME1 (self-managed) logistics.

ℹ️ EcomCentral connects to https://api.mercadolibre.com and authenticates every request with Authorization: Bearer {access_token}. Access tokens expire — implement the refresh token flow before deploying to production.

Prerequisites

How to Get Credentials

  1. Create an application at the Mercado Libre Developers portal. After creation you will receive an App ID (client_id) and a Secret (client_secret).
  2. Run the OAuth 2.0 authorization flow. Redirect your user to https://auth.mercadolibre.com/authorization?response_type=code&client_id={APP_ID}&redirect_uri={REDIRECT_URI}. Exchange the returned code for an access_token and refresh_token via POST https://api.mercadolibre.com/oauth/token.
  3. Retrieve your seller ID by calling GET https://api.mercadolibre.com/users/me with the Bearer token. The response contains id — that is your numeric seller_id.
  4. In EcomCentral, add a new Mercado Libre connection and enter the access_token and seller_id, then click ⚡ Test.
⚠️ Access tokens expire (typically after 6 hours). For production use, store the refresh_token and implement the refresh flow (POST /oauth/token with grant_type=refresh_token) to obtain a new access token automatically before expiry.

Credentials Reference

KeyRequiredDescriptionExample
access_token Required OAuth 2.0 Bearer token obtained via the authorization code flow. Expires — refresh regularly. APP_USR-12345…
seller_id Required Numeric MELI user / seller ID. Retrieved from GET /users/meid field. 123456789
✅ Alternative key names accepted: token for the access token; sellerId (camelCase) for the seller ID.

API Endpoints Used

OperationMethodEndpoint
Test connection / get seller infoGET/users/me
List ordersGET/orders/search?seller={id}&sort=date_desc&offset=N&limit=N
Order detailGET/orders/{id}
List item IDsGET/users/{id}/items/search?offset=N&limit=N
Item detailGET/items/{id}
Update stockPUT/items/{id} with { "available_quantity": N }
Add shipment trackingPOST/shipments/{shipment_id}/tracking with { "tracking_number":"…", "carrier":"…", "tracking_url":"…" }
ℹ️ There is no bulk item-detail endpoint. EcomCentral fetches item IDs via /users/{id}/items/search and hydrates each item individually with /items/{id}. This is the standard pattern documented by MELI for seller catalog access.

Order Statuses

MELI order statuses are lowercase English strings. EcomCentral colour-codes them as follows:

StatusBadge colourMeaning
paid Green Payment confirmed; ready to fulfil
shipped / delivered / closed Green Order is shipped, delivered, or fully completed
payment_required Blue Awaiting buyer payment
payment_in_process Blue Payment is being processed
confirmed / in_process Blue Order confirmed or being processed
mediation Amber Dispute or mediation open
cancelled Red Order was cancelled
invalid / chargedback / refunded Red Order is invalid or a chargeback / refund has been raised

Shipment Tracking

MELI has two shipping modes and only one accepts seller-supplied tracking numbers:

Shipping modeTrackingNotes
ME1 / Mercado Envíos Flex (self-managed) ✅ Seller-supplied Use POST /shipments/{id}/tracking with tracking_number, carrier, and optionally tracking_url.
ME2 / Standard Mercado Envíos (MELI-managed) ❌ Automatic MELI handles the entire logistics chain. Seller-supplied tracking is rejected with a 400 error.
⚠️ If you receive a tracking API error, check the shipment's logistics mode. Only self-managed (ME1) shipments accept seller-supplied tracking numbers. Standard Mercado Envíos orders are tracked automatically by MELI.

Supported Features

FeatureSupportedNotes
View orders (paginated)Order ID, date, status, total + currency. Sorted most-recent-first.
View order detailBuyer nickname, status, payment type, shipment ID, line items with SKU and unit price. Buyer address requires a separate /shipments/{id} call (not performed automatically).
Add tracking numberME1 (own-logistics) shipments only. EcomCentral resolves the shipment ID from the order automatically.
View products (paginated)Item ID, seller SKU (seller_custom_field), title, price, available quantity. Hydrated individually via /items/{id}.
View product detailFull item with condition, listing type, thumbnail, permalink, and up to 6 attributes.
Update stock quantityBy MELI item ID (e.g. MLA1234567) via PUT /items/{id}. Uses item ID, not seller SKU.
Test connectionCalls GET /users/me — confirms the token is valid and returns seller nickname, site, and country.

Troubleshooting

401 Unauthorized

The access token has expired or is invalid. MELI tokens typically expire after 6 hours. Refresh the token using POST /oauth/token with grant_type=refresh_token and your stored refresh_token, then update the connection in EcomCentral with the new access_token.

403 Forbidden

The application is missing a required OAuth scope. Review the scopes granted during authorization at the Mercado Libre Developers portal and ensure the following are included: read, write, offline_access.

400 "item_not_found"

The requested item ID does not exist or does not belong to this seller account. Verify the item ID format (e.g. MLA1234567) and that it is active in the seller's catalog.

Shipment tracking error (400)

Attempting to set tracking on a standard Mercado Envíos (ME2) shipment returns a 400 error. Only ME1 / Mercado Envíos Flex (own-logistics) shipments accept seller-supplied tracking numbers. Check the order's shipment mode in the MELI seller portal before submitting tracking.

🔧 Quick sanity check — call curl -H "Authorization: Bearer {token}" https://api.mercadolibre.com/users/me in a terminal. A 200 response with your seller data confirms the token and credentials are correct. A 401 means the token is expired or invalid.