Real Time Tracking - Delivery

Content

Introduction

The following information provides the API details required to get real time tracking information of a shipment being delivered by the carrier. All the web services should be HTTP REST.

Steps to send information

1. Register to Meli

To do api calls against Shipping RTT you will need two identifiers to get access, the first is a Client ID that identified you as a client of Shipping RTT and the second is a ML Token that is you access key. Both of them are required.



2. Sending Locations

To register a location associated to a traceable unit, it is required to send the following information: driver_id, traceable_id and associated locations.

A message with the following structure will be sent:

POST https://api.mercadolibre.com/shipping/rtt/georeceiver/proximity/{provider}/locations?country_id={countryId}

Header

NameType of dataDescription
AuthorizationStringAuthorization token for the request. The header value should be the word Bearer plus the generated token. Eg. Authorization: Bearer token.

Params

NameType of dataType of paramDescriptionType
country_idStringPathID of the country where the device is operational. The Country Id must be taken from this resource.Mandatory
providerStringPathProvider name.Mandatory

The body attributes are explained below:

NameType of dataDescriptionType
post_timestampIntegerUTC time local from the device, at the moment of sending the data, in seconds since epoch (January 1, 1970).Mandatory
locationsArrayArray of locations.Mandatory
locations[i].timestampIntegerUTC time of the moment in which the location data was obtained, in seconds since epoch (January 1, 1970).Mandatory
locations[i].latitudeNumberGPS latitude in degrees.Mandatory
locations[i].longitudeNumberGPS longitude in degrees.Mandatory
locations[i].altitudeNumberGPS altitude (mts above sea level).Optional
locations[i].accuracyNumberEstimated horizontal accuracy of this location, radial, in meters.Optional
locations[i].bearingNumberHorizontal direction of travel of this device, in degrees.Optional
locations[i].bearing_accuracyNumberEstimated bearing accuracy of this location, in degrees.Optional
locations[i].metadataArrayArray of objects “key-value”. Any extra info associated with the location like events. Maximum of 20 items.Optional
locations[i].metadata[i].nameStringKey of metadata defined by the client or by Mercado Envíos.Mandatory
locations[i].metadata[i].valueStringValue for corresponding key defined by the client.Mandatory
deviceNodeData of the driver that carries the traceable.Mandatory
device.external_idStringId of an external entity associated to driver.Mandatory
device.external_typeStringType of an external entity associated to driver. We must create a new type for you.Mandatory
traceablesArrayArray of traceables.Mandatory
traceables[i].idStringTracked traceable_id.Mandatory
traceables[i].typeStringTracked traceable type.Mandatory
{
    "post_timestamp": "integer",
    "locations": [
        {
            "timestamp": "integer",
            "latitude": "number",
            "longitude": "number",
            "altitude": "number",
            "accuracy": "number",
            "bearing": "number",
            "bearing_accuracy": "number",
            "metadata": [
                {
                    "name": "string",
                    "value": "string"
                }
            ],
            "device": {
                "external_id": "string",
                "external_type": "string"
            },
            "traceables": [
                {
                    "id": "string",
                    "type": "string"
                }
            ]
        }
    ]
}

Status Codes

StatusDescriptionAction
202valid requestIt will not retry.
400Data validation failed.Depending on the nature of the error, attempts will be made to correct the data, before re-processing the request. There should be no periodic retry.
403The provider has not permission.It will not retry.
429Too many requestTry again after five minutes.
500Internal Server ErrorIt will retry indefinitely until a satisfactory response is obtained.

Examples

Request

{
    "post_timestamp": 161980863,
    "locations": [
        {
            "timestamp": 161980863,
            "latitude": -34.5743988,
            "longitude": -58.4845495
        }
    ],
    "device": {
        "external_id": "54564asdda",
        "external_type": "DRIVER_ID"
    },
    "traceables": [
        {
            "id": "457543234",
            "type": "shipment"
        }
    ]
}

Response

{
    "status": 202,
    "message": "Accepted"
}