CBT - Invoice
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.
bash1curl -X GET 'https://api.mercadolibre.com/shipments/{shipment_id}/documents/cbt_invoice?last_mile_tn={last_mile_tn}' \\n -H 'Authorization: Bearer {accessToken}'
Response Format
An empty body is expected and the document will be downloaded in PDF format.
Status Codes
Status | HTTP Code | Description |
|---|---|---|
| SUCCESS | 200 | Document will be downloaded. |
| FAILED | 400 | When the download was not successful. It is expected to return "error": "error_get_document" along with the "message" describing the reason for the error. |
| ERROR | 500 | Any server error |
Examples
Request:
bash1curl -X GET 'https://api.mercadolibre.com/shipments/97755738871/documents/cbt_invoice?last_mile_tn=AAA000000000' \\n -H 'Authorization: Bearer xxxxxxxxx'
Response:
Successful (200 OK)
json1{ 2 3}
Failed (Error HTTP 4XX)
json1{ 2 "error": "error_get_document", 3 "message": "Shipment status is 'delivered'", 4 "status": 400 5}
json1{ 2 "error": "shipment_not_found", 3 "message": "Shipment: 3002444733251", 4 "status": 404 5}
Error (Error HTTP 5XX)
json1{ 2 "error": "internal_error", 3 "message": "Internal Server Error", 4 "status": 500 5}
