Pull Notifications
Contents
The carrier should provide an HTTP REST endpoint to retrieve the shipment events as the specification details as follow.
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:
| Name | Type of data | Description | Type |
|---|---|---|---|
| id | Long | Unique 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_number | String | Shipping identifier. | Mandatory |
[
{
"id": long,
"tracking_number": string
},
{
"id": long,
"tracking_number": string
}
]Response Format
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
| Name | Type of data | Description |
|---|---|---|
| status | Integer | Error code. Matches the http status code. |
| message | String | Any details relevant to the state. Mandatory in case of failure. |
| error | String | http status error message in snake_case. |
| cause | Array | List 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":[]
}