EPCIS Support
AS2aaS provides comprehensive support for EPCIS (Electronic Product Code Information Services) documents, making it the ideal platform for pharmaceutical track & trace, supply chain visibility, and food safety compliance.
EPCIS Overview
EPCIS is a GS1 standard that enables trading partners to share information about the physical movement and status of products as they travel throughout the supply chain. AS2aaS handles EPCIS documents seamlessly through the AS2 protocol.
Key Benefits
- DSCSA Compliance: Full support for Drug Supply Chain Security Act requirements
- Track & Trace: Complete product journey visibility from manufacture to consumption
- Regulatory Compliance: Meet FDA, EMA, and other regulatory requirements
- Supply Chain Transparency: Real-time visibility into product movements
- Food Safety: Farm-to-fork traceability for food products
EPCIS Use Cases
Pharmaceutical Industry
DSCSA Track & Trace
The Drug Supply Chain Security Act requires pharmaceutical companies to track products through the supply chain:
curl -X POST https://api.as2aas.com/v1/messages \
-H "Authorization: Bearer pk_live_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"partner_id": "prt_pharmaceutical_partner",
"subject": "DSCSA T3 Shipment Verification",
"payload": {
"content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><epcis:EPCISDocument xmlns:epcis=\"urn:epcglobal:epcis:xsd:1\"><EPCISBody><EventList><ObjectEvent><eventTime>2024-01-15T10:30:00Z</eventTime><epcList><epc>urn:epc:id:sgtin:0614141.812345.6789</epc></epcList><action>OBSERVE</action><bizStep>urn:epcglobal:cbv:bizstep:shipping</bizStep><disposition>urn:epcglobal:cbv:disp:in_transit</disposition><readPoint><id>urn:epc:id:sgln:0614141.00777.0</id></readPoint><bizLocation><id>urn:epc:id:sgln:0614141.00888.0</id></bizLocation></ObjectEvent></EventList></EPCISBody></epcis:EPCISDocument>",
"filename": "dscsa_t3_shipment.xml"
},
"content_type": "application/xml",
"headers": {
"DSCSA-Version": "3.0",
"Event-Type": "Shipment",
"GLN": "0614141007770"
}
}'
Verification Requests
curl -X POST https://api.as2aas.com/v1/messages \
-H "Authorization: Bearer pk_live_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"partner_id": "prt_manufacturer",
"subject": "Product Verification Request",
"payload": {
"content": "<?xml version=\"1.0\"?><epcis:EPCISDocument xmlns:epcis=\"urn:epcglobal:epcis:xsd:1\"><EPCISBody><EventList><ObjectEvent><eventTime>2024-01-15T10:30:00Z</eventTime><epcList><epc>urn:epc:id:sgtin:0614141.812345.6789</epc></epcList><action>OBSERVE</action><bizStep>urn:epcglobal:cbv:bizstep:verification</bizStep><disposition>urn:epcglobal:cbv:disp:needs_verification</disposition></ObjectEvent></EventList></EPCISBody></epcis:EPCISDocument>",
"filename": "verification_request.xml"
},
"content_type": "application/xml",
"headers": {
"DSCSA-Version": "3.0",
"Event-Type": "VerificationRequest",
"Request-ID": "VR-2024-001"
}
}'
Retail & Supply Chain
Shipment Notifications
curl -X POST https://api.as2aas.com/v1/messages \
-H "Authorization: Bearer pk_test_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"partner_id": "prt_retailer",
"subject": "ASN for Order ORD-2024-001",
"payload": {
"content": "<?xml version=\"1.0\"?><epcis:EPCISDocument xmlns:epcis=\"urn:epcglobal:epcis:xsd:1\"><EPCISBody><EventList><AggregationEvent><eventTime>2024-01-15T08:00:00Z</eventTime><parentID>urn:epc:id:sscc:0614141.1234567890</parentID><childEPCs><epc>urn:epc:id:sgtin:0614141.812345.001</epc><epc>urn:epc:id:sgtin:0614141.812345.002</epc></childEPCs><action>ADD</action><bizStep>urn:epcglobal:cbv:bizstep:packing</bizStep></AggregationEvent></EventList></EPCISBody></epcis:EPCISDocument>",
"filename": "shipment_asn.xml"
},
"content_type": "application/xml",
"headers": {
"Document-Type": "ASN",
"Order-Number": "ORD-2024-001",
"Shipment-ID": "SHIP-001"
}
}'
Food Safety
Farm-to-Fork Traceability
curl -X POST https://api.as2aas.com/v1/messages \
-H "Authorization: Bearer pk_test_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"partner_id": "prt_food_distributor",
"subject": "Fresh Produce Traceability",
"payload": {
"content": "<?xml version=\"1.0\"?><epcis:EPCISDocument xmlns:epcis=\"urn:epcglobal:epcis:xsd:1\"><EPCISBody><EventList><ObjectEvent><eventTime>2024-01-15T06:00:00Z</eventTime><epcList><epc>urn:epc:id:sgtin:0614141.555555.001</epc></epcList><action>OBSERVE</action><bizStep>urn:epcglobal:cbv:bizstep:harvesting</bizStep><disposition>urn:epcglobal:cbv:disp:active</disposition><bizLocation><id>urn:epc:id:sgln:0614141.00001.0</id></bizLocation><extension><sourceList><source type=\"urn:epcglobal:cbv:sdt:possessing_party\">urn:epc:id:pgln:0614141.00001</source></sourceList><destinationList><destination type=\"urn:epcglobal:cbv:sdt:possessing_party\">urn:epc:id:pgln:0614141.00002</destination></destinationList></extension></ObjectEvent></EventList></EPCISBody></epcis:EPCISDocument>",
"filename": "harvest_traceability.xml"
},
"content_type": "application/xml",
"headers": {
"Product-Type": "Organic Lettuce",
"Harvest-Date": "2024-01-15",
"Farm-GLN": "0614141000010"
}
}'
EPCIS Event Types
AS2aaS supports all EPCIS event types:
Object Events
Track individual products or batches:
<ObjectEvent>
<eventTime>2024-01-15T10:30:00Z</eventTime>
<epcList>
<epc>urn:epc:id:sgtin:0614141.812345.6789</epc>
</epcList>
<action>OBSERVE</action>
<bizStep>urn:epcglobal:cbv:bizstep:shipping</bizStep>
<disposition>urn:epcglobal:cbv:disp:in_transit</disposition>
</ObjectEvent>
Aggregation Events
Track packaging and unpacking:
<AggregationEvent>
<eventTime>2024-01-15T10:30:00Z</eventTime>
<parentID>urn:epc:id:sscc:0614141.1234567890</parentID>
<childEPCs>
<epc>urn:epc:id:sgtin:0614141.812345.001</epc>
<epc>urn:epc:id:sgtin:0614141.812345.002</epc>
</childEPCs>
<action>ADD</action>
<bizStep>urn:epcglobal:cbv:bizstep:packing</bizStep>
</AggregationEvent>
Transformation Events
Track manufacturing and processing:
<TransformationEvent>
<eventTime>2024-01-15T10:30:00Z</eventTime>
<inputEPCList>
<epc>urn:epc:id:sgtin:0614141.111111.001</epc>
<epc>urn:epc:id:sgtin:0614141.222222.001</epc>
</inputEPCList>
<outputEPCList>
<epc>urn:epc:id:sgtin:0614141.333333.001</epc>
</outputEPCList>
<bizStep>urn:epcglobal:cbv:bizstep:commissioning</bizStep>
</TransformationEvent>
Transaction Events
Track ownership changes:
<TransactionEvent>
<eventTime>2024-01-15T10:30:00Z</eventTime>
<epcList>
<epc>urn:epc:id:sgtin:0614141.812345.6789</epc>
</epcList>
<action>ADD</action>
<bizStep>urn:epcglobal:cbv:bizstep:selling</bizStep>
<bizTransactionList>
<bizTransaction type="urn:epcglobal:cbv:btt:po">PO-2024-001</bizTransaction>
</bizTransactionList>
</TransactionEvent>
DSCSA Implementation
Requirements Overview
The Drug Supply Chain Security Act requires:
- Lot-level traceability for prescription drugs
- Verification systems to authenticate products
- Exception handling for suspect products
- Interoperable data exchange between trading partners
DSCSA T3 Messages
Shipment Notification
{
"subject": "DSCSA T3 Shipment - LOT123456",
"headers": {
"DSCSA-Version": "3.0",
"Event-Type": "Shipment",
"Transaction-ID": "TXN-2024-001",
"GLN-From": "0614141007770",
"GLN-To": "0614141008880"
}
}
Verification Request
{
"subject": "DSCSA Verification Request - SGTIN",
"headers": {
"DSCSA-Version": "3.0",
"Event-Type": "VerificationRequest",
"Request-ID": "VR-2024-001",
"SGTIN": "01.0614141.812345.21.12345"
}
}
Exception Report
{
"subject": "DSCSA Exception Report - Suspect Product",
"headers": {
"DSCSA-Version": "3.0",
"Event-Type": "Exception",
"Exception-Type": "Suspect",
"Product-ID": "01.0614141.812345.21.12345"
}
}
EPCIS Validation
AS2aaS provides EPCIS document validation:
Schema Validation
- EPCIS 1.2 and 2.0 schema compliance
- GS1 Core Business Vocabulary validation
- Custom extension validation
- Real-time validation during message processing
Business Rule Validation
curl -X POST https://api.as2aas.com/v1/epcis/validate \
-H "Authorization: Bearer pk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"document": "<?xml version=\"1.0\"?>...",
"validation_rules": [
"schema_compliance",
"business_rules",
"dscsa_compliance"
]
}'
Response:
{
"valid": true,
"validation_results": {
"schema_compliance": "passed",
"business_rules": "passed",
"dscsa_compliance": "passed"
},
"warnings": [],
"errors": []
}
EPCIS Query Interface
Query EPCIS Events
curl -X POST https://api.as2aas.com/v1/epcis/query \
-H "Authorization: Bearer pk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"query_type": "SimpleEventQuery",
"parameters": {
"EQ_bizStep": "urn:epcglobal:cbv:bizstep:shipping",
"GE_eventTime": "2024-01-01T00:00:00Z",
"LE_eventTime": "2024-01-31T23:59:59Z"
}
}'
Query by Product ID
curl -X POST https://api.as2aas.com/v1/epcis/query \
-H "Authorization: Bearer pk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"query_type": "SimpleEventQuery",
"parameters": {
"MATCH_epc": "urn:epc:id:sgtin:0614141.812345.6789"
}
}'
Industry-Specific Features
Pharmaceutical
Serialization Support
- SGTIN (Serialized Global Trade Item Number)
- SSCC (Serial Shipping Container Code)
- GLN (Global Location Number)
- Lot/Batch tracking
Temperature Monitoring
<ObjectEvent>
<eventTime>2024-01-15T10:30:00Z</eventTime>
<epcList>
<epc>urn:epc:id:sgtin:0614141.812345.6789</epc>
</epcList>
<action>OBSERVE</action>
<bizStep>urn:epcglobal:cbv:bizstep:sensor_reporting</bizStep>
<extension>
<sensorElementList>
<sensorElement>
<sensorMetaData>
<time>2024-01-15T10:30:00Z</time>
<deviceID>urn:epc:id:giai:0614141.temp001</deviceID>
</sensorMetaData>
<sensorReport>
<type>Temperature</type>
<value>2.5</value>
<uom>CEL</uom>
</sensorReport>
</sensorElement>
</sensorElementList>
</extension>
</ObjectEvent>
Food Safety
Critical Tracking Events
- Harvesting
- Processing
- Packaging
- Shipping
- Receiving
Recall Management
<ObjectEvent>
<eventTime>2024-01-15T10:30:00Z</eventTime>
<epcList>
<epc>urn:epc:id:sgtin:0614141.555555.001</epc>
</epcList>
<action>DELETE</action>
<bizStep>urn:epcglobal:cbv:bizstep:recall</bizStep>
<disposition>urn:epcglobal:cbv:disp:recalled</disposition>
<extension>
<recallInformation>
<recallNumber>RECALL-2024-001</recallNumber>
<recallReason>Contamination detected</recallReason>
</recallInformation>
</extension>
</ObjectEvent>
Integration Patterns
Real-time Track & Trace
// Webhook handler for EPCIS events
app.post('/webhooks/epcis', (req, res) => {
const event = req.body;
if (event.type === 'message.received') {
const message = event.data;
if (message.content_type === 'application/xml' &&
message.headers['DSCSA-Version']) {
// Process DSCSA message
processDSCSAMessage(message);
// Update track & trace database
updateTraceability(message.payload);
// Send acknowledgment
sendEPCISAcknowledgment(message.partner_id, message.id);
}
}
res.status(200).send('OK');
});
Supply Chain Visibility Dashboard
def get_product_history(sgtin):
"""Get complete product journey from EPCIS events"""
events = epcis_query({
'query_type': 'SimpleEventQuery',
'parameters': {
'MATCH_epc': f'urn:epc:id:sgtin:{sgtin}'
}
})
timeline = []
for event in events:
timeline.append({
'timestamp': event['eventTime'],
'location': event['bizLocation']['id'],
'business_step': event['bizStep'],
'disposition': event['disposition']
})
return sorted(timeline, key=lambda x: x['timestamp'])
Best Practices
Message Design
- Use appropriate EPCIS event types for each business process
- Include all required GS1 identifiers (SGTIN, GLN, etc.)
- Implement proper error handling for invalid documents
- Use meaningful business transaction references
Security
- Implement digital signatures for EPCIS documents
- Use encrypted transmission for sensitive product data
- Validate trading partner certificates
- Audit all EPCIS message exchanges
Performance
- Batch multiple events in single EPCIS documents when appropriate
- Use compression for large EPCIS files
- Implement proper retry logic for failed transmissions
- Monitor message processing times
Compliance
- Stay updated on regulatory requirements (FDA, EMA, etc.)
- Implement proper data retention policies
- Maintain audit trails for all EPCIS events
- Regular compliance testing and validation
Getting Started with EPCIS
- Set up Trading Partners: Configure pharmaceutical/food partners
- Upload Certificates: Add required security certificates
- Configure EPCIS Validation: Enable document validation rules
- Test with Sample Data: Send test EPCIS documents
- Implement Webhooks: Set up real-time event processing
- Monitor Compliance: Track regulatory compliance metrics