如何区分 UPS Mail Innovations 和 USPS 跟踪号

How to distinguish UPS Mail Innovations from USPS tracking number

如果这是 UPS Mail Innovations 编号,我很难通过提供的跟踪编号来识别承运商。我正在编写一个小型 C# 库来完成这项任务,我找到的最好的资源是基于 Ruby 的资源,名为 tracking_number, but it does not handle UPS MI. It gets decoded as USPS according all possible validations I've tried. For example, the tracking number "92748999955488513006484872" is decoded as USPS, while it is UPS MI number (it could be tracked via UPS MI site www.ups-mi.net)。

问题:区分 UPS Mail Innovations 和 USPS 追踪号码的规则是什么?

根据 United Parcel Service (UPS) 客户支持,UPS Mail Innovation 追踪号码与 USPS 追踪号码的格式相同,无法区分。一旦包裹到达 USPS,就可以在那里进行追踪。

背景

UPS Mail Innovations uses several different types of tracking numbers.

上面较长的数字确实是美国邮政服务 (USPS)“Intelligent Mail® 包裹条形码”(IMpb) 号码。 (本例为26位,但还有其他有效长度。)

前缀 92 将其 (对于大多数实用目的) 标识为 post 真实追踪号码。 (`92' 是 GS1 Application Identifier for "Company internal information";当用于跟踪时 numbers/barcodes,USPS 称^为“渠道应用程序标识符”。)

自 2021 年起,Service Type Code/STC (not to be confused with a Service Type ID/STID - 那些仅用于信件邮件) of 748 在您的跟踪号码中将表示“包裹 Select 轻量级: USPS 追踪。

可能的解决方案

要回答这个问题,您可以尝试以下两种方法之一来识别此类邮件。 (你当然应该准备好处理误报和漏报。)

  1. 确定邮寄者使用的 6 位或 9 位邮寄者 ID (这应该在少量发货后在您的数据中可见);在这种情况下,UPS Mail Innovations (UPS MI) 的邮寄者 ID 可能是 999955 488.
  2. 同时查询 UPS 和 USPS 跟踪 API 并比较结果。如果包裹已发货但 USPS 未显示任何跟踪事件,则它可能是 UPS MI 包裹尚未送达目的地分拣设施或 post 办公室。

UPS MI 投递的包裹 应该 通常由 postal 承运人作为日常邮件投递的一部分投递给客户,但在极端情况下(例如,如果当地 post 办公室积压并且不接受包裹投递——这发生在 2021 年初) UPS 员工可能会进行最终客户交付。


备注:

注意:编码此跟踪号的条形码将有额外的数字。它将以 420, which USPS calls the "Postal Routing Code Application Identifier", followed by a 5 or 9 digit ZIP postal code. (See the specification 的 GS1 AI 开始以获取更多详细信息。)

^ 根据 IMpb Implementation Guide,第 2.5.1.1 节:

Valid Channel Application Identifiers are “91”, “92”, “93”, “94”, and “95”


原题提供的例子分析:

Example tracking number:  92748999955488513006484872
                         |                          |
                         0         1         2     2|
              26 digits: 012345678901234567890123456|

示例跟踪号中的数据结构分解:

R-AI*  ZIP Code*   |  AI  STC   MailerID     Serial        Check digit
---    ----- ----  |  --  ---   ------ ---   -----------   -
420    nnnnn-nnnn  |  92  748   999955 488   51300648487   2

| ----- * ----- |
        * Suppressed in printed tracking number; 
         (only present encoded in barcode data)

Fields:
       R-AI = Postal Routing Code Application Identifier
   ZIP Code = 5-digit or 9-digit postal code of destination (or next hop)
        STC = Service Type Code
         AI = Channel Application Identifier
  Mailer ID = 6 or 9 digit mailer ID (assigned by USPS)
     Serial = this must be unique for at least 6 months for each mailer
Check digit = Mod10 check digit