Guide · Python · SDK · REST API

SSCC Validation in Python — GS1 Serial Shipping Container Code Explained

Every pallet, parcel, and container moving through a supply chain can be uniquely identified by an 18-digit SSCC. Here's how the GS1 standard works, what each part of the code means, how the check digit catches errors, and how to validate SSCCs in your Python application.

1. What is an SSCC?

The Serial Shipping Container Code (SSCC) is an 18-digit identifier defined by GS1 for tracking logistics units — pallets, parcels, cases, and containers — as they move through the supply chain. It is the globally unique "licence plate" for any physical shipment.

SSCCs are assigned by the company that creates the logistics unit (the packer, manufacturer, or 3PL). Once assigned, the SSCC follows the unit from origin to destination, appearing in advance shipping notices (ASN), warehouse management systems (WMS), and transport management systems (TMS).

The standard is part of the GS1 system and is encoded in GS1-128 barcodes using Application Identifier (AI) 00. It is widely used in retail, healthcare, automotive, and general logistics.


2. SSCC structure — 18 digits decoded

An SSCC has exactly 18 digits, split into three logical parts:

106141411234567897

Extension Digit

1

1 digit — increases capacity

GS1 Company Prefix + Serial Reference

0614141123456789

16 digits — company + serial

Check Digit

7

1 digit — GS1 mod-10

ℹ️The extension digit (0–9) is chosen by the company assigning the SSCC. It increases the total number of unique SSCCs a company can generate tenfold. The boundary between the GS1 company prefix and the serial reference depends on the length of the company prefix — together they always total 16 digits.

3. The GS1 check digit algorithm

The SSCC uses the same mod-10 check digit algorithm as EAN, GTIN, and GLN — alternating weights of 3 and 1, applied from right to left (or equivalently, the leftmost digit of the 17 data digits gets weight 3).

Let's walk through 106141411234567897:

Step 1 — Apply alternating weights (3 and 1) to the first 17 digits

Digit106141411234567897
Weight31313131313131313
Product30181121121329415621827?

Step 2 — Sum the products

3 + 0 + 18 + 1 + 12 + 1 + 12 + 1 + 3 + 2 + 9 + 4 + 15 + 6 + 21 + 8 + 27 = 143

Step 3 — Check digit = (10 − sum mod 10) mod 10

(10 − (143 % 10)) % 10 = (10 − 3) % 10 = 7

Last digit of SSCC is 7 — valid SSCC

# sscc_check_digit.py — GS1 mod-10 check digit for SSCC
import re


def validate_sscc(raw: str) -> bool:
    digits = raw.replace(" ", "").replace("-", "")
    if not re.match(r"^\d{18}$", digits):
        return False

    total = sum(
        int(digits[i]) * (3 if i % 2 == 0 else 1)
        for i in range(17)
    )

    check_digit = (10 - (total % 10)) % 10
    return check_digit == int(digits[17])


print(validate_sscc("106141411234567897"))  # True  ✓
print(validate_sscc("106141411234567890"))  # False ✗ wrong check digit
print(validate_sscc("340123450000000018"))  # checks dynamically

4. Why SSCC validation matters

Warehouse management systems (WMS)

SSCCs are the primary key for pallet and case tracking in modern warehouses. An invalid SSCC creates orphaned inventory — goods that physically exist but cannot be located or matched to inbound purchase orders. Validating at scan time prevents costly cycle counts and shipment delays.

EDI and electronic data interchange

SSCCs appear in EDI messages such as the DESADV (despatch advice) and ASN (advance shipping notice). Trading partners validate SSCCs on receipt — a malformed code triggers an EDI rejection, halting the receiving process and requiring manual intervention.

Advance Shipping Notices (ASN)

Retailers like Walmart, Amazon, and Tesco require valid SSCCs in ASNs before goods arrive at the distribution centre. An invalid SSCC means the shipment cannot be cross-docked or put away automatically, resulting in chargebacks and compliance penalties.

Regulatory traceability

In pharmaceuticals and food safety, SSCCs enable lot-level traceability. A recall requires identifying every logistics unit containing affected products. Invalid SSCCs break the traceability chain and can lead to regulatory non-compliance.


5. The production-ready solution

The IsValid SSCC API validates the format, computes the GS1 mod-10 check digit, and returns the parsed components — extension digit, company prefix with serial reference, and check digit — in a single call.

GS1 SSCC
Standard
full compliance
<15ms
Response time
pure algorithmic check
100/day
Free tier
no credit card

Full parameter reference and response schema: SSCC Validation API docs →


6. Python code example

