In the past, I had the opportunity to generate one-dimensional barcodes using data stored within Microsoft Dynamics CRM 4.0. These barcodes used the Code39 barcode standard, which was quite simple to generate using a barcode font. However, one-dimensional barcodes for Courier Post labels require the Code128b format which isn’t as simple as using a barcode font. In this post, I will go through and explain the different parts of the one-dimensional barcode used in Courier Post labels.
Example one-dimensional barcode string:
1234561234567801AKL010AS
The first six digits of the barcode represent what is called the Site ID. The Site ID is a unique identifier based on the origin point for the parcels dispatched in the Courier System. In this case, the Site ID is 123456.
The next eight digits represent what is called the Item Identifier. This number maps to a number built into your own software system that can help identify an order. For example, for one of our clients, we have decided to use a Loan Number as the Item Identifier. In this case, the Item Identifier is 12345678.
The next two digits represent the Parcel Count (the number of parcels belonging to this specific order). In the example above, we only have one parcel, so the parcel count is 01.
Next we have the Destination City which is displayed as three alpha characters. The destination city is determined based on the address details for the customer receiving the parcel. Courier Post supplies a spreadsheet which you can use to easily retrieve the abbreviated destination city based on the customer’s city and postal code, and with the magic of Dynamics CRM data imports, you can store this data into an entity of your choice. In the example above, the destination city is AKL (Auckland).
The next three digits represent the Parcel Weight in KGs. There are two types of weights associated with each parcel:
1. Physical Weight: This is the physical weight of the box including the packaged products. It is always rounded up to the nearest KG.
2. Volumetric Weight: Volumetric Weight = length x height x depth x 200. The three dimensions are measured in metres.
We always take the larger of the two weights to store within the barcode. The barcode string above encodes a weight of 10KG (010).
Lastly, we have what is called the Combined Service Code. The correct service code to use depends on the service type, and a number of other factors related to the order including:
• Whether a signature is required
• Whether Saturday deliveries are allowed
• Whether the parcel is to be delivered to a rural area
• Whether the parcel contains dangerous goods
The example above uses a Combined Service Code of AS which represents that a signature is required for this particular parcel.
That is basically the format of the one-dimensional barcode used in Courier Post labels. With the right information from Courier Post, it is quite easy to generate the barcode string and find a C# library online which you can use to generate the barcode image. We used a barcode library found here http://beta.codeproject.com/KB/graphics/BarcodeLibrary.aspx?msg=3009143
In my next post, I will explain the two-dimensional barcode format used on Courier Post labels.