---
title: "Print Label"
method: GET
path: "/v4/shipments/printLabel/rm/{shipmentId}"
tags: ["Shipments"]
---

# Print Label

`GET /v4/shipments/printLabel/rm/{shipmentId}`

Generate and return the label for the Royal Mail shipment. This endpoint is utilised after a Royal Mail shipment has been created and is meant to facilitate the printing of the label required for that shipment. <br /><br />***Note:** This endpoint changes the status of the shipment to label printed. This endpoint should be called at the time of actual printing or label creation, depending on how your business operates. Shipments must be updated to label printed status prior to manifesting.*

## Path parameters

- `shipmentId` string, required

## Query parameters

- `labelFormat` 'PDF' | 'PNG' | 'DATASTREAM' | 'ZPL203DPI' | 'ZPL300DPI' | 'PDF4X3' | 'PNG4X3' — Specifies the format of the shipping label that will be returned in the **createShipment** response. <br />The following are the valid values: <br /><ul><li>**PDF** - returns a Base64-encoded PDF</li><li>**PNG** - returns a Base64-enconded PNG</li><li>**ZPL203DPI** - returns Base 64 encoded text for Zebra printer at 203 DPI</li><li>**ZPL300DPI** - returns Base 64 encoded text for Zebra printer at 300 DPI</li><li>**DATASTREAM** - returns the label elements such as tracking URL, barcode number, 2D barcode image etc. for the label to be created in your own system, rather than returning a label image</li><li>**PDF4X3** - returns a Base64-encoded 4x3 format PDF</li><li>**PNG4X3** - returns a Base64-enconded 4x3 format PNG</li></ul>

## Response `200`

Returns the printed label in the format specified.

- RoyalMailLabelFormatResponseRoyalMailShipmentResponseCarrierSpecificsPrintLabelResponse — Print Label Response
  - `ShipmentId` string, uuid, required — A unique identifier assigned to the shipment by the carrier for which the label is requested. This reaffirms the specific shipment being referenced.
  - `TrackingNumber` string, nullable — A unique number assigned to the shipment that allows both the sender and the receiver to track the shipment's status and location throughout its transit. This number is essential for monitoring the delivery progress.
  - `CarrierTrackingUrl` string, uri, nullable — A URL link provided by the carrier that directs users to a webpage where they can track the shipment in real-time. This link provides detailed status updates and visibility into the shipment's journey.
  - `Label` string, nullable — The generated base64-encoded string of the shipping label in the format requested in the **LabelFormat** field. This label includes essential shipping information, barcodes, and addresses, necessary for the proper handling and delivery of the shipment.
  - `LabelFormat` 'PDF' | 'PNG' | 'DATASTREAM' | 'ZPL203DPI' | 'ZPL300DPI' | 'PDF4X3' | 'PNG4X3', required — Specifies the format in which the generated shipping label was requested, for example, PDF, PNG, ZPL203DPI, ZPL300DPI, DATASTREAM, PDF4X3 and PNG4X3.
  - `CarrierDetails` RoyalMailShipmentResponseCarrierSpecifics — Used to provide the response related to the carrier's processing and tracking of the shipment. This object serves for managing the shipment and generating relevant tracking and label information.
    - `UniqueId` string, required — A unique identifier assigned by Royal Mail to uniquely identify the shipment. This ID is critical for tracking and referencing the shipment within the Royal Mail system.
    - `PartnerDetails` RoyalMailPartnerDetails — Details of the partner label created.
      - `PartnerName` string, nullable — The name of the partner where partners carrier used to deliver the shipment, if applicable.
      - `PartnerCode` string, nullable — The code of the partner carrier used to deliver the shipment is applicable.
      - `PartnerTrackingNumber` string, nullable — The partner carrier tracking number for this package occurrence. <br />Can be used with the partner tracking URL to track the shipment on the partner carrier's website.
      - `PartnerTrackingUrl` string, nullable — The URL of the partner carrier's tracking webpage. <br /> Can be used with the partner tracking number to track the shipment on the partner carrier's website.
    - `DataStreamDetails` RoyalMailDataStreamDetails — Provides all the information required to create a custom label for the shipment. This object is only present if the **DATASTREAM** label format was specified in the request, providing the necessary components to generate the label within your own system.
      - `Primary2DBarcodeImage` string, required — A base64 encoded PNG image of the 2D data matrix barcode associated with the shipment.
      - `Primary2DBarcodeData` string, required — The actual data encoded in the primary 2D barcode, also in base64 encoded format. This data is required to create the 2D data matrix barcode and should be decoded before use.
      - `FormattedUniqueId` string, required — A label associated with the 2D data matrix barcode. It serves as a reference to the unique identifier assigned to the shipment.
      - `GazetteerCodes` RoyalMailGazetteerCodes — Gazetteer Codes
        - `Part1` string, required — Represents the first part of the gazetteer code which is the outward part of the postcode. This code is crucial for routing shipments to a broader geographical region before it it sorted to specific delivery points.
        - `Part2` string, required — Represents the second part of the inward gazetteer code in a post code. It provides additional specificity for the delivery location and is used together with the outward code to pinpoint exact addresses.
        - `Part3` string, nullable — Represents additional components of the inward code to provide further details, enhancing accuracy of shipment delivery.
        - `Part4` string, nullable — Represents additional components of the inward code to provide further details, enhancing accuracy of shipment delivery. <br /> <br />***Note**: Please be advised that either the **Part4** gazetteer code or **SecondaryRoutingCode**, or neither, will be returned in the response.*
      - `SecondaryRoutingCode` string, nullable — Represents the secondary routing code that can be used to refine the addressing of shipments to the correct depot. <br /> <br />***Note**: Please be advised that either the **SecondaryRoutingCode** or the **Part4** gazetteer code, or neither, will be returned in the response.*
      - `Primary1DBarcodeImage` string, nullable — A base64 encoded PNG image of a 1D barcode, provided only if the service requires the barcode to be displayed on the label. This image represents the tracking information in a format that can be scanned.
      - `Primary1DBarcodeData` string, nullable — The data necessary to create the 1D barcode associated with the shipment, provided only if the service requires the barcode to be displayed on the label.
      - `HighVolumeBarcodeImage` string, nullable — A base64 encoded PNG image of the barcode intended for use with high-volume tracking services. This field is populated only when the service (Tracked High Volume) requires having a barcode on the label.
      - `HighVolumeBarcodeData` string, nullable — The data required to create the corresponding barcode for the high-volume service. This field is populated only when the service (Tracked High Volume) requires having a barcode on the label.

## Other responses

- `400` — Invalid request response.
- `401` — Unauthorized
- `403` — Forbidden
- `404` — The shipment was not found.
- `500` — Internal Server Error

---

[API](https://skmtc.dev/intersoftsapient/apis/sapient-core-api.md) · [All operations](https://skmtc.dev/intersoftsapient/apis/sapient-core-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/intersoftsapient/sapient-core-api/revisions/3315ad0b5875/schema)
