Mercado Livre

How Mercado Livre listings become products and listings, and how they stay up to date.

To bring in the listings a seller already has on Mercado Livre (ML), request an import. After that, marketapi keeps them up to date. This page shows how an ML listing becomes a MarketplaceProduct and a Listing. For the full model, see Connections and listings.

ML has two listing models, and marketapi reads both.

From the listing to marketapi

In marketapiUser Products (UP)Legacy
MarketplaceProductthe family (family_id)the item (item_id)
MarketplaceProductVariantthe UP (user_product_id)the variation (variation_id); an item with none has one
Listinga group of items of the family (no single external ID)the item (item_id)
VariantBindingitem_id + user_product_iditem_id + variation_id

In the UP model, a group holds items of the same family with the same listing type (listing_type_id) and the same catalog_listing: the group is the family plus that key. The group's Listing has no ID of its own on ML, and each line keeps its own item_id in externalId. If the same UP shows up twice in a group, the second item opens another Listing. In the legacy model, 1 item is 1 Listing, and an item with variations becomes a single Listing with one line per variation.

An item that is already linked stays in its Listing. Importing again does not duplicate or regroup needlessly.

When an item changes group

If the seller changes an item's listing type (for example, from Classic to Premium), its line moves to the Listing of the new group. The destination is the Listing that already observes the group; if there is none, one is created (listing.created), with the same sync policy as the Listing the line left. The Listing the line left gets listing.updated, and one left with no lines becomes deleted (listing.status_changed). The line keeps its id, its link and what you set on it.

Import, reconciliation and refresh move the line. A notification does not: it only updates the line where it is, and the full change arrives with the next reconciliation. With inbound (syncPolicy.inbound) off, the move is held: no read writes, and each Listing gets listing.external_changed observed_only.

In each import, reconciliation or refresh, a Listing gets one write and one event (listing.updated imported or listing.external_changed), even if several of its lines changed.

Draft

A draft is a never-read Listing with an externalId you wrote on a line. No read reaches it except the import you request, and it links the draft whole or not at all: every id must belong to an item that a group read of the same import returns and that no already-read Listing holds. Among competing drafts, the oldest wins. A legacy item never links a draft. A linked draft joins the family's MarketplaceProduct (its marketplaceProductId changes, and listing.updated imported announces it) and the old one stays with no offer. From then on the Listing counts as read: refresh returns 202. The variations it adds to the family's product send no marketplace_product.updated.

Title

In the UP model, the title is the family_name. ML rewrites it (case, punctuation) and it does not change after creation. The title marketapi shows in observed is that family_name. For another title, create another item. On a classic item, the title changes before the first sale and locks after it (see publish).

Catalog item

A catalog item (catalog_listing: true) appears as its own Listing, never in the group of the family's regular items. The related items stay in observed.marketplaceData.

Attributes

A listing's attributes arrive in the MarketplaceProduct's observed.content.attributes, in the same typed format as the attributes you write, keyed by the ML attribute id. ML's native list stays in marketplaceData.attributes. A desired.content.attributes equal to the observed one produces no diff and no conflict.

How it stays up to date

PathWhenWhat it does
ML notificationsin secondsUpdate the whole family of the notified item
Missed notificationsevery hourmarketapi fetches from ML what it could not deliver (kept for 2 days)
Full re-readevery 24 hCompares all listings; what disappeared from ML becomes deleted or closed

Notifications only arrive if the ML app has the URL and topics registered. On marketapi's own app this is already done. If you use your own app, follow step 6 of the guide. A topic marketapi does not handle has no effect.

Notifications and the re-read only update listings that already exist in marketapi. To bring in new ones, use import.

To force the re-read, use reconcile listings. To see the mode and the next check, use the sync state: an ML Connection has the listings row in hybrid mode. Stock locations and the fulfillment mapping do not exist on ML yet: inventory.read is not supported and those routes answer 422 (CAPABILITY_UNSUPPORTED).

What disappeared from ML

On the re-read, marketapi asks ML about each listing that was left out of the list. If the item no longer exists, the line becomes deleted. If every line of a Listing disappeared or changed group, the Listing becomes deleted. If the item was only closed, it becomes closed. Refreshing a Listing does the same for it.

