Invoice

Contents


How to get my access token?

To generate your access token, follow the steps shown in how to get my access token

Request Format

The request should have the following format:

* The last_mile_tn parameter is optional for other countries but mandatory for Uruguay.

GET https://api.mercadolibre.com/shipments/{shipment_id}/documents/cbt_invoice?last_mile_tn={last_mile_tn} 

--header 'Authorization: Bearer {accessToken}'

Response Format

An empty body is expected and the document will be downloaded in PDF format.

Status Codes

StatusHTTP CodeDescription
SUCCESS200Document will be downloaded.
FAILED400When the download was not successful. It is expected to return "error": "error_get_document" along with the "message" describing the reason for the error.
ERROR500Any server error


Examples

Request:

GET https://api.mercadolibre.com/shipments/97755738871/documents/cbt_invoice?last_mile_tn=AAA000000000 

--header 'Authorization: Bearer xxxxxxxxx'

Response:

Successful (200 OK)

{

}

Failed (Error HTTP 4XX)

{
    "error": "error_get_document",
    "message": "Shipment status is 'delivered'",
    "status": 400 
}
{
    "error": "shipment_not_found",
    "message": "Shipment: 3002444733251",
    "status": 404  
}

Error (Error HTTP 5XX)

{
    "error": "internal_error",
    "message": "Internal Server Error",
    "status": 500  
}