This module provides a function named func IMb(track, route string) (string, int)
for generating USPS Intelligent Mail barcode (IMb), also known as 4-State Customer Barcode. The Intelligent Mail barcode is used by the United States Postal Service (USPS) for sorting and tracking letters and flats, offering enhanced visibility into the mailstream.
track
: Tracking information for the mailpiece.route
: Routing information for the mailpiece.
- The generated Intelligent Mail barcode string. (len: 64)
- Status code. (0 for success)
The Intelligent Mail barcode consists of the following components:
-
Barcode ID: A 2-digit field reserved to encode the presort identification.
- Should be "00" if an Optional Endorsement Line (OEL) is not printed on the mailpiece.
-
Service Type ID (STID): A 3-digit field used to identify the class of mail and additional services.
- Defines the mailpiece as Full-Service, Basic, or Non-Automation.
- Determines the disposition of Undeliverable-As-Addressed (UAA) mail.
-
Mailer ID (MID): A unique identifier assigned by USPS to Mail Owners or Preparer, Mailing Agents, or service providers based on annual mail volume criteria.
- 9-digit or 6-digit numeric code.
-
Serial Number: A 6 or 9-digit field defined by the mailer.
-
Routing Code: A 5, 9, or 11-digit field identifying the delivery ZIP Code data in the address.
Data Type | Data Field | # of Digits |
---|---|---|
Tracking Code | Barcode Identifier | 2 (2nd digit must be 0-4) |
Service Type Identifier | 3 | |
Mailer Identifier | 6 or 9 | |
Serial Number | 6 (with 6-digit MID) | |
9 (with 9-digit MID) | ||
Routing Code | Delivery Point ZIP Code | 0, 5, 9, or 11 |
Total | 31 maximum |
- USPS PostalPro - Intelligent Mail Barcode
- USPS PostalPro - Mailer ID
- USPS PostalPro - Service Type Identifier (STID)
- USPS PostalPro - Service Type Identifier (STID) Table
- USPS PostalPro - Service Type Identifier (STID) Details
- USPS PostalPro - Intelligent Mail Barcode FAQ
- USPS PostalPro - Encoder/Decoder
- USPS PostalPro - Fonts and Encoders Download