Route Listing Query for Redispatch CT-e

The route listing API for redispatch CT-e allows you to query the routes generated on behalf of the carrier.

It uses the GET method and returns data for the generated routes.

Importante:

Para segurança será utilizado OAuth

HTTP Request

GET https://api.mercadolibre.com/MLB/routes/redispatch

Example

bash
1curl --request GET \ 2 --url 'https://api.mercadolibre.com/MLB/routes/redispatch?initial_date=2024-01-01&end_date=2024-01-05&step_type=first_mile' \ 3 --header 'Authorization: Bearer SEU_ACCESS_TOKEN' \ 4 --header 'Accept: application/json' \ 5 --header 'Content-Type: application/json'

Parameters

Parameter
Type
Description
initial_dateStringStart date of the query. If not provided, the current date is assumed.
end_dateStringEnd date of the query. If not provided, the current date is assumed. The date range cannot exceed 7 days.
pageIntSpecifies the page index to be queried. If not provided, the value 1 is assumed.
limitIntSpecifies the maximum number of samples per page. If not provided, the value 100 is assumed.
step_typeStringSegment the carrier wants to query. It can be first_mile, middle_mile, or last_mile.

Response

json
1{ 2 "total_elements": 10, 3 "page": 1, 4 "limit": 100, 5 "routes": [ 6 { 7 "id": 123336466, 8 "date": "2024-01-04T00:00:00Z", 9 "total_cte": 25, 10 "status": "GENERATING"|"GENERATED" 11 }, 12 // Other elements... 13 ] 14}

Description

Parameter
Type
Description
total_elementsIntTotal number of CT-e routes found.
pageIntCurrent page number of the request.
limitIntMaximum number of results per page.
routesArrayList of routes.
idIntRoute identifier.
dateStringDate recorded for the route.
total_cteIntNumber of CT-e documents registered for the route.
statusStringDefines if all shipments documents where already generated. If status is GENERATED the MDFe can be generated by the carrier

Status Code

The API uses HTTP status codes to indicate different request states. Below are the most common codes and their descriptions.

HTTP Code
Content Type
Response Body
Description
200application/json(example above)Returns the route data.
400application/jsonjson<br>{<br> "error": "invalid_range_date",<br> "status": 400,<br> "message": "The range must be within 7 days.",<br> "cause": []<br>}<br>Returned when the date range exceeds 7 days.
400application/jsonjson<br>{<br> "error": "invalid_date",<br> "status": 400,<br> "message": "Invalid date",<br> "cause": []<br>}<br>Returned when the date format is invalid or the start date is later than the end date.