# SSCCAPI β€” GS1-128 Logistics Validator, EDI Extractor & Pallet Label Engine > Free, open-source GS1 Serial Shipping Container Code (SSCC-18) validator, Modulo 10 check digit calculator, EDIFACT/SAP IDoc/XML extractor, GS1-128 pallet label generator (A5/A6/4x6" & Zebra ZPL-II), and zero-auth public REST API. - Primary Web App & GS1 Digital Link Resolver: https://ssccapi.com/ - Commercial GS1 Labels, ZPL & 2D QR Digital Link API Base URL: https://ssccapi.com (Mirror: https://sscc-labels.birth1mark.workers.dev) - Public Validation REST API Base URL: https://ssccapi.com (Mirror: https://sscc.birth1mark.workers.dev) - OpenAPI 3.1 Specification (JSON): https://ssccapi.com/openapi.json - OpenAPI 3.1 Specification (YAML): https://ssccapi.com/openapi.yaml - Universal GS1 Check Digit Calculator: https://ssccapi.com/calculator - Technical Guide & GS1-128 Spec: https://ssccapi.com/guide - API Documentation & Playground: https://ssccapi.com/docs - Source Repository: https://github.com/birth1mark/sscc-check - License: MIT --- ## 1. Instructions for AI Agents & Autonomous Tools AI agents, LLM tool-callers, and automation workflows can interact with **SSCCAPI** in two ways: 1. **Direct REST API Calls (`https://sscc.birth1mark.workers.dev`)**: No API key or authentication required. Supports CORS (`*`) and returns structured JSON. Rate limit: 500 requests/hour per IP. 2. **Deep-Linking into the Web Application (`https://ssccapi.com/`)**: Construct pre-populated URLs for human operators to view validation results or print physical GS1 pallet labels. --- ## 2. Public REST API Endpoints (No Auth Required) ### 2.1 Validate an 18-Digit (or 20-Digit AI `00`) SSCC - **Endpoint**: `GET https://sscc.birth1mark.workers.dev/validate?sscc={code}` - **Example**: ```bash curl -s "https://sscc.birth1mark.workers.dev/validate?sscc=356012345600000016" ``` - **JSON Response (`200 OK`)**: ```json { "input": "356012345600000016", "sscc": "356012345600000016", "formatted": "(00)356012345600000016", "valid": true, "checkDigit": { "provided": 6, "expected": 6 }, "gs1": { "extensionDigit": 3, "prefix": 560, "country": "Portugal", "countryCode": "PT", "flag": "πŸ‡΅πŸ‡Ή" } } ``` ### 2.2 Generate Check Digit for a 17-Digit SSCC Body - **Endpoint**: `GET https://sscc.birth1mark.workers.dev/generate?body={17_digits}` - **Example**: ```bash curl -s "https://sscc.birth1mark.workers.dev/generate?body=35601234560000001" ``` - **JSON Response (`200 OK`)**: ```json { "body": "35601234560000001", "checkDigit": 6, "sscc": "356012345600000016", "formatted": "(00)356012345600000016", "gs1": { "extensionDigit": 3, "prefix": 560, "country": "Portugal", "countryCode": "PT", "flag": "πŸ‡΅πŸ‡Ή" } } ``` ### 2.3 Expand a Sequential SSCC Range (Up to 500 Codes) - **Endpoint**: `GET https://sscc.birth1mark.workers.dev/range?from={start}&to={end}` - **Example**: ```bash curl -s "https://sscc.birth1mark.workers.dev/range?from=35601234560000001&to=35601234560000005" ``` ### 2.4 Lookup GS1 Country Prefix - **Endpoint**: `GET https://sscc.birth1mark.workers.dev/prefix?sscc={code}` ### 2.5 Extract & Validate SSCCs from EDIFACT, SAP IDoc, XML, or CSV Payload - **Endpoint**: `POST https://sscc.birth1mark.workers.dev/extract` - **Headers**: `Content-Type: text/plain` (or `application/json` with `{"content": "..."}`) - **Max Payload**: 1 MB - **Example**: ```bash curl -s -X POST "https://sscc.birth1mark.workers.dev/extract" \ -H "Content-Type: text/plain" \ -d "UNA:+.? 'UNB+UNOC:3+SENDER+RECEIVER+261123:0800+1'GIN+BJ+356012345600000016'" ``` --- ## 2B. GS1 Pallet Label, ZPL-II & Standalone Barcode / 2D QR API (`https://sscc-labels.birth1mark.workers.dev`) Generates industrial GS1 Logistics Pallet Labels (`layout: "full"`) OR standalone SSCC barcode strips (`layout: "barcode-only"`) with **1D GS1-128** (`type: "gs1-128"`), **2D QR Code (`GS1 Digital Link` β€” Sunrise 2027)** (`type: "qr"`), or **Both (`1D + 2D QR`)** (`type: "both"` / `"dual"`) in **Zebra ZPL-II (`.zpl`)**, **Printable HTML (`A5`/`A6`/`4x6"`)**, **Vector SVG (`.svg`)**, or **JSON**. - **Free Tier**: Includes **25 free labels** per company prefix (`GCP`). Standalone `/v1/barcode` SVG lookups are free. - **Pro API Key (`X-API-Key: sscc_pro_...`)**: - **Emergency Pack (250 Labels β€” 5 EUR)**: https://buy.stripe.com/cNieVd4cm1UU7bAgcre3e01 - **Business Pack (1,000 Labels β€” 15 EUR)**: https://buy.stripe.com/bJe9AT9wGarq67wf8ne3e02 - **Pro Unlimited (100,000 Labels / 1 Year β€” 29 EUR)**: https://buy.stripe.com/28EeVdeR0eHG53s3pFe3e03 - **Endpoints**: - `GET https://sscc-labels.birth1mark.workers.dev/v1/barcode?sscc=356012345600000016&type=both&format=svg` β€” Standalone SSCC Barcode Generator. Parameter `type` (or `symbology`) selects `gs1-128` (1D linear barcode only), `qr` (2D QR Digital Link only), or `both` / `dual` (both 1D + 2D QR). Parameter `format` selects `svg` (`image/svg+xml`), `zpl` (`text/plain`), or `json` (returns separate `svg1d`, `svgQr`, `svgCombined`, `zpl1d`, `zplQr`, `zplCombined`). - `POST https://sscc-labels.birth1mark.workers.dev/v1/labels` β€” Generate single or batch labels (1–500 units) with `layout: "full" | "barcode-only"`, `symbology: "dual" | "gs1-128" | "qr"`, and `format: "json" | "zpl" | "html" | "svg"`. - `GET https://sscc-labels.birth1mark.workers.dev/v1/label?sscc=356012345600000016&symbology=dual&layout=full&format=zpl` β€” Single label generation. - `GET https://sscc-labels.birth1mark.workers.dev/v1/quota?gcp=5601234` β€” Check remaining free or Pro label credits. - `GET https://sscc-labels.birth1mark.workers.dev/v1/claim?email=user@company.com` β€” Self-service recovery of Pro `X-API-Key` by purchase email. - **Custom ERP Integrations & Bespoke Retailer Templates**: Users needing custom features, SAP/Odoo/WMS connectors, or specific retailer ZPL templates (Sonae, JerΓ³nimo Martins, Mercadona, Amazon) can contact the engineering team directly via https://ssccapi.com/ or https://ssccapi.com/. --- ## 3. Web UI Deep-Linking Parameters Agents can generate clickable links for human users: - **Validate a specific SSCC**: `https://ssccapi.com/?sscc=356012345600000016` - **Open directly in GS1 Pallet Label Studio for a code**: `https://ssccapi.com/?sscc=356012345600000016&label=1` - **Open Pallet Label Studio (Sequential Generator)**: `https://ssccapi.com/#labels` - **Share a multi-code batch via URL hash**: `https://ssccapi.com/#share={URI_ENCODED_BASE64_NEWLINE_SEPARATED_CODES}` --- ## 4. GS1 SSCC-18 Technical Reference ### Structure of an SSCC (18 Digits + Optional 2-Digit AI `00`) - **Application Identifier (AI)**: `00` (indicates a fixed-length 18-digit SSCC in GS1-128 barcodes, preceded by FNC1). - **Digit 1 β€” Extension Digit (`0`–`9`)**: Used to increase capacity of the Serial Reference (e.g., `0` = Standard Pallet, `1` = Carton/Case, `3` = Mixed Pallet). - **Digits 2 to N β€” GS1 Company Prefix (GCP)**: 6 to 11 digits assigned by a local GS1 Member Organization (first 3 digits indicate the GS1 Country Prefix, e.g., `560` = Portugal, `400`–`440` = Germany, `840`–`849` = Spain, `001`–`139` = USA). - **Remaining Digits up to Digit 17 β€” Serial Reference**: Zero-padded sequential number uniquely identifying the logistics unit. - **Digit 18 β€” Check Digit**: Calculated via the official **GS1 Modulo 10** algorithm. ### GS1 Modulo 10 Check Digit Algorithm (Reference Implementation) ```javascript function calculateGS1CheckDigit(payload17) { const digits = String(payload17).replace(/\D/g, '').split('').reverse(); let sum = 0; for (let i = 0; i < digits.length; i++) { sum += parseInt(digits[i], 10) * (i % 2 === 0 ? 3 : 1); } return (10 - (sum % 10)) % 10; } ``` ### Standard EDI Locations for SSCC - **UN/EDIFACT (`DESADV` / `IFTMIN`)**: - `GIN+BJ+` (Goods Identity Number, qualifier `BJ` = Serial Shipping Container Code) - `RFF+SI:` or `RFF+AAK:` - `PAC` package segment - **SAP IDoc (`DELVRY03` / `DELVRY07` / `DESADV01`)**: - Segment `E1EDL37` / `E1EDL44` β†’ Field `` or `` (External Handling Unit ID)