# EPCIS 1.2 XML Event Parser & Schema Validator (FDA DSCSA)
> High-speed EPCIS 1.2 XML parser extracting ObjectEvents, AggregationEvents, BizStep, ReadPoint, and GLN identifiers into JSON.

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

## Technical Overview & Governing Rules
EPCIS 1.2 XML is the standard format for exchanging electronic interoperable product tracing data (TI/TH) across the US pharmaceutical supply chain.

Parses ObjectEvent (commissioning, shipping, receiving), AggregationEvent (cases to pallets), and TransformationEvent messages with strict namespace verification.

Normalizes SGTIN URNs (urn:epc:id:sgtin:...), SSCC logistics identifiers, and GLN location tags for downstream ERP ingestion.

## Specification Matrix
| XML Element | Description | Extracted Value | Purpose |
| --- | --- | --- | --- |
| eventTime | Event Timestamp | eventTime | ISO 8601 UTC timestamp |
| epcList/epc | Serialized EPC URI | epcs[] | urn:epc:id:sgtin:0030123.045678.123456789012 |
| bizStep | Business Step | bizStep | urn:epcglobal:cbv:bizstep:commissioning |
| readPoint/id | Read Point GLN | readPoint | urn:epc:id:sgln:0030123.00001.0 |
| urn:epcglobal:cbv:bizstep:shipping | CBV Business Step URN | https://ref.gs1.org/cbv/bizstep/shipping | EPCIS 2.0 JSON-LD equivalent |
| parentID / childEPCs | Aggregation hierarchy | parentID / childEPCs | SSCC parent with SGTIN children |

## Standard JSON Response Model
```json
{
  "eventType": "ObjectEvent",
  "eventTime": "2026-08-30T10:30:00Z",
  "action": "OBSERVE",
  "bizStep": "shipping",
  "epcs": [
    "urn:epc:id:sgtin:0030123.045678.123456789012"
  ],
  "readPoint": "urn:epc:id:sgln:0030123.00001.0"
}
```

## Frequently Asked Questions & Edge Cases
### Q: Does this handle pallet parent-child aggregation hierarchies?
**A:** Yes, AggregationEvents parse parentID (SSCC) and childEPCs arrays seamlessly, maintaining full packaging lineage.

### Q: What EPCIS 1.2 namespaces are supported?
**A:** All standard GS1 EPCIS 1.2 XML namespaces (urn:epcglobal:epcis:xsd:1, urn:epcglobal:cbv:mda) and custom manufacturer extension elements.

### Q: How do I convert EPCIS 1.2 XML to EPCIS 2.0 JSON-LD?
**A:** Map each XML event element to its JSON-LD type (ObjectEvent, AggregationEvent, TransformationEvent, AssociationEvent), rewrite CBV URNs such as urn:epcglobal:cbv:bizstep:shipping to https://ref.gs1.org/cbv/bizstep/shipping, and carry eventTime, readPoint, epcList, parentID, and childEPCs across unchanged.
