---
title: "Pre Allocate Tracking Number"
method: POST
path: "/v4/shipments/preallocateTrackingNumber/rm"
tags: ["Shipments"]
---

# Pre Allocate Tracking Number

`POST /v4/shipments/preallocateTrackingNumber/rm`

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

## Request body

- PreAllocateTrackingNumberRequest — Royal Mail Get Pre Allocated Tracking Number Request
  - `ShippingLocationId` string, 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.*
  - `ShippingAccountId` string, 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.
  - `ServiceCode` string, 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.
  - `ServiceLevel` string, 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.
  - `Destination` DestinationDetails — The address of the receiver's location, containing country and post code details.
    - `CountryCode` string, required — An abbreviation representing the country of the address, typically following the ISO 3166-1 alpha-2 standard, for example, "US" for the United States of America. <br /> <br />***Note:** This information is required if the address is not used from the stored addresses in the **Address Book**.*
    - `Postcode` string, nullable — The postal or ZIP code corresponding to the address, used for mail sorting and to identify specific geographic areas.

## Response `200`

Returns the pre allocated tracking number successfully.

- PreAllocateTrackingNumberResponse — Royal Mail Get Pre Allocated Tracking Number Response
  - `TrackingNumber` string, nullable — A tracking number that has been pre-allocated based on the data sent in the request.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `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)
