# Generate shipment label This endpoint allows to get shipping labels for a specific package. The label can be returned in different formats (".pdf", ".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** `/shipping/v1/shipments/{id}/packages/{packageId}/label` ## Request parameters ### Header - `X-Content-Type` (string, required) Desired output format for the label. Possible formats are: ".pdf", ".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 This endpoint has no response body. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | bad_request | Invalid data was sent in the request body. Try sending the request again, validating all fields. | | 401 | unauthorized | The value sent as Access Token is incorrect. Please check and try again with the correct value. | | 417 | expectation_failed | Could not meet the expectation specified in the "Expect" header. Validate the information sent and try the request again. | | 500 | internal_server_error | An unexpected error occurred on the server. Try the request again. | ## Request example ### cURL ```bash curl -X GET \ 'https://api.mercadopago.com/shipping/v1/shipments/{id}/packages/{packageId}/label' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' ``` ## Response example ```json [ { "id": 43539204818, "label": "string" } ] ```