# DSCSA 4-Element 2D DataMatrix Barcode & Matrix Specification
> Extract and validate all 4 DSCSA product identifier elements and FNC1 group separators in milliseconds.

- **Canonical URL:** https://stanzaapi.com/tools/pharma-dscsa/compliance/gtin-serial-lot-exp-matrix
- **Governing Standard:** 21 U.S. Code § 360eee / GS1 EPCIS (U.S. Food & Drug Administration (FDA) DSCSA)
- **Latency:** <2ms Edge
- **Privacy:** In-memory execution only (zero data stored or logged)

## Technical Overview & Governing Rules
DSCSA Section 582 mandates that packaging at the unit and case level carry a GS1 2D DataMatrix barcode encoding GTIN, Serial Number, Expiration Date, and Lot Number.

Variable-length Application Identifiers (AI 21 and AI 10) require GS1 FNC1 (<GS> / ASCII 29) group separators when not at the end of the barcode string.

## Specification Matrix
| AI | Data Element | Format | Length |
| --- | --- | --- | --- |
| (01) | GTIN-14 | Numeric with Mod-10 Checksum | 14 digits (Fixed) |
| (21) | Serial Number | Alphanumeric | Up to 20 chars (Variable + FNC1) |
| (17) | Expiration Date | YYMMDD | 6 digits (Fixed) |
| (10) | Batch / Lot | Alphanumeric | Up to 20 chars (Variable + FNC1) |

## Standard JSON Response Model
```json
{
  "elements": {
    "gtin": "00301234567896",
    "serial": "123456789012",
    "expiration": "2026-08-31",
    "lot": "LOT99881"
  },
  "syntaxValid": true,
  "fnc1DelimitersPresent": true
}
```

## Frequently Asked Questions & Edge Cases
### Q: Why is the FNC1 delimiter critical in 2D DataMatrix barcodes?
**A:** Without FNC1 (<GS>) separators, a barcode scanner cannot distinguish where a variable-length serial number ends and the next element begins.
