Assign Tracking Number to Carriers Automatically

Overview

The focus of this article is assigning tracking numbers to different shipments and matching that number with right carriers. The purpose of getting this setup done is so that the customers can track their shipments to the right carrier.

Example

Let’s understand this better with an example.

If a store owner has selected 4PX as their carrier with a tracking number like 303367017250, it’s quite possible that the system assigns it to DHLExpress instead of 4PX. Instead of having to manually change these numbers all the time, the user can set a tracking number pattern so the system can smartly associate that tracking number with the right carrier as shown in ​​the image below:

Step-by-step guide

In order to understand the process of assigning tracking numbers to the right carriers, the step-by-step guide is given below.

Specific carriers can be set as default ones for specific tracking numbers. To do this, follow the steps below:

  1. Locate Apps on the left navigation sidebar.
  2. From the list of installed apps, select the Rush app.
  3. Select Shipments from the navigation sidebar to the left.
  4. Select Settings from the navigation sub menu.

  5. In the Carrier assigning rules section, click on Add rule.
  6. A popup will open. In this popup, provide the following information:
    1. Tracking number regex: Specify the regex pattern. To know more, refer to the commonly used regex use cases section in the end.
    2. Pick a carrier: Select the carrier from the existing list provided by Shopify platform.
    3. Country of destination: Select the country/countries of destination from the list if required.

Note

The above mentioned settings can be applied to the pending shipments as well which will trigger reprocessing for the specified carrier.


Assign tracking number to carrier by pattern

The above shown dialog box allows the users to customize the settings based on tracking number pattern. For example, if the user assigns a 12 digit tracking number pattern to a 4PX carrier then 4PX will be set as a default carrier for all the 12 digit tracking numbers.

Assign tracking number to carrier by destination country

This setting of assigning tracking numbers to carriers can be further customized by selecting the destination country from the given list. In addition to using tracking number as a pattern, the user can also assign tracking number to carrier based upon the destination country. Doing so will let the system assign the tracking number to the right carrier.

For example, the carrier Australia Post may also use a 12-digit tracking number. So, your settings can further be updated to look something like this:

After choosing Australia as a destination country from the list, move it above 4PX in the list, so that all orders going to Australia with 12-digit tracking numbers are assigned to Australia Post carrier.

If the order is not going to Australia, then the 12-digit tracking number is assigned to 4PX as a carrier.

Commonly used Regex use cases

A regex is a shortened form of regular expression also referred to as rational expression or regexp. It is a sequence of characters that specifies a search pattern. Usually, such patterns are used by string-searching algorithms for find, find and replace operations on strings, or for input validation.

Here are some of the most common Regex (also shown in the screenshots above):

  • / – every pattern always starts and ends with this character.
  • ^ – indicates what the pattern should start with. This includes start of string or start of line depending on multiline mode.
  • $ – indicates what the pattern should end with. This includes end of string or end of line depending on multiline mode.

Examples

  • /^[A-Z]{2}\d{9}HK$/
    • Description:
      • The pattern starts with two alphabetic characters between A-Z
      • The pattern has 9-digits in between
      • The pattern ends with the following two characters:  HK
    •  Example: The regex shared above maps the tracking order numbers in this format:
      • AA123456789HK
      • AB123456789HK
      • AB012345678HK and so on.
  • /^GV\d{9}GB$/
    • Description:
      • The pattern starts with the following two alphabetic characters: GV
      • The pattern has 9-digits in between
      • The pattern ends with the following two alphabetic characters:  GB
    • Example: The regex shared above maps the tracking order numbers in this format: GV123456789GB
  • /^\d{9,12}$/
    • Description: The total number of digits in the pattern can be between 9 to 12
    • Example: The regex shared above maps the tracking order numbers in this format:
      • 123456789
      • 1234567890
      • 12345678901
      • 123456789012
      • 012123456789
      • 123412341234
  • /^33[A-Z]{3}\d{18}$/
    • Description:
      • The pattern starts with the following two numeric characters: 33
      • The pattern has 9 alphabetic characters from A-Z in between
      • The pattern ends with 18 numeric characters.
    • Example: The regex shared above maps the tracking order numbers in this format:
      • 33XHG135275301000935106
      • 33XHD048087301000935109
      • 33XHD048767901000935100 and so on.

For more information on regex, refer to the following articles:

Contact us

For further information or feedback, feel free to reach out to us and we’ll be happy to help.