Criar anúncio no Mercado Livre, por uma API

Publica um anúncio e o retorna com seu id. No modelo User Products, ativo para todos os vendedores, envie family_name e nenhum title: o Mercado Livre monta o título. A descrição é adicionada depois com Criar descrição do anúncio.

Identificador
mercado_livre_create_item

A chamada

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>"
  }
}

Seu sistema envia o id da conexão do cliente e os argumentos da tool. Os headers são os mesmos de toda a API do Connect: o token do seu produto e o token do cliente.

Parâmetros

As descrições dos parâmetros seguem a documentação oficial do app, em inglês.

ParâmetroTipoObrigatórioDescrição
family_namestringSimGeneric name of the product, shared by its variants, for example Apple iPhone 256GB. Up to the max_title_length of the category.
category_idstringSimId of the category, from Search categories.
pricenumberSimPrice in the currency of currency_id.
currency_idstringSimCurrency of the site, BRL in Brazil, as in the currency_id of the listings in List items.
available_quantityintegerSimStock. 0 creates the listing paused, with substatus out_of_stock.
buying_modestringSimbuy_it_now, the only mode available.Valores: buy_it_now
listing_type_idstringSimListing type, for example gold_special (Classic), gold_pro (Premium) or free, as in the listing_type_id of the listings in List items.
conditionstringNãoCondition 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
picturesarrayNãoPictures of the product, in order. The max_pictures_per_item of the category sets the limit.
attributesarrayNãoTechnical attributes of the product, such as BRAND, MODEL, GTIN or SELLER_SKU. List category attributes says which ones the category requires.
sale_termsarrayNãoSale terms, such as the warranty: WARRANTY_TYPE (for example Garantia do vendedor) and WARRANTY_TIME (for example 90 dias). A refurbished item needs them.

Conexões possíveis

O seu cliente conecta a conta do Mercado Livre uma vez, por um dos modos abaixo. A mesma conexão serve para todas as tools do toolkit.

OAuth com o app do seu produto

Você cadastra o app OAuth do seu produto uma vez, em POST /api/merchants/credentials/mercado_livre, e o cliente autoriza a conta numa tela de consentimento. O Connect renova o token quando ele está para vencer.

A resposta

Em caso de sucesso, o Connect preserva o status e o corpo da resposta do app. Erros HTTP retornados pelo app usam o envelope {error, api_error}; falhas de autenticação ou validação podem ocorrer antes da execução. O header X-Toolkit-Execution-Id identifica a execução registrada, consultável em GET /api/tools/executions/{uuid}.

Pronta para agentes de IA

O input desta tool é um JSON Schema, disponível em GET /api/tools/mercado_livre_create_item. Ele vira a definição de tool do seu agente sem conversão.

Outras tools do Mercado Livre

Ver as 14 tools

Toolkits da mesma categoria

Ver os 100 toolkits

Veja o Connect aplicado ao seu produto.

Teste por 15 dias sem cartão, ou mostre seu cenário ao nosso time.