Crear anuncio en Mercado Livre, con una API

Publica un anuncio y lo devuelve con su id. En el modelo User Products, activo para todos los vendedores, envía family_name y ningún title: Mercado Livre arma el título. La descripción se agrega después con Crear descripción del anuncio.

Identificador
mercado_livre_create_item

La llamada

POST https://connect.reportei.com/api/tools/mercado_livre_create_item/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "family_name": "<family_name>",
    "category_id": "<category_id>",
    "price": 1,
    "currency_id": "<currency_id>",
    "available_quantity": 1,
    "buying_mode": "buy_it_now",
    "listing_type_id": "<listing_type_id>"
  }
}

Tu sistema envía el id de la conexión de tu cliente y los argumentos de la tool. Los headers son los mismos de toda la API de Connect: el token de tu producto y el token de tu cliente.

Parámetros

Las descripciones de los parámetros siguen la documentación oficial de la app, en inglés.

ParámetroTipoObligatorioDescripción
family_namestringSíGeneric name of the product, shared by its variants, for example Apple iPhone 256GB. Up to the max_title_length of the category.
category_idstringSíId of the category, from Search categories.
pricenumberSíPrice in the currency of currency_id.
currency_idstringSíCurrency of the site, BRL in Brazil, as in the currency_id of the listings in List items.
available_quantityintegerSíStock. 0 creates the listing paused, with substatus out_of_stock.
buying_modestringSíbuy_it_now, the only mode available.Valores: buy_it_now
listing_type_idstringSíListing type, for example gold_special (Classic), gold_pro (Premium) or free, as in the listing_type_id of the listings in List items.
conditionstringNoCondition of the product. Mercado Livre is replacing it with the ITEM_CONDITION attribute, which is also the only way to say refurbished.Valores: new, used, not_specified
picturesarrayNoPictures of the product, in order. The max_pictures_per_item of the category sets the limit.
attributesarrayNoTechnical attributes of the product, such as BRAND, MODEL, GTIN or SELLER_SKU. List category attributes says which ones the category requires.
sale_termsarrayNoSale terms, such as the warranty: WARRANTY_TYPE (for example Garantia do vendedor) and WARRANTY_TIME (for example 90 dias). A refurbished item needs them.

Conexiones posibles

Tu cliente conecta su cuenta de Mercado Livre una sola vez, con uno de los modos de abajo. La misma conexión sirve para todas las tools del toolkit.

OAuth con la app de tu producto

Registras la app OAuth de tu producto una sola vez, con POST /api/merchants/credentials/mercado_livre, y tu cliente autoriza la cuenta en una pantalla de consentimiento. Connect renueva el token cuando está por vencer.

La respuesta

Si la llamada tiene éxito, Connect conserva el status y el cuerpo de la respuesta de la app. Los errores HTTP devueltos por la app usan el objeto {error, api_error}; la autenticación o validación pueden fallar antes de la ejecución. El header X-Toolkit-Execution-Id identifica la ejecución registrada, disponible en GET /api/tools/executions/{uuid}.

Lista para agentes de IA

El input de esta tool es un JSON Schema, disponible en GET /api/tools/mercado_livre_create_item. Se convierte en la definición de tool de tu agente sin conversión.

Otras tools de Mercado Livre

Ver las 14 tools

Toolkits de la misma categoría

Ver los 100 toolkits

Mira Connect aplicado a tu producto.

Pruébalo durante 15 días sin tarjeta, o cuéntale tu caso a nuestro equipo.