Using the isvalid-sdk package or the requests library. Install with pip install isvalid-sdk or pip install requests.

# sscc_validator.py
import os
from isvalid_sdk import IsValidConfig, create_client

iv = create_client(IsValidConfig(api_key=os.environ["ISVALID_API_KEY"]))

result = iv.sscc("106141411234567897")

if not result["valid"]:
    print("Invalid SSCC")
else:
    print(f"Extension digit: {result['extensionDigit']}")     # → '1'
    print(f"Company + Serial: {result['companyAndSerial']}")  # → '0614141123456789'
    print(f"Check digit: {result['checkDigit']}")             # → '7'

In an ASN (advance shipping notice) processing pipeline:

# Validate SSCCs in an inbound ASN before warehouse receipt
def process_asn(pallets: list[dict]) -> list[dict]:
    results = []

    for pallet in pallets:
        if not pallet.get("sscc"):
            results.append({**pallet, "status": "missing"})
            continue

        check = validate_sscc(pallet["sscc"])

        if not check["valid"]:
            results.append({**pallet, "status": "invalid"})
            continue

        results.append({
            **pallet,
            "sscc": pallet["sscc"].replace(" ", "").replace("-", ""),
            "extension_digit": check["extensionDigit"],
            "company_and_serial": check["companyAndSerial"],
            "status": "valid",
        })

    return results
Always strip spaces, hyphens, and parentheses before validation. SSCCs are sometimes displayed with grouping separators for readability — e.g. (00) 1 0614141 123456789 7 — but the API expects 18 consecutive digits.

7. cURL example

Validate a valid SSCC:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/sscc?value=106141411234567897"

Validate an SSCC with an incorrect check digit:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/sscc?value=106141411234567890"

Validate an SSCC with extension digit 0:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/sscc?value=006141411234567893"

8. Understanding the response

Valid SSCC:

{
  "valid": true,
  "extensionDigit": "1",
  "companyAndSerial": "0614141123456789",
  "checkDigit": "7"
}

Invalid SSCC:

{
  "valid": false
}
FieldTypeDescription
validbooleanExactly 18 digits and GS1 mod-10 check digit passes
extensionDigitstringFirst digit (0–9) — chosen by the assigning company to increase SSCC capacity
companyAndSerialstring16 digits — GS1 company prefix concatenated with the serial reference number
checkDigitstringSingle check digit (0–9) computed via GS1 mod-10 algorithm

9. Edge cases — extension digits, GS1-128, and AI 00

Extension digit meaning

The extension digit (position 1) has no predefined meaning — it is not a country code, product type, or version number. It simply provides an extra digit of numbering capacity. A company with GS1 prefix 0614141 can generate 10x more unique SSCCs by varying the extension digit from 0 to 9. Do not assign business logic to this digit.

GS1-128 barcode encoding

SSCCs are encoded in GS1-128 (formerly EAN/UCC-128) barcodes. The barcode data begins with Application Identifier 00, followed by the 18-digit SSCC. When scanning, strip the AI prefix before validation:

# Strip AI 00 prefix from GS1-128 barcode scan
def extract_sscc(scan: str) -> str:
    # GS1-128 scan may include AI: "00106141411234567897"
    if scan.startswith("00") and len(scan) == 20:
        return scan[2:]  # remove AI 00
    return scan  # already 18 digits

AI 00 — Application Identifier

Application Identifier 00 is a fixed-length AI — it always contains exactly 18 digits after the 00 prefix. Unlike variable-length AIs, no FNC1 separator is needed after the SSCC. If your barcode scanner is configured for GS1-128, it may return the raw data including the AI. Always check for and strip this prefix before sending to the API.

SSCC reuse and uniqueness

GS1 recommends that SSCCs not be reused for at least 12 months after the logistics unit has been consumed or destroyed. In practice, many companies never reuse SSCCs. Your validation should check the check digit, but uniqueness enforcement is a business-layer concern — the API validates format and checksum only.


Summary

Do not assign business meaning to the extension digit — it is purely for numbering capacity
Do not forget to strip AI 00 from GS1-128 barcode scans before validation
Validate SSCCs at the point of scan — invalid codes break ASN matching and warehouse receipt
Use the same GS1 mod-10 algorithm as EAN and GLN — alternating weights 3 and 1
Store SSCCs as strings — leading zeros are significant (extension digit can be 0)
Include the SSCC in your ASN and DESADV messages for seamless EDI integration

See also

Validate SSCCs instantly

Free tier includes 100 API calls per day. No credit card required. Full GS1 SSCC validation with parsed extension digit, company prefix, and check digit.