Query Carta Porte Information by Inbound Inventory from Mexico
Introduction
The Carta Porte data query API for inbound inventory is designed to provide fiscal data to logistics carriers that are part of the transportation and want to generate the fiscal document for Mexico (cfdi+carta-porte). Given an inventory ID, this API returns the product data for that inventory.
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/inventory/{inventory_id}/carta-porte-details?access_token={access_token}
Parameter | Data Type | Description | Type |
|---|---|---|---|
| inventory_id | String | Inventory ID | Path |
| access_token | String | Access token | Query |
Response
json1{ 2 "category": int, 3 "description": "string", 4 "unit_code": "string", 5 "dangerous_material": "string", 6 "dangerous_material_key": "string", 7 "package_key": "string", 8 "package_description": "string", 9 "dimensions": { 10 "height": float, 11 "width": float, 12 "length": float, 13 "weight": float 14 }, 15 "registration_istmo": "", 16 "origin_pole_location": "", 17 "destination_pole_location": "" 18}
The response is an array by entity/type. If fiscal data for a specific entity cannot be found, the error "Inventory id not found" is returned.
Parameter | Data Type | Description | Type |
|---|---|---|---|
| category | Int | SAT attribute to express the product key for goods or merchandise transported in different transportation media. | Response |
| description | String | Description of the merchandise. | Response |
| unit_code | String | Attribute to specify the standardized unit of measure key applicable to the quantity of goods or merchandise being transported. The unit must correspond to the description of the goods or merchandise recorded. | Response |
| dangerous_material | String | Indicates whether the product is hazardous material. Value "1" for hazardous material and "0" for non-hazardous. | Response |
| dangerous_material_key | String | Hazardous material code. Empty field when not hazardous. | Response |
| package_key | String | Package key. | Response |
| package_description | String | Package description. | Response |
| dimensions | Object | Information about the dimensions of the merchandise. | Response |
| dimensions.height | Float | Height of the merchandise. | Response |
| dimensions.width | Float | Width of the merchandise. | Response |
| dimensions.length | Float | Length of the merchandise. | Response |
| dimensions.weight | Float | Weight in grams of the merchandise. | 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": [""] 6}
404 (NOT_OK)
A 404 error occurs when an incorrect inventory ID is provided.
json1{ 2 "message": "Error when trying to obtain inbound inventory information", 3 "error": "inventory_not_found", 4 "status": 404, 5 "cause": [""] 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 inventory 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 inventory 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": "Error when trying to obtain inbound inventory information"...} | When an incorrect inventory ID is provided. |
| 500 | application/json | {"message": "Error when trying to obtain inbound inventory information"} | When an internal failure occurs in this API. |
