Query Carta Porte Information by Inbound Route from Mexico
Introduction
The Carta Porte information query API by inbound route is designed to provide route and shipment data to logistics carriers that are part of the transportation and want to generate the fiscal document for Mexico (cfdi+carta-porte). Given a route ID, this API returns the corresponding data (list of inbound shipments) for that route.
Important: Make sure you already have a valid application and token, and that you are authorized to use this endpoint. OAuth will be used for security.
Request
bash1GET https://api.mercadolibre.com/inbound/route/{route_id}/carta-porte-details?access_token={access_token}
Parameter | Data Type | Description | Type |
|---|---|---|---|
| route_id | String | Route ID | Path |
| access_token | String | Access token | Query |
How to Get the Route ID from the Logistics Tool?
In the Logistics Monitoring tool, log in with your username and password and search for the ID as shown in the example below. The route ID can also be obtained from the listing screen of the Logistics Monitoring tool, as shown in the example below.
Response
json1{ 2 "id": "route_id", 3 "inbound_shipment": [ 4 { 5 "id": "shipment_id", 6 "url": "/inbound/shipment/{shipment_id}/carta-porte-details" 7 }, 8 ... 9 ], 10 "registration_istmo": "", 11 "origin_pole_location": "", 12 "destination_pole_location": "" 13}
The response is an array by entity/type. If fiscal data for a specific entity cannot be found, the error "Route id not found" is returned, as shown in the array example above.
Parameter | Data Type | Description | Type |
|---|---|---|---|
| id | String | Route ID. | Response |
| inbound_shipment | List | List of shipments. | Response |
| inbound_shipment.id | String | Inbound shipment ID. | Response |
| inbound_shipment.url | String | URL to get shipment details. Access the shipments API for more details on how to make this request. | Response |
| registration_istmo | String | Indicates whether the transfer of goods and/or merchandise takes place within the Tehuantepec Isthmus Welfare Development Zones. Values: Yes or "" (empty string). | Response |
| origin_pole_location | String | Indicates where the transfer of goods and/or merchandise begins within the Tehuantepec Isthmus Welfare Development Zones. Values: (01 to 06). | Response |
| destination_pole_location | String | Indicates the region where the transfer of goods and/or merchandise ends within the Tehuantepec Isthmus Welfare Development Zones. Values: (01 to 06). | Response |
Status Code Examples
If an error occurs, the API will return an HTTP status other than 200 with the error, message, and cause, and the content-type will be application/json.
403 (NOT_OK)
A 403 error occurs due to lack of access to this API.
json1{ 2 "message": "Access revoked, consult staff to check your permissions", 3 "error": "unexpected_error", 4 "status": 403, 5 "cause": ["error_getroute"] 6}
404 (NOT_OK)
A 404 error occurs when an incorrect route ID is provided.
json1{ 2 "message": "An error occurred while trying to get inbound route details. Route not found", 3 "error": "route_not_found", 4 "status": 404, 5 "cause": ["error_getroute"] 6}
500 (INTERNAL_ERROR)
A 500 error occurs when an internal failure happens in this API.
json1{ 2 "message": "Error when trying to obtain inbound route information", 3 "error": "internal_server_error", 4 "status": 500, 5 "cause": ["INTERNAL_ERROR"] 6}
HTTP Code | Content Type | Response Body | Description |
|---|---|---|---|
| 200 | application/json | JSON (example above) | When route data is retrieved successfully. |
| 403 | application/json | {"message": "Access revoked, consult staff to check your permissions"} | When access to this API is missing. |
| 404 | application/json | {"message": "An error occurred while trying to get inbound route details. Route not found"...} | When an incorrect route ID is provided. |
| 500 | application/json | {"message": "Error when trying to obtain inbound route information"} | When an internal failure occurs in this API. |
