Generate shipment label

This endpoint allows to get shipping labels for a specific package. The label can be returned in different formats (".pdf", ".zpl", ".zip" or ".json") based on the "X-Content-Type" header, and will contain all necessary information for shipping including barcodes, addresses, and tracking numbers. In case of success, the request will return a response with status 200.

GET

https://api.mercadopago.com/shipping/v1/shipments/{id}/packages/{packageId}/label
Request parameters
Header
Authorization
string

REQUIRED

Access Token obtained through the developer panel. Must be sent in all requests.
X-Content-Type
string

REQUIRED

Desired output format for the label. Possible formats are: ".pdf", ".zpl", ".zip" or ".json".
Path
id
string

REQUIRED

Shipment identifier, which can be obtained by consulting the shipment information or through the Webhook notification.
packageId
string

REQUIRED

Package identifier, which can be obtained by consulting the shipment information or through the Webhook notification.
Response parameters
id
integer
Shipment identifier.
label
string
Label information in the requested format.
Errors

400Bad request. The parameters sent are not valid.

bad_request

Invalid data was sent in the request body. Try sending the request again, validating all fields.

401Unauthorized. Invalid or missing credentials.

unauthorized

The value sent as Access Token is incorrect. Please check and try again with the correct value.

417Expectation failed.

expectation_failed

Could not meet the expectation specified in the "Expect" header. Validate the information sent and try the request again.

500Internal server error.

internal_server_error

An unexpected error occurred on the server. Try the request again.

Request
curl -X GET \
    'https://api.mercadopago.com/shipping/v1/shipments/{id}/packages/{packageId}/label'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer APP_USR-4*********994754-12*********c73b4e1ac*********cef36b27c*********840' \
       -H 'X-Content-Type: pdf' \
    
Response
[
  {
    "id": 43539204818
  }
]