Query CT-e List for Redispatch by Route

Introduction

The CT-e listing API for redispatch allows querying fiscal documents generated by Mercado Livre on behalf of the carrier, associated with a specific route. It uses the GET method, requiring the 'routeID' as a parameter.

Important: OAuth will be used for security.

Request

bash
1GET https://api.mercadolibre.com/MLB/routes/{route_id}/redispatch/fiscal-info?access_token={token}&page={page}&limit={limit}

Request Example

bash
1https://api.mercadolibre.com/MLB/routes/1234567/redispatch/fiscal-info?access_token=123*******************************123&page=1&limit=100

Request Parameters

Name
Data Type
Description
Type
route_idIntRoute ID
access_tokenStringAuthentication token
pageIntThis query is paginated. You must specify the page index to retrieve. When 'page' is not provided, the default value is 1.
limitIntThis query is paginated. You must specify the maximum number of results per page. When 'limit' is not provided, the default value is 100.

Response

The API response includes a list of CT-e documents associated with the specified route. The response is formatted in JSON, containing detailed information about each CT-e.

json
1{ 2 "total_elements": 10, 3 "page": 1, 4 "limit": 10, 5 "type": "CTE", 6 "documents": [ 7 { 8 "entity": "12345678901", 9 "type": "CTE", 10 "format": "xml", 11 "cte_key": "35111222333344445555666677", 12 "href": "https://api.mercadolibre.com/MLB/routes/987654321/shipments/12345678901/cte/35111222333344445555666677?doctype=xml" 13 }, 14 ] 15}

Response Fields

Name
Data Type
Description
Type
total_elementsIntTotal number of available CT-e documents
pageIntCurrent page number in the pagination response
limitIntMaximum number of CT-e documents per page
typeStringDocument type (CTE)
documentsArrayList of CT-e documents with details
entityStringShipment identification
typeStringDocument type (CTE)
formatStringCT-e file format
cte_keyStringCT-e key
hrefStringDownload link for the CT-e document (see Redispatch CT-e Query documentation)
Note: The same Shipment ('entity') may contain more than one CT-e in cases where a complementary CT-e is required.

Status Codes

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

HTTP Code
Content Type
Response Body
Description
200application/xml(example above)Route data returned successfully.
404application/json{ "error": "route_not_found", "status": 404, "message": "Route not found", "cause": [] }When the route is not found.