Publish on Mercado Livre

Publishing is a Job. Validate first with validate the offer, and publish with publish listing (content and offer) or publish content (content only, on a listing that already exists).

curl -X POST "$BACKEND_URL/v1/listings/<listingId>/validate" \
  -H "Authorization: Bearer mk_your_api_key"

curl -X POST "$BACKEND_URL/v1/listings/<listingId>/publish" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" -d '{ "mode": "auto" }'

The two models

You do not pick the model: marketapi reads the seller at ML once per job. A seller with the user_product_seller tag publishes User Products. The others publish in the legacy model.

User Products (UP)Legacy
Items createdone item per line (variation)a single item, with variations[]
Titlesent as family_name; ML may rewrite it and it shows in observedsent as title
Priceeach line has its ownone for all lines
ContentML repeats the content across the items of the same UPstays on the item

With more than one variation, each line needs a value for every variation axis, and two lines cannot have the same values. Otherwise: variation_axes_incomplete. In UP the rule applies between the lines of the offer, and in legacy between the variations of the item.

Pictures

Pictures go up as bytes, from Assets. No URL goes to ML.

  • Only media with role: image, from ready product_media Assets of the same seller, go up. A confidential Asset never leaves.
  • video and size_chart do not go up: validation warns with media_video_unsupported and size_chart_media_unsupported (warning), and the publication goes on without them.
  • JPG and PNG only, up to 10 MB. WebP is refused (media_format_unsupported) and the API does not convert it: send JPG or PNG. Over the size, media_too_large. ML takes images from 500 to 1920 px; outside that it refuses the upload and the item fails with MarketplaceError: VALIDATION, with no reason.
  • The picture limit is the category's (too_many_pictures). In legacy with variations, it applies per variation (the content pictures plus the variation's). On a simple item and on each UP item, it applies to the total.
  • The API checks every picture before sending the first one: a refusal leaves no picture behind at ML.
  • A sent picture is kept per Connection. On the next publication the same file is not uploaded again; a new file is.

Stock to create an item

Creating an item on ML needs a quantity. If the Variant's inventoryAuthority is disabled (the default) or managed_externally, validation shows quantity_required and publishing refuses before any request (the seller is not even read, and no picture goes up), with no retry. Validation lists one issue per line to create, at the path bindings.<bindingId>; publishing names the lines. With neither a listing type nor a quantity, publishing says listing_type_required first and validation lists both. The rule applies only to creation, and also when a creation is resumed: add the missing data and publish again. Publishing content only checks none of this. To create on ML, keep the Variant's stock in marketapi (inventoryAuthority: marketapi). Republishing an item that already exists is affected by neither this rule nor the listingTypeId one.

Mercado Livre options

Listing type, buying mode, channels, official store and sale terms live in marketplaceOptions.mercadolivre (update options). The namespace is closed: an unknown key returns 400. buyingMode takes buy_it_now, classified and auction; see what the category accepts in requirements. To create an item, listingTypeId is required: without it, validation shows listing_type_required (path marketplaceOptions.mercadolivre.listingTypeId) and publishing refuses before any request, with no retry. An officialStoreId that is not the seller's gives official_store_not_found. The offer's warranty and handlingTime also become sale terms and win over the same term in saleTerms. In the diff, the options are part of the offer group (marketplaceOptions.<key> and marketplaceOptions.saleTerms.<id>), and a term that warranty, handlingTime or purchaseLimit covers is compared through that field only. In a User Products group, each item read carries its own options and offer in observed.lines[].

One offer per group

In UP, ML tells the items of a family apart only by listing type (listingTypeId) and by being a catalog item or not. So a MarketplaceProduct takes one offer per group: two of its Listings with the same listing type would be one to ML, which penalizes a product published twice. Validation reports the case as offer_group_taken, and publishing refuses it before any write, with no retry. The message names the Listing that holds the group: it has an item on ML, or a creation that is open or of unknown outcome. An open creation holds the listing type that was actually sent in it, including one set by a single-use option. With no hint of the type, it holds every group, and publishing another offer is refused until the creation settles. Choose another listingTypeId or use that Listing. An offer that only updates items it already has is not refused, and legacy does not change: there each item is its own offer.

