What is a shipping rule?

Shipments’s shipping rules feature enables you to specify business logic to be used when the system allocates a shipment to a carrier service. This page explains how to configure and maintain shipping rules for carrier services and locations.

When you make an allocation request, the Shipments platform uses its shipping rules to ascertain which carrier services are “eligible” to take the shipments in question and which are not.

Shipment rules exist as a pre-defined set of specifications, based on shipment parameters and attributes. These specifications are then linked to carrier services and shipping locations to create a rule. A rule can either include shipments (e.g. “The linked carrier services are available when a shipment’s weight is between 10 and 15 kg”) or exclude shipments (e.g. “The linked carrier services are available unless a shipment’s weight is between 10 and 15 kg”).

When Shipments allocates a shipment, it examines the rules linked to each of its carrier services and excludes any services whose linked rulesets would prevent that service from taking the shipment.

Some use cases for shipment rules include:

  • Always shipping high-value items with a particular carrier service.
  • Only using specific carrier services to ship to a particular country or group of countries.
  • Never using a particular carrier service from a particular shipping location (for example, due to high shipping costs or previous customer service issues).

See the Worked Examples section for detailed examples on how Shipments takes rules into account when allocating shipments.

Viewing existing shipping rules

To view your existing shipping rules, select the Settings > Shipping > Shipping Rules page.

pro_manage_shipping_rules

The Shipping Rules page displays the following information about each rule:

  • Name
  • Description
  • Valid From / To - Shipping rules have set start and end dates, defined during the configuration process
  • Enabled - Use the toggle to enable or disable existing shipping rules. The Shipments platform does not take disabled shipping rules into account.

To edit an existing rule, click Edit. The process of editing an existing rule is the same as that used to set up a new rule, as explained in the Add New Shipping Rules section.

To export details of the rule as a JSON object, click Export.

Add new shipping rules

To add a new shipping rule, select the Settings > Shipping > Shipping Rules page and click Add New Shipping Rule. Shipments displays the Add New Shipping Rule page.

Step 1: adding shipping rule details

The Add Shipping Rule Details card enables you to enter identifying information about your new rule:

pro_manage_shipping_rules_add_rule

To add shipping rule details:

  1. Optionally, enter Valid From and Valid To dates. The rule only applies during the specified time period.
  2. Enter a unique Name of between five and 100 characters for the rule.
  3. Optionally, enter a Description of up to 150 characters for the rule.
  4. Click Next to display the Set Countries, Regions and Postcodes card.

Step 2: setting countries, regions and postcodes

The Set Countries, Regions and Postcodes card enables you to set geographic restrictions that may apply to the rule. For example, you might specify that the rule applies only to those shipments destined for the UK, or that the rule applies to all shipments except those bound for the USA.

pro_manage_shipping_rules_add_location

To explicitly include or exclude countries from the shipping rule:

  1. Select the Country that the rule applies to. The country is added to the My Selected Countries list.
  2. Use the Include countries and Exclude countries radio buttons to select whether the countries in the list should be included or excluded from the rule.

Regional rules

For certain countries, the system enables you to create rules at a regional or postcode level. For example, you might specify that the rule applies only to those shipments destined for an M2 postcode, or that the rule applies to all shipments except those destined for the state of Florida, USA.

Currently, Sorted supports regional rules for the following countries:

  • United States (states)
  • United Kingdom (counties)
  • Australia (states)
  • Canada (provinces)
  • Ireland (counties)

To configure regional rules:

  1. Select the relevant country from the Country list and ensure that the Include regions and postcodes radio button is selected.
  2. Select the Set regions and/or postcodes check box. Shipments displays additional fields relating to region selection.
  3. Use the radio buttons to select whether you want to Include regions and postcodes or Exclude regions and postcodes.
  4. Select an entire region to include or exclude from the rule (e.g. a US state or British county) by selecting that region from the Regions drop-down menu.
  5. Enter a postcode into the Postcodes field to add that postcode to the rule.

To add additional regions or postcodes, select Add New Region or Add New Postcode.

To remove a region or postcode, click its trash icon. Alternatively, select Remove all regions or Remove all postcodes.

Once you have finished setting up geographic restrictions, click Next to display the Set Values, Weight, and Dimensions card.

Step 3: setting values, weight and dimensions

The Set Values, Weight, and Dimensions card enables you to specify minimum and maximum values, weights and dimensions for the rule.

pro_manage_shipping_rules_add_dims

All values on this card are optional and “open-ended”. That is, you can specify a minimum value or weight without specifying a maximum, or vice versa.

To configure values, weights and dimensions:

  1. Enter a minimum and / or maximum Shipment Value as a numerical value, and select the relevant Currency.

2. Enter a minimum and / or maximum Shipment Dead Weight as a numerical value, and use the radio buttons to select whether the value is in kg or lbs. 3. Enter a minimum and / or maximum Package Volumetric Weight as a numerical value. The Package Volumetric Weight uses the weight units selected in the Shipment Dead Weight field. 4. Enter a minimum and / or maximum Package Length as a numerical value, and use the radio buttons to select whether the value is in cm or in. 5. Enter a minimum and / or maximum Package Girth as a numerical value. The Package Girth uses the dimension units selected in the Package Length field.

When you have configured values, weights, and dimensions, click Next to display the Link Tenants and Channels card card.

Step 4: linking tenants and channels

The Link Tenants and Channels card enables you to select the tenants and channels that your rule applies to, where applicable.

pro_manage_shipping_rules_add_tenant_channel

