S10 (UPU standard)


The UPU S10 standard defines a system for assigning 13-character identifiers to international postal items for the purpose of tracking and tracing them during shipping. The standard was introduced on 18 April 1996, and is currently in its 12th version.
With increased liberalization and the possibility of multiple postal services operating in the same country, the use of country codes to designate the postal service is a problem. To solve this, each country has a designated postal service that controls all S10 identifiers from that country; any competing postal services will have to cooperate with the designated owner. The organization assigned by the UPU member country shall manage the issue and use of S10 identifiers, among all the operators under the authority of that UPU member country, in such a way as to ensure that no S10 identifier is reused within a period of 12 calendar months. A period of 24 calendar months, or longer, is recommended.

Format

The identifiers consist of a two-letter service indicator code, an eight-digit serial number, a single check-digit, and a two-letter ISO country code identifying the issuing postal administration's country.

Service indicator codes

Service codes are generally assigned and administered within each issuing country, but certain types of service and code ranges are used for all countries as listed here.
CodeInterpretation
AA–AU
AV–AZDomestic, bilateral, multilateral use only
BA–BZDomestic, bilateral, multilateral use only
CA–CZParcel post
DA–DZDomestic, bilateral, multilateral use only
EA–EZEMS
  • The use of EX–EZ requires bilateral agreement
  • FA–FZ
    GADomestic, bilateral, multilateral use only
    GB–GC
    GDDomestic, bilateral, multilateral use only
    GE–GZ
    HA–HZE-commerce parcels
  • The use of HX–HY requires multilateral agreement
  • The use of HZ requires bilateral agreement
  • IA–IZ
    JA–JZ
    KA–KZ
    LA–LZLetter post tracked
  • The use of LZ requires bilateral agreement
  • MA–MZLetter post M bags
    NA–NZDomestic, bilateral, multilateral use only
    OA–OZ
    PA–PZDomestic, bilateral, multilateral use only
    QA–QMInternational Business Reply Service
    QN–QZ
    RA–RZLetter post registered
  • The use of RZ requires bilateral agreement.
  • SA–SZ
    TA–TZ
    UA–UZLetter post items
  • The use of UZ requires bilateral agreement
  • VA–VZLetter post insured
  • The use of VZ requires bilateral agreement
  • WA–WZ
    XA–XZ
    YA–YZ
    ZA–ZZDomestic, bilateral, multilateral use only

    Check-digit calculation

    1. Ignore the service indicator code and country code.
    2. Assign the weights 8, 6, 4, 2, 3, 5, 9, 7 to the 8 digits, from left to right.
    3. Calculate S, the sum of each digit multiplied by its weight.
    4. * For example, for the number 47312482: S = 4×8 + 7×6 + 3×4 + 1×2 + 2×3 + 4×5 + 8×9 + 2×7 = 200.
    5. Calculate the check digit C = 11 −.
    6. * If C = 10, change to C = 0.
    7. * If C = 11, change to C = 5.
    8. * For the example 47312482, C = 11 − = 11 − 2 = 9.

    Python code for check-digit calculation

    For Python 3.6 or later:

    def get_check_digit -> int:
    """Get S10 check digit."""
    weights =
    sum = 0
    for i, digit in enumerate:
    sum += weights * int
    sum = 11 -
    if sum 10:
    sum = 0
    elif sum 11:
    sum = 5
    return sum

    JavaScript code for check-digit calculation


    function getCheckDigit

    Haskell code for check-digit calculation


    checkDigit :: -> Int
    checkDigit ns
    | c 11 = 5
    | c 10 = 0
    | otherwise = c
    where weights =
    s = sum $ zipWith weights ns
    c = 11 -