Allocate packages to carriers

Once you’ve created a consignment, you’ll need to allocate it to a carrier service. This section explains how to configure allocation rules that Consignments can use when selecting carrier services, and the various methods you can use to allocate packages to those services.

In the context of Sorted Ship, that’s both our Consignments and Shipments platforms, allocation is the process of selecting the carrier service that will be used to deliver a package. Allocation is a key part of all Consingments workflows, as a package cannot be shipped if it has not previously been allocated to a suitable carrier service.

To allocate a package in Consignments, you’ll need to call one of Consignment’s Allocation API endpoints. You can specify a carrier service to allocate to, allocate based on a quote you received, or have the Consignments platform select the cheapest eligible carrier service for you. Whichever endpoint you use, Consignments uses pre-defined allocation rules to ensure that your package(s) are allocated to a suitable carrier service.

Consignments offers the following allocation endpoints:

EndpointDescriptionAPI
Allocate using default rulesAllocates one or more consignments based on your organisation’s custom allocation rulesLink
Allocate consignmentAllocates a single consignment to the cheapest available carrier serviceLink
Allocate consignment with service groupAllocates a consignment to the cheapest available carrier service in a particular carrier service groupLink
Allocate with quoteAllocates an individual consignment based on a specific delivery quote from a carrierLink

When a package is allocated to a carrier service, its status changes to Allocated, enabling you to retrieve it’s package labels and (where applicable) customs documentation. Consignments also returns an Allocation Summary, confirming the service that the consignment was allocated to and (where applicable) providing tracking details.

What is an allocation rule?

When you make an allocation request for a package, the Consignments platform uses it’s allocation rules to decide which carrier services are eligible to ship that package. Allocation rules are optional criteria that define the consignments that a particular carrier service is eligible to take. You can specify the following:

  • Maximum and minimum dimensions and weight
  • Maximum monetary value
  • Excluded UK postcode areas
  • Excluded countries
  • Allocation tags.

For example, you could specify that a particular carrier service should only be allocated packages that weigh between 1-25 Kg. Subsequently, the Consignments platform would not consider this service when allocating a package with a weight of 30Kg.

Set up allocation rules

Allocation rules must be configured in the Consignments UI. To configure allocation rules:

  1. Log in to the Consignments UI and open the Carrier Services page (Settings > Carrier Services) to display a list of available carrier services.

  2. Select the carrier service you want to configure rules for and then click Allocation Rules to display the Manage Carrier Service Rules page.

    carrier-services-screen

  3. If required, enter maximum dimensions or weights. To do so:

    carrier-service-rules-page

    1. In the Dimensions panel, click Add on the rule you want to set up (one of Allowed Weight, Allowed Girth, or Allowed Length). Consignments displays editable range fields.

      dimensions-fields
    2. Enter the range values for the rule.

    3. Click Save to confirm your changes. Consignments displays your new rule under the relevant field.

      dimensions-rule

      You can edit your new rule using the range boxes, or click Remove to remove it altogether.

  4. If required, enter an Allowed Compensation Value. This is the maximum monetary consignment value that the service can take.

  5. If required, add an allocation tag by entering the tag name into the Allocation Filtering Tags field and clicking Add. Consignments will only allocate those packages that have a corresponding value in their tags property to the carrier service.

    tags

    To remove a tag from a carrier service, click the x on its icon.

  6. If required, enter a UK postcode restriction.
    To do so, enter the postcode area, district, sector, and/or unit you want to restrict delivery to into the fields on the Geographic Availability panel.
    Then click the Add button. Consignments displays the restricted postcode area in the panel.

    postcodes

    To remove a restriction, click Remove.

  1. If required, enter international delivery restrictions.
    To do so, start typing the name of the country you want to restrict delivery to in the Add Another Country field.
    Then click Add on the relevant country.

    lux

    To remove a country from the list, click its remove button.

  2. Click Save to save your changes and finish setting up allocation rules.

What is an allocation filter tag?

Allocation tags are a type of allocation rule that enables you to filter the list of available carrier services on a per-consignment basis, no matter which allocation endpoint you use in your integration. They are generally used as a flexible means of excluding carrier services that would not be suitable for a particular package.

Tagged packages can only be allocated to those carrier services that have a matching tag. You can still allocate untagged shipments to a carrier service that has tags.

For example, a retailer might use the Consignments user-interface to add a Flammables tag to all the carrier services that they wanted to use for flammable products. They would then add the Flammables tag to all packages containing flammable products. The Consignments platform would only allocate those packages tagged as Flammables to a package in the pre-approved Flammables list.

Set up allocation filter tags

To associate tags with carrier services, use the Settings > Carrier Services > [select carrier service] > Allocation Rules > Allocation Filtering Tags panel of the Consignments UI, as detailed in set up allocation rules.

To tag a package, add the required tag into the shipment’s tags property, either at creation or via the Update Consignment endpoint. The tags property is a simple array listing all the tags that apply to the shipment.

The code sample below shows a tags property for a package that contains flammable materials, oil and alcohol.

Tags

  "Tags": [
   "Flammables",
   "Oil",
   "Alcohol"
]
  

Allocation tags example

Suppose that you set your carrier services up in the following way:

  • You tag Carrier Service A with Alcohol
  • You tag Carrier Service B with Flammables
  • You tag Carrier Service C with Alcohol and Flammables
  • You tag Carrier Service D with Oil
  • You don’t add any tags to Carrier Service E

This configuration would produce the following results:

  • Package with no tags - A B C D and E are returned
  • Package tagged with Alcohol - A and C are returned
  • Package tagged with Flammables - B and C are returned
  • Package tagged with Alcohol and Flammables - C is returned
  • Package tagged with Alcohol, Flammables, and Oil - No services are returned

What happens after allocation?

Once allocated to a suitable carrier service, the package’s status changes to “Allocated”, enabling you to retrieve its package labels and (where applicable) customs documentation. All allocation endpoints also return an Allocation Summary, either singularly or (where multiple packages have been allocated at once) in an array.

The Allocation Summary contains links to the consignment resource that was allocated, a summary of the carrier service that the consignment was allocated to, a link to the relevant package labels, and a ConsignmentLegs array indicating how many legs the shipment will need. Where a shipment would need multiple legs to complete, the ConsignmentLegs array shows tracking details for each individual leg.

In the example, a consignment with a {consignmentReference} of “EC-000-05B-MMA” has been allocated to a (pretend) carrier service called “Carrier X Next Day Super”.

Example: Allocation summary

Allocation Summary JSON

  [
    {
        "StatusCode": 200,
        "ApiLinks": [
            {
                "Rel": "detail",
                "Href": "consignments/EC-000-05B-MMA"
            },
            {
                "Rel": "label",
                "Href": "labels/EC-000-05B-MMA"
            }
        ],
        "Description": "Consignment EC-000-05B-MMA has been successfully allocated with Carrier X Next Day Super for shipping on 14/06/2019 17:00:00 +00:00",
        "ConsignmentLegs": [
            {
                "Leg": 1,
                "TrackingReferences": [
                    "TRK00009823"
                ],
                "CarrierReference": "CARRIER_X",
                "CarrierServiceReference": null,
                "CarrierName": "Carrier X"
            }
        ],
        "CarrierReference": "CARRIER_X",
        "CarrierName": "Carrier X",
        "CarrierServiceReference": "CX_NDS",
        "CarrierServiceName": "Next Day Super"
    }
]