v1
latestOpenAPI 3.0.12026-07-242073551.1 MBPrint 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.
Path parameters
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
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.
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*"
}
}
}