Character Limitations in Shipping Address Fields – There is a Solution
Subscribe to our blog
If you are using an Address Validation service for shipping labels, then you may occasionally run into character count limitations with the Address1 field. Whether you are using UPS, Fedex, ShipStation or any other shipping solution, most character limits tend to range between 30 or 35 characters (some even as low as 25 characters). While most addresses tend to be under this limit, there are always outliers that you’ll want your business solution to be ready to handle.
If you are using a DOTS Address Validation solution, you are in luck! The response from our API not only validates and corrects bad addresses but also allows you to customize address lines to meet your business needs. Whether you are looking to have your address lines be under a certain limit, want to place apartment or unit information on a separate line, or customize the address line in some other way, we can show you how to integrate the Address Validation response from Service Objects’ API into your business logic.
Below is a brief example using our DOTS Address Validation US 3 service to demonstrate the fragments that are returned in a typical valid response:
If you are worried about exceeding a certain character limit, you can programmatically check the Address1 line result from our service to see if it exceeds a particular limit.
Check the Result – Not the Input
There are two obvious reasons you should check the result of the service instead of the input. First, you want to use validated and corrected addresses on your mailing label. Second, the input address may be too long before validating but post-validation, the corrected addressed could meet the requirements and no customizations are needed to fit within the character limitations.
With this understanding, if the resulting validated street address in Address1 line is over the character limitation, then your application can go about splitting up the address in ways that best suit your needs.
For example, let’s say you have a long address line like the following:
12345 W FAKE INDUSTRIAL ST NE STE 130, #678
This is obviously a fake street, but it helps demonstrate some of the different ways you can handle long address lines. In the example, the address ends up being around 45 characters long, including spaces. The service would return the following fragments for this address:
Fragment House: 12345
FragmentStreet: Fake Industrial
With this example, one solution to reduce the character limits would be to move the Suite and Mail Box information to a separate address line, so it would appear like so:
12345 W FAKE INDUSTRIAL ST NE
STE 130, #678
You may need to fine tune the logic in your business application from this basic algorithm, but this can help you get started with catering your validated address information to meet different character limitations.
In most cases, the following can be used in Address line 1:
And the following in Address line 2:
There is an important exception to be aware of – PO Boxes. It is necessary to determine if the address is a PO Box to avoid applying the above logic to this type of address. It is simple to determine if the result is a PO Box by checking the DPVNotes field returned from the Address Validation service. PO Boxes typically will fit under character length limitations but some organizations choose to rebuild addresses from fragments regardless of field length. If this is the case and you have a PO Box, then the fragments to rebuild the PO Box are:
The examples above may require some fine tuning to meet your business requirements but hopefully they have also demonstrated the highly customizable nature of the address validation service and how it can be catered to meet your address validation needs.
If you have any questions about different integrations into your particular application contact our support team at firstname.lastname@example.org and we will gladly provide any support that we can!