Mercado Libre - Send Message
Description
Section titled “Description”This module allows sending post-sale messages to buyers, whether to follow up on an order, respond to inquiries, or provide additional information.
Configuration
Section titled “Configuration”Credentials
Section titled “Credentials”This module requires Mercado Libre (OAuth) credentials with the following fields:
| Field | Description |
|---|---|
access_token | OAuth access token with write permissions |
Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
credentials_id | string | Yes | Credentials ID |
pack_id | string | Conditional | Pack/cart ID |
order_id | string | Conditional | Order ID (alternative) |
text | string | Yes | Message text |
attachments | array | No | Attachment file URLs |
Either
pack_idORorder_idis required
Output
Section titled “Output”{ "success": true, "message_sent": { "id": "msg_123456789", "text": "Hola! Tu pedido ya fue despachado...", "date_created": "2024-01-15T10:35:00.000-03:00", "status": "sent" }, "message_id": "msg_123456789", "pack_id": "2000001234567890", "message": "Message sent successfully"}Usage Example
Section titled “Usage Example”Follow-up message
Section titled “Follow-up message”{ "credentials_id": "meli_cuenta", "order_id": "2000001234567890", "text": "Hola! Tu pedido ya fue despachado. El numero de seguimiento es ABC123. Gracias por tu compra!"}Message to pack/cart
Section titled “Message to pack/cart”{ "credentials_id": "meli_cuenta", "pack_id": "2000001234567890", "text": "Buenos dias! Queremos confirmar que recibiste el pedido en buenas condiciones. Todo OK?"}Delivery information message
Section titled “Delivery information message”{ "credentials_id": "meli_cuenta", "order_id": "2000001234567890", "text": "Tu pedido esta en camino y llegara manana entre las 9:00 y 18:00. El repartidor te llamara antes de llegar."}Request rating
Section titled “Request rating”{ "credentials_id": "meli_cuenta", "order_id": "2000001234567890", "text": "Esperamos que disfrutes tu compra! Si todo llego bien, te agradeceriamos una calificacion positiva. Gracias!"}Apology message
Section titled “Apology message”{ "credentials_id": "meli_cuenta", "order_id": "2000001234567890", "text": "Lamentamos la demora en la entrega. Estamos haciendo seguimiento con el correo. Te mantendremos informado."}Example Workflows
Section titled “Example Workflows”Automatic shipment notification
Section titled “Automatic shipment notification”[Shipment dispatched] -> [Get tracking] -> [MeliSendMessage] -> [Log]Post-delivery follow-up
Section titled “Post-delivery follow-up”[Shipment delivered] -> [Wait 2 days] -> [MeliSendMessage request review]Inquiry response
Section titled “Inquiry response”[Message received] -> [AI generate response] -> [MeliSendMessage]Issue alert
Section titled “Issue alert”[Detect issue] -> [MeliSendMessage apology] -> [Notify team]Usage with ExecuteScript
Section titled “Usage with ExecuteScript”// Generate personalized follow-up messageconst orden = ctx.data.order;const envio = ctx.data.shipment;
let mensaje = `Hola ${orden.buyer.first_name || ''}! `;
switch (envio.status) { case 'ready_to_ship': mensaje += 'Tu pedido esta listo y sera despachado hoy. '; break; case 'shipped': mensaje += `Tu pedido ya esta en camino. `; if (envio.tracking_number) { mensaje += `Numero de seguimiento: ${envio.tracking_number}. `; } break; case 'delivered': mensaje += 'Tu pedido fue entregado! Esperamos que lo disfrutes. '; mensaje += 'Si todo llego bien, te agradeceriamos una calificacion positiva. '; break;}
mensaje += 'Gracias por tu compra!';
ctx.data = { order_id: orden.id, text: mensaje};// Automatic response to common inquiryconst mensajeRecibido = ctx.data.message;const texto = mensajeRecibido.text.toLowerCase();
let respuesta = '';
if (texto.includes('cuando llega') || texto.includes('demora')) { respuesta = 'El envio esta en camino y llegara en los proximos 2-3 dias habiles. Podes seguirlo desde "Mis compras". Saludos!';} else if (texto.includes('devolucion') || texto.includes('cambio')) { respuesta = 'Para devoluciones o cambios, inicia el reclamo desde "Mis compras" en MercadoLibre. Responderemos a la brevedad. Saludos!';} else if (texto.includes('factura')) { respuesta = 'La factura se envia por email dentro de las 24hs posteriores a la compra. Revisa tu casilla de spam. Saludos!';} else { respuesta = 'Gracias por tu mensaje. Te responderemos a la brevedad. Saludos!';}
ctx.data = { pack_id: mensajeRecibido.pack_id, text: respuesta};Best Practices
Section titled “Best Practices”- Respond quickly (less than 24 hours)
- Be clear and concise
- Include useful information (tracking, dates)
- Maintain a professional and friendly tone
- Personalize with buyer’s name
- Include external contact information
- Mention other platforms
- Send mass/spam messages
- Use aggressive language
- Ignore inquiries or claims
Common Errors
Section titled “Common Errors”| Error | Cause | Solution |
|---|---|---|
| ”Order not found” | Incorrect order | Verify order_id |
| ”Pack not found” | Incorrect pack | Verify pack_id |
| ”Empty message” | Empty text | Include message text |
| ”Forbidden content” | Forbidden content | Remove contact information |
| ”Message limit exceeded” | Too many messages | Wait before sending more |
API Used
Section titled “API Used”- API: Mercado Libre Messaging API
- Endpoint:
POST /messages/packs/{pack_id}/sellers/{user_id} - Documentation: https://developers.mercadolibre.com/
- Messages are recorded in the order history
- Sent messages cannot be edited or deleted
- Response time affects customer service metrics
- Including external contact information may result in penalties
- Messages are visible to Mercado Libre in case of mediation
Related Nodes
Section titled “Related Nodes”- MeliGetMessages - Get conversation messages
- MeliGetOrders - Get orders to send messages
- MeliGetShipment - Get shipment information to include in the message