v1

latestOpenAPI 3.0.12026-07-242073551.1 MB
Shipments

Print Label

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.

get/v4/shipments/printLabel/rm/{shipmentId}

Path parameters

shipmentIdstring required

A unique identifier (shipmentId) or tracking number returned in the Create shipment response. This ID is used to reference and track specific shipments within the system.

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>

Specifies the format of the shipping label that will be returned in the createShipment response. <br /> <br />The following are the accepted values: <br /> <br />PDF - returns a Base64-encoded PDF <br />PNG - returns a Base64-enconded PNG <br />ZPL203DPI - returns Base 64 encoded text for Zebra printer at 203 DPI <br />ZPL300DPI - returns Base 64 encoded text for Zebra printer at 300 DPI <br />DATASTREAM - returns essential label elements in a structured format, including the tracking URL, barcode number, and 2D barcode image. Instead of providing a pre-printed label image This format allows you to create and customise shipment labels within your own systems. <br />PDF4X3 - returns a Base64-encoded 4x3 format PDF <br />PNG4X3 - returns a Base64-enconded 4x3 format PNG <br /> <br />Note: By default, this field is set to PDF.

Response

Returns the printed label in the format specified.

ShipmentIdstring 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.

TrackingNumberstring 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.

CarrierTrackingUrlstring 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.

Labelstring 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.

Example response

{
  "ShipmentId": "c4e60776-288f-464e-b35b-ff0f3252c0f0",
  "TrackingNumber": "TT12384739GB",
  "CarrierTrackingUrl": "http://shipmentcarrier.com/tracking/DF12384739GB",
  "Label": "iVBORw0KGgoAAAANSUhEUgAA ... A4QAAAXcCAYAAAB6Q0CbAAAAAXNSR0IArs4",
  "CarrierDetails": {
    "UniqueId": "3A01234561234568AE7C7",
    "PartnerDetails": {
      "PartnerName": "FedEx",
      "PartnerCode": "FEDEX",
      "PartnerTrackingNumber": "794953535000",
      "PartnerTrackingUrl": "https://www.fedex.com/en-gb/tracking.html"
    },
    "DataStreamDetails": {
      "Primary2DBarcodeImage": "iVBORw0KGgoAAAANSUhE ...…GgAAABoAQMAAAAn0ifiAAAA",
      "Primary2DBarcodeData": "iVBORw0KGgoAAAANSUhE ...…GgAAABoAQMAAAAn0ifiAAAA",
      "FormattedUniqueId": "3A-070 338 6001-000 0B2 000",
      "GazetteerCodes": {
        "Part1": "L55",
        "Part2": "G43",
        "Part3": "AAA",
        "Part4": "000"
      },
      "SecondaryRoutingCode": "NORW",
      "Primary1DBarcodeImage": "iVBORw0KGgoAAAANSUhE ...…GgAAABoAQMAAAAn0ifiAAAA",
      "Primary1DBarcodeData": "HF123456783GB",
      "HighVolumeBarcodeImage": "iVBORw0KGgoAAAANSUhE ...…GgAAABoAQMAAAAn0ifiAAAA",
      "HighVolumeBarcodeData": "*SW115QZ*"
    }
  }
}