You can link tenants and channels to your rule in the following ways:

  • To link your new rule to a tenant and all of its associated channels, select that tenant from the list.
  • To link your new rule to selected channels within a tenant, click the + icon by the tenant’s name to display all of that tenant’s channels, and then select the channel or channels you require.
  • To search for a specific tenant or channel, type a name into the search bar.
  • To select all tenants and channels that you have available, click Select all tenants and channels.

If a rule has tenants and channels selected then it only applies to shipments created as part of that tenant or channel. Likewise, if you do not select any tenants of channels on this card then your rule applies to all of your tenants and channels.

Once you have selected the tenants and channels you require, click Next to display the Link Carrier Services card.

Step 5: linking carrier services

The Link Carrier Services card enables you to select the carrier services that your shipping rule applies to.

pro_manage_shipping_rules_link_carrier_services

Select the carrier services that you want the new rule to apply to. To search for a specific carrier service, type a name into the search bar.

Once you have selected the required carrier services, click Next to display the Link Shipping Locations card.

Step 6: linking shipping locations

The Link Shipping Locations card enables you to select the shipping locations that your shipping rule applies to. You can either include shipping locations (i.e. “the rule applies to all shipments originating from these shipping locations”) or exclude shipping locations (i.e. “the rule applies to all shipments except those originating from these shipping locations”).

pro_manage_shipping_rules_link_shipping_locations

You can link shipping locations to your rule in the following ways:

  • To link a specific location or locations to your rule, use the radio buttons to select whether you want to Include shipping locations or Exclude shipping locations and then select the shipping locations you want to link from the list.
  • To search for a specific carrier service, type a name into the search bar.
  • To select all available shipping locations, click Select All.

Once you have finished linking shipping locations, click Add Shipping Rule to save your changes and close the Add Shipping Rule page.

Worked examples

This section gives worked examples for how combinations of rules can affect the carrier services that are eligible to take a shipment.

In these examples we have four carrier services: A, B, C, and D. Each of these carrier services has its own linked ruleset that defines whether or not it is eligible to take the shipments in that example.

Scenario 1 - geographic rulesets

In this scenario, we have the following rules defined:

Carrier ServiceGeographic RulesValue RulesWeight/Dimension Rules
AInclude: Country US, postal code =~ 322xx--
BInclude: Country US--
C---
DExclude: Country US, Postal Code =~ 809xx--

We have the following shipment:

DestinationValueWeight
US, 3220220GBP1.2kg

The results of processing the shipping rules are as follows:

Carrier ServiceIncludedReason
A✔️Geographic rule matches country and postcode
B✔️Geographic rule matches country
C✔️Not excluded by any rules
D✔️Not excluded by geographic rules

However, given the following shipment the results differ:

DestinationValueWeight
US, 8092220GBP1.2kg

Results:

Carrier ServiceIncludedReason
AGeographic rule postcode mismatch - service is not included
B✔️Geographic rule matches country
C✔️Not excluded by any rules
DExcluded by geographic rules

Scenario 2 - value rulesets

In this scenario, we have the following rules defined:

Carrier ServiceGeographic RulesValue RulesWeight/Dimension Rules
A-Include: > 10GBP-
B-Include: >= 10GBP, < 50GBP-
C---
D-Exclude: > 15GBP-

We have the following shipment:

DestinationValueWeight
US, 3220220GBP1.2kg

The results of processing the shipping rules are as follows:

Carrier ServiceIncludedReason
A✔️Value rule includes this service
B✔️Value rule includes this service
C✔️Not excluded by any rules
DExcluded by value rule

However, given the following shipment the results differ:

DestinationValueWeight
US, 322028.55GBP1.2kg

Results:

Carrier ServiceIncludedReason
AValue rule not matched - service is not included
BValue rule not matched - service is not included
C✔️Not excluded by any rules
D✔️Not excluded by value rule

Scenario 3 - weights and dimensions rulesets

In this scenario, we have the following rules defined:

Carrier ServiceGeographic RulesValue RulesWeight/Dimension Rules
A--Include: < 10kg
B--Include: > 1kg, <= 15kg
C---
D--Exclude: > 8.5kg

We have the following shipment:

DestinationValueWeight
US, 3220220GBP9.0kg

The results of processing the shipping rules are as follows:

Carrier ServiceIncludedReason
A✔️Weight rule includes this service
B✔️Weight rule includes this service
C✔️Not excluded by any rules
DExcluded by weight rule

However, given the following shipment the results differ:

DestinationValueWeight
US, 322028.55GBP5.25kg

Results:

Carrier ServiceIncludedReason
A✔️Weight rule includes this service
B✔️Weight rule includes this service
C✔️Not excluded by any rules
D✔️Not excluded by weight rule

Scenario 4 - mixed rulesets

This scenario is more complex and involves multiple types of rules:

Carrier ServiceGeographic RulesValue RulesWeight/Dimension Rules
AInclude: Country DE-Include: < 10kg
B-Include: > 10GBP, <= 20GBPInclude: > 1kg, <= 15kg
C---
DExclude: Country DE, Postal Code =~ 554xx-Exclude: > 8.5kg

We have the following shipment:

DestinationValueWeight
DE, 554829.65GBP5.45kg

The results of processing the shipping rules are as follows:

Carrier ServiceIncludedReason
A✔️Matches both geographic include rule and weight include rule
BDoes not match value rule; matches weight rule
C✔️Not excluded by any rules
DExcluded by geographic rule. Not excluded by weight rule.

However, given the following shipment the results differ:

DestinationValueWeight
DE, 2005419.25GBP9.5kg

Results:

Carrier ServiceIncludedReason
A✔️Matches both geographic and weight/dimension rule includes
B✔️Matches both value and weight/dimension rule includes
C✔️Not excluded by any rules
DNot excluded by geographic rule. Excluded by weight/dimension rule