Skip to content

Mercado Libre - Get Shipment

This module allows querying the shipment status, tracking, label, and delivery address of a sale.

This module requires Mercado Libre (OAuth) credentials with the following fields:

FieldDescription
access_tokenValid OAuth access token
FieldTypeRequiredDescription
credentials_idstringYesCredentials ID
shipment_idstringConditionalShipment ID
order_idstringConditionalOrder ID (alternative)
include_trackingbooleanNoInclude tracking history
include_labelbooleanNoInclude label data

Either shipment_id OR order_id is required

StatusDescription
pendingPending
handlingIn preparation
ready_to_shipReady to ship
shippedIn transit
deliveredDelivered
not_deliveredNot delivered
cancelledCancelled
{
"success": true,
"shipment": {...},
"shipment_id": 41234567890,
"status": "shipped",
"substatus": "in_transit",
"tracking_number": "ABC123456789",
"tracking_method": "correo_argentino",
"receiver_address": {
"street_name": "Av. Corrientes",
"street_number": "1234",
"city": "Buenos Aires",
"state": "AR-C",
"zip_code": "1043"
},
"tracking_history": [...],
"message": "Shipment 41234567890 retrieved successfully"
}
{
"credentials_id": "meli_cuenta",
"shipment_id": "41234567890"
}
{
"credentials_id": "meli_cuenta",
"order_id": "2000001234567890"
}
{
"credentials_id": "meli_cuenta",
"shipment_id": "41234567890",
"include_tracking": true
}
{
"credentials_id": "meli_cuenta",
"shipment_id": "41234567890",
"include_label": true
}
{
"credentials_id": "meli_cuenta",
"order_id": "2000001234567890",
"include_tracking": true,
"include_label": true
}
FieldDescription
idShipment ID
statusCurrent status
substatusDetailed sub-status
tracking_numberTracking number
tracking_methodShipping method
date_createdCreation date
receiver_addressDelivery address
sender_addressOrigin address
shipping_optionShipping option
costShipping cost
[Shipment webhook] -> [MeliGetShipment] -> [Update status] -> [Notify customer]
[Paid order] -> [MeliGetShipment label] -> [Generate PDF] -> [Print]
[Schedule every hour] -> [Get shipped shipments] -> [MeliGetShipment tracking] -> [Verify]
// Check delivery status
const envio = ctx.data.shipment;
const estadoFinal = ['delivered', 'not_delivered', 'cancelled'];
ctx.data = {
shipment_id: envio.id,
esta_en_transito: envio.status === 'shipped',
esta_entregado: envio.status === 'delivered',
requiere_accion: envio.status === 'not_delivered',
tracking: envio.tracking_number,
direccion: `${envio.receiver_address.street_name} ${envio.receiver_address.street_number}`,
ciudad: envio.receiver_address.city
};
  • The shipment_id is obtained from the order (order.shipping.id)
  • Tracking history may not be available for all shipments
  • The label is only available for Mercado Envios
  • Statuses vary depending on the shipping type (ME, Flex, Collection)