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
Freight transport, also referred as ''Freight Forwarding'', is the physical process of transporting commodities and merchandise goods and cargo. The term shipping originally referred to transport by sea but in American English, it has been ex ...
.
With increased
liberalization
Liberalization or liberalisation (British English) is a broad term that refers to the practice of making laws, systems, or opinions less severe, usually in the sense of eliminating certain government regulations or restrictions. The term is used m ...
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 (in the range 00000000 to 99999999), a single check-digit, and a
two-letter ISO country code—the latter identifying the issuing
postal administration
This is a list of postal entities by country. It includes:
*The governmental authority responsible for postal matters.
*The regulatory authority for the postal sector. Postal regulation may include the establishment of postal policies, postal rat ...
'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.
Check-digit calculation
# Ignore the Service Indicator Code and Country Code
# Assign the weights 8, 6, 4, 2, 3, 5, 9, 7 to the 8 digits, from left to right
# Calculate S, the sum of each digit multiplied by its weight.
#*For example, for the number 47312482, S = 4*8 + 7*6 + 3*4 + 1*2 + 2*3 + 4*5 + 8*9 + 2*7 = 200
# Calculate the check digit, C, from C = 11 - (S mod 11)
#* If C = 10, change to C = 0
#* If C = 11, change to C = 5
#* For the example 47312482 C = 11 - (200 mod 11) = 11 - 2 = 9.
Python code for check-digit calculation
For Python 3.6 or later:
def get_check_digit(num: int) -> int:
"""Get S10 check digit."""
weights = , 6, 4, 2, 3, 5, 9, 7
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline o ...
sum = 0
for i, digit in enumerate(f""):
sum += weights * int(digit)
sum = 11 - (sum % 11)
if sum 10:
sum = 0
elif sum 11:
sum = 5
return sum
JavaScript code for check-digit calculation
function getCheckDigit(num)
Haskell code for check-digit calculation
checkDigit :: nt-> Int
checkDigit ns
, c 11 = 5
, c 10 = 0
, otherwise = c
where weights = , 6, 4, 2, 3, 5, 9, 7
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline o ...
s = sum $ zipWith (*) weights ns
c = 11 - (s `mod` 11)
See also
*
Serial Shipping Container Code, a related standard.
References
External links
* Draft of S10:
*
Part A: Identifier structures and encoding principles*
Part B: EMS items*
Part C: Special letter products*
Part D: Parcels*
Part E: Domestic / bilateral useThe UPU service indicator code list, list 124Online validator for S10 tracking numbers
Identifiers
Universal Postal Union
{{standard-stub