---
title: "generateShipLabels"
method: PUT
path: "/externalFulfillment/2024-09-11/shipments/{shipmentId}/shipLabels"
tags: ["External Fulfillment Shipping v2024-09-11"]
---

# generateShipLabels

`PUT /externalFulfillment/2024-09-11/shipments/{shipmentId}/shipLabels`

## Request

- Base URL: `https://sellingpartnerapi-na.amazon.com`
- URL: `https://sellingpartnerapi-na.amazon.com/externalFulfillment/2024-09-11/shipments/{shipmentId}/shipLabels`
- Auth: none declared

Generate and retrieve all shipping labels for one or more packages in the shipment you specify.

## Path parameters

- `shipmentId` string, required

## Query parameters

- `shippingOptionId` string
- `operation` 'GENERATE' | 'REGENERATE', required

## Request body

- ShipLabelsInput: Tracking details for multiple packages.
  - `packageIds` string[], required: The subset of package IDs used to generate a label.
  - `courierSupportedAttributes` CourierSupportedAttributes: The tracking details of the package if it is shipped by a third party courier. This attribute should only be provided when the value of `shipBy` is `THIRD_PARTY_CARRIER`.
    - `carrierName` string, required: The name of the courier service used to ship the package
    - `trackingId` string, required: The tracking number of the package.

## Response `200`

Success.

- ShipLabelsResponse: The response to the `generateShipLabels` operation.
  - `packageShipLabelList` PackageShipLabel[], required: A list of label documents for each package specified in the request. In case of partial failures when generating labels, the `isErrored` and `errorDetails` attributes detail the cause of failure.
    - `packageId` string: The package ID of the package.
    - `shipLabelMetadata` ShipLabelMetadata: Metadata for a ship label document.
      - `shippingOptionId` string: The selected slot for the ship label.
      - `carrierName` string, required: The name of the carrier.
      - `trackingId` string, required: The tracking number of the package.
      - `pickupWindow` TimeWindow: Specific time interval defining the start and end times.
        - `startTime` HourMinute: The time when the business opens or closes.
          - `hour` integer: The hour when the business opens or closes, in 24-hour format (0-23).
          - `minute` integer: The minute when the business opens or closes.
        - `endTime` HourMinute: The time when the business opens or closes.
          - `hour` integer: The hour when the business opens or closes, in 24-hour format (0-23).
          - `minute` integer: The minute when the business opens or closes.
      - `timeSlot` TimeWindow: Specific time interval defining the start and end times.
        - `startTime` HourMinute: The time when the business opens or closes.
          - `hour` integer: The hour when the business opens or closes, in 24-hour format (0-23).
          - `minute` integer: The minute when the business opens or closes.
        - `endTime` HourMinute: The time when the business opens or closes.
          - `hour` integer: The hour when the business opens or closes, in 24-hour format (0-23).
          - `minute` integer: The minute when the business opens or closes.
      - `handoverLocation` HandoverLocation: The drop-off location details for package handover.
        - `address` Address: Address of the party.
          - `name` string, required: The name of the person, business or institution at that address.
          - `addressLine1` string, required: First line of the address.
          - `addressLine2` string: Additional street address information, if required.
          - `addressLine3` string: Additional street address information, if required.
          - `city` string: The city where the person, business or institution is located.
          - `county` string: The county where person, business or institution is located.
          - `district` string: The district where person, business or institution is located.
          - `stateOrRegion` string: The state or region where person, business or institution is located.
          - `postalCode` string: The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation.
          - `countryCode` string, required: The two digit country code in ISO 3166-1 alpha-2 format.
          - `phone` string: The phone number of the person, business or institution located at that address.
        - `distance` Distance: A distance measurement.
          - `value` string, required: A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\d*))(\.\d+)?([eE][+-]?\d+)?$`.
          - `distanceUnit` 'MI' | 'KM', required: The unit of measurement of the distance.
        - `mapUrl` string: URL to the map that shows the drop-off location.
    - `fileData` DocumentV2: An [S3-Presigned URL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html) you can use to retrieve file contents.
      - `url` string, required: A presigned URL to fetch the ship label file using an HTTP GET request. To determine file type, use the `contentType` header of the file response. The file retrieved will be in one of the following supported formats: - **ZPL**: `x.application/zpl` - **PDF**: `application/pdf` - **PNG**: `image/png` - **Plain Text**: `text/plain`
    - `status` 'SUCCESS' | 'FAILURE': The outcome of the operation.
    - `errorDetails` Error: Error response returned when the request is unsuccessful.
      - `code` string, required: An error code that identifies the type of error that occurred.
      - `message` string, required: A message that describes the error condition.
      - `details` string: Additional details that can help the caller understand or fix the issue.

## Other responses

- `400`: Request has missing or invalid parameters and cannot be parsed.
- `403`: Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.
- `404`: The resource specified does not exist.
- `409`: The resource specified conflicts with the current state
- `413`: The request size exceeded the maximum accepted size.
- `415`: The request payload is in an unsupported format.
- `422`: Unprocessable Entity. Unable to process the contained instructions
- `429`: The frequency of requests was greater than allowed.
- `500`: An unexpected condition occurred that prevented the server from fulfilling the request.
- `503`: Temporary overloading or maintenance of the server.

---

[API](https://skmtc.dev/aws-samples/apis/a-content-management-v2020-11-01.md) - [All operations](https://skmtc.dev/aws-samples/apis/a-content-management-v2020-11-01/llms.txt) - [OpenAPI document](https://skmtc.dev/aws-samples/apis/a-content-management-v2020-11-01/revisions/815a5b6dbaa6?raw)
