v1

latestOpenAPI 3.0.12026-07-242073551.1 MB
Shipments

Pre Allocate Tracking Number

Receive a Royal Mail Tracking Number that will be pre-allocated to the service and destination supplied in the request. No shipment or label will be produced using this endpoint. <br /> <br />This service can be used in conjunction with the Create Shipment endpoint by specifying the TrackingNumber in the CarrierSpecifics or OfflineBarcodes section with the pre-allocated TrackingNumber returned in this service response. <br /> <br />Note: This endpoint can only be used for services that are assigned a tracking number.

post/v4/shipments/preallocateTrackingNumber/rm

Request body

ShippingLocationIdstring nullable

A unique identifier assigned by the system (shippingLocationId) or by you (alias) to the shipping location for which the tracking number is being pre-allocated. <br /> <br />Note: This field is mandatory if more than one shipping location is available for the shipping account.

ShippingAccountIdstring required

A unique identifier assigned by the system (shippingAccountId) or by you (alias) to the shipping account for which the tracking number is being pre-allocated.

ServiceCodestring required

A valid unique code identifying the service selected for the shipment's delivery and collection, which determines pricing, delivery speed, and other service attributes.

ServiceLevelstring nullable

The Royal Mail service level of the service specified in the ServiceCode field. Valid values range from 0-99. <br /> <br />Note: If the service level is not specified, then by default, this field is set to the lowest service level available for the specified service.

ServiceEnhancementCode'SIGNED'

This object specifies the particular enhancement code for the tracking number, allowing customers to add the enhancements that can modify the shipping experience according to their preferences. <br /> <br />The valid value is: <br /> <br />Signed: A signature is required upon delivery, applicable to 24, 48, 1st Class, and 2nd Class services.

Example request

{
  "ShippingLocationId": "1234567890",
  "ShippingAccountId": "Manchester Hub",
  "ServiceCode": "CRL1",
  "ServiceLevel": "01",
  "Destination": {
    "CountryCode": "GB",
    "Postcode": "TW20 0HJ"
  }
}

Response

Returns the pre allocated tracking number successfully.

TrackingNumberstring nullable

A tracking number that has been pre-allocated based on the data sent in the request.

Example response

{
  "TrackingNumber": "TT123456785GB"
}