Description

ML accepts plain text only in the description. A line break is a line break, not <br>. With an HTML tag (<p>, </p>, <br/>, <b class="x">), validation flags description_not_plain_text and the publication refuses before any write, with no retry. A lone <, as in "a < b", is not a tag. ML refuses the HTML; it does not strip it. It keeps the text as you send it, with the line breaks and spaces; so an extra space or line break in the description is already a different description and gets published. This also applies to a description inherited from the Product: if you keep the Product description in HTML, override the description on the ML MarketplaceProduct with plain text.

Units

  • priceInCents becomes ML's decimal price (1990 becomes 19.90). In legacy (one item with variations), any offer field that differs between lines (price, warranty, handling time…) gives legacy_offer_per_line: the refusal comes right after the seller read, lists the fields, and nothing is written.
  • The package size (packageDimensionsInMm) goes in centimeters, rounded up. The weight (packageWeightInGrams) goes in grams.
  • Handling time only in days. A warranty in business days does not exist at ML. Both give offer_field_not_supported.

Offer fields ML does not take

quantityTiers, scheduledPrices, audience: business, minPurchaseQuantity and referencePriceInCents do not go to ML through these routes. When filled, validation and publication answer offer_field_not_supported (with the field's path), without calling ML. Nothing is silently dropped.

Updating a published listing

  • Content: publish content makes one PUT per User Product, because ML repeats the rest across the items. The description is per item. A MarketplaceProduct with no item at ML does not publish content alone (content_requires_listing): publish an offer first.
  • Offer: publish listing makes one PUT per item, with only the fields that changed.
  • Stock: the quantity is sent only when the item is created, with the total stock of all the Variant's warehouses (ML has no per-location stock here). Updating an existing item never sends the quantity. So after you change the stock of an ML item, the inventory group of the diff stays pending_publication, with the line path in changedPaths, and ML does not receive the new number. This is a limitation of the Mercado Livre integration (inventory.publish is not supported): sending stock to an existing item is #56.
  • Title of an item that already exists (UP): the title is the family_name and does not change after creation. Changing the MarketplaceProduct title is refused before any write with field_locked_after_creation; the message is The title on record is "X" and carries the stored title. It applies to publishing content, resuming a creation, and creating next to an item that already exists. Way out: send the stored title back, or close the item and create another.
  • How the title is compared: by the exact text, never by word list: one extra space is another title. The reference is, in this order, the title we published; without it, the one the family creation sent; without both, the family_name ML stores. ML rewrites the family_name (case, punctuation), so the reference is what we sent whenever we know it. Creating an item in a family that already exists sends the family_name ML stores, never the local title.
  • Classic item: the title changes before the first sale. After it, a change is refused with field_locked_after_sale; with no change, the title is not resent and the rest of the publication goes on. buyingMode locks with the sale in both models.
  • Price automation: with an automation active at ML, the price belongs to ML and the change is refused with price_automation_active, with no retry.
  • Seller with stock in several ML warehouses (multi-warehouse): multiwarehouse_not_supported, with nothing written.
  • A new line for a variation that already has a User Product at ML: marketplace_product_already_published.

When a publication fails

The job item fails with MarketplaceError: VALIDATION (<reason>), sometimes with our message after it (: <message>). ML's own text never comes with it; its refusal codes are in the item's marketplaceCodes. Fix it and publish again: the new attempt resumes from the step that stopped.

ReasonWhen it comes outWhat to do
media_format_unsupporteda picture is neither JPG nor PNGreplace the picture with a JPG or PNG
media_too_largea picture is over 10 MBsend a smaller picture
too_many_picturesmore pictures than the category takesremove pictures from the media
variation_axes_incompletea variation with no value for an axis, two with the same values, or several variations and no axis (UP and legacy)complete the variation attributes
quantity_requiredcreating an item without stock in marketapi: the Variant is not inventoryAuthority: marketapikeep the Variant's stock in marketapi
listing_type_requiredcreating an item without marketplaceOptions.mercadolivre.listingTypeIdset the listing type in the options
offer_group_takenanother offer of the same MarketplaceProduct already holds the group (listing type) in UPchoose another listingTypeId, or use that Listing
description_not_plain_textthe description has an HTML tagsend plain text, with no tags
legacy_offer_per_lineoffer field that differs between lines in legacygive the lines the same value, or let them inherit
offer_field_not_supportedan offer field ML does not take, or a period it cannot writeremove the field or adjust the period
official_store_not_foundofficialStoreId is not a store of the selleruse a store id of the seller, or remove the option
field_locked_after_saletitle (classic item) or buyingMode changed on an item that already soldgo back to the previous value
field_locked_after_creationMarketplaceProduct title differs from the one ML stored for the item (UP)send the stored title, or close and create another
price_automation_activeML refused the price because of a price automationlet ML manage the price
multiwarehouse_not_supportedseller with stock in several warehousescannot be published through this API
marketplace_product_already_publisheda new line for a variation that already has a User Productdo not add the line through this route
content_requires_listingpublishing only the content of a MarketplaceProduct with no item at MLpublish an offer first
creation_outcome_unknownmarketapi cannot be sure it would not create a second identical listing (see below)import or reconcile

The same reasons show up as issues in validation, in offer issues.

Item steps

The item of a publication job lists each call in steps:

StepWhat it doesexternalRef
picture:<assetId>sends a picturethe picture id at ML
item:<bindingId>creates the item (item:legacy in legacy)the item_id
resume:<bindingId>updates an item an earlier attempt createdthe item_id
description:<bindingId>writes the descriptionthe item_id
update:<bindingId>updates the offer of an item that already existsthe item_id
content:<variationId>updates the content (content:legacy in legacy)the item_id
readbackreads what ML now holds and writes it to observed

In legacy, <bindingId> is legacy. A picture already sent and an item already created are not repeated on the new attempt.

creation_outcome_unknown: a creation with no result seen

If a creation drops on a timeout or a disconnect, ML may have created the item without marketapi seeing the answer. The API never adopts an item it did not create: it searches by the SKU it sent and refuses with creation_outcome_unknown when it finds a live candidate, or when it has no SKU to search by (send the SKU on every variant). It also refuses when an item the Listing already named still sells the same variant, for example because an import brought it into another Listing.

After a creation with no result seen, the new attempt waits a few minutes before searching, because ML's search is slow to show a new item. During that wait the job is delayed and the item stays pending, with no attempt spent and no failure. After the wait, the search decides.

The way out is to bring the item into marketapi: the Connection's import or reconciliation. Then publish again.

Removing a Listing

ML does not offer removal through this API yet (listings.remove is unsupported). So publication=delete answers 422, and the DELETE of a Listing that named a still-live item answers 409 listing_has_live_items, with the ids in details.externalIds. Close the items in the ML panel and repeat (an item the SKU search of an unsettled creation found can also be imported through listing-imports). An item that another Listing of the Connection holds does not count.

Repeated SKU

ML accepts the same seller_sku on two variations of an item, but a MarketplaceProduct does not have two variations with the same SKU. On import, the second variation gets a Variant with no SKU, and the line keeps the ML SKU in externalSku. If moving a line to another family would make the Variant repeat the SKU of a variation at the destination, that family's item fails with CONFLICT (marketplace_product_variant_sku_taken); the other families still apply.

Permissions and limits

  • Reads need the functional permission "Publicação e sincronização: leitura" (listings and sync: read) on the app, and publishing needs "leitura e escrita" (read and write). Without the read scope, the listings.read or listings.import capability is not_granted; without write, listings.publish, listings.validate and media.upload are not_granted. If ML refuses with a 403, the job fails with CAPABILITY_NOT_GRANTED, once, with no retry.
  • Every read to ML goes through the app's quota, including discovery and catalog. Import and re-read respect that quota. When the quota is spent, the job waits for the window and goes on, and does not fail because of it.

Each applied change emits the matching webhook event. See Receiving webhooks.