Pull Notifications

Contents

The carrier should provide an HTTP REST endpoint to retrieve the shipment events as the specification details as follow.

Important:
  • We recommend that the number of shipments consulted be at least 50.
  • For security in pull tracking, OAuth 2.0 will be used.
  • Pull is not performed for containers (HUs) or for LHA integrations.

Inside the request body, a JSON will be sent with the following attributes:

OAuth Request Format

For the authentication mechanism through the generation of a token with OAuth, the following header must be added to the request:

--request  POST 'https://hostname/tracking'
--header 'Authorization: Bearer + TOKEN'
--body 'What is described in each integration is maintained'

Inside the request body, a JSON will be sent with the following attributes:

NameType of dataDescriptionType
idLongUnique identifier of the shipment used by Mercado Libre, required to authorize. This ID will later be used to notify the events that occur in the operational flow of the shipment.Mandatory
tracking_numberStringShipping identifier.Mandatory
[
  {
   "id": long,
   "tracking_number": string
  },
  {
    "id": long,
    "tracking_number": string
  }
]

Response Format

Note:
  • Push and Pull notifications payload must contains the same information.
  • If there are no events for a shipment, or the tracking number not exists on your side, the "events" node will be empty.

Successful

Should be returned when the request was successfully processed.

[
  {
    "id":26379079680,
    "tracking_number":"1234NLUG123",
    "events":[
      {
        "code":"0227",
        "carrier_code":"a31",
        "payload":{
          "date":"2017-05-22T00:00:00-04:00",
          "comment":"Out for delivery",
          "location":{
            "geolocation":{
              "geolocation_type":"ROOFTOP",
              "latitude":-32.96234,
              "longitude":-60.64053
            }
          }
        }
      }
    ]
  }
]

Error response format

NameType of dataDescription
statusIntegerError code. Matches the http status code.
messageStringAny details relevant to the state. Mandatory in case of failure.
errorStringhttp status error message in snake_case.
causeArrayList of errors

Failed (400 FAILED)

Should be returned when the request could not be processed due to an error in the request.

{
  "status":403,
  "message":"User must have a valid scope",
  "error":"invalid_scopes",
  "cause":null
}

Error (500 ERROR)

Should be returned due to any server side error.

{
  "message":"DB is not available",
  "error":"server_error",
  "status":500,
  "cause":[]
}