SSCC Validation in Node.js — 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 Node.js application.
In this guide
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:
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
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
| Digit | 1 | 0 | 6 | 1 | 4 | 1 | 4 | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 7 |
| Weight | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | — |
| Product | 3 | 0 | 18 | 1 | 12 | 1 | 12 | 1 | 3 | 2 | 9 | 4 | 15 | 6 | 21 | 8 | 27 | ? |
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
// ssccCheckDigit.js — GS1 mod-10 check digit for SSCC function validateSscc(raw) { const digits = raw.replace(/[\s-]/g, ''); if (!/^\d{18}$/.test(digits)) return false; let sum = 0; for (let i = 0; i < 17; i++) { const weight = i % 2 === 0 ? 3 : 1; sum += parseInt(digits[i], 10) * weight; } const checkDigit = (10 - (sum % 10)) % 10; return checkDigit === parseInt(digits[17], 10); } console.log(validateSscc('106141411234567897')); // true ✓ console.log(validateSscc('106141411234567890')); // false ✗ wrong check digit console.log(validateSscc('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.
Full parameter reference and response schema: SSCC Validation API docs →
6. Node.js code example
import { createClient } from '@isvalid-dev/sdk'; const iv = createClient({ apiKey: process.env.ISVALID_API_KEY }); // ── Example usage ──────────────────────────────────────────────────────────── const result = await iv.sscc('106141411234567897'); if (!result.valid) { console.log('Invalid SSCC'); } else { console.log('Extension digit:', result.extensionDigit); // → '1' console.log('Company + Serial:', result.companyAndSerial); // → '0614141123456789' console.log('Check digit:', result.checkDigit); // → '7' }
In an ASN (advance shipping notice) processing pipeline:
// Validate SSCCs in an inbound ASN before warehouse receipt async function processAsn(pallets) { const results = []; for (const pallet of pallets) { if (!pallet.sscc) { results.push({ ...pallet, status: 'missing' }); continue; } const check = await validateSscc(pallet.sscc); if (!check.valid) { results.push({ ...pallet, status: 'invalid' }); continue; } results.push({ ...pallet, sscc: pallet.sscc.replace(/[\s-]/g, ''), extensionDigit: check.extensionDigit, companyAndSerial: check.companyAndSerial, status: 'valid', }); } return results; }
(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 }
| Field | Type | Description |
|---|---|---|
| valid | boolean | Exactly 18 digits and GS1 mod-10 check digit passes |
| extensionDigit | string | First digit (0–9) — chosen by the assigning company to increase SSCC capacity |
| companyAndSerial | string | 16 digits — GS1 company prefix concatenated with the serial reference number |
| checkDigit | string | Single 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 function extractSscc(scan) { // GS1-128 scan may include AI: "00106141411234567897" if (scan.startsWith('00') && scan.length === 20) { return scan.slice(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
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.