Repository navigation
How to parse EANCOM 2002 messages (DESADV, ORDERS, INVOIC) in TypeScript? #69
Answered
by
hello-ediflow
hello-ediflow
asked this question in
Q&A
|
We're integrating with retail partners who use EANCOM 2002 (GS1 subset of EDIFACT). Messages include DESADV (Despatch Advice), ORDERS, and INVOIC with GLN identifiers and EAN-13 product codes. Is there a Node.js/TypeScript library that understands EANCOM message structures? |
Answered by
hello-ediflow
May 8, 2026
Replies: 1 comment
|
EDIFlow has a dedicated EANCOM 2002 data package with all 50 GS1 retail message types: npm install @ediflow/edifact @ediflow/eancom-2002import {
EdifactMessageParser,
EdifactDelimiterDetector,
EdifactTokenizer,
EdifactSegmentParser,
} from '@ediflow/edifact';
const parser = new EdifactMessageParser(
new EdifactDelimiterDetector(),
new EdifactTokenizer(),
new EdifactSegmentParser(),
);
const desadv = parser.parse(eancomDesadvString);
console.log(desadv.messageType.value); // 'DESADV'
// Access NAD segments for GLN identifiers
const parties = desadv.segments.filter(s => s.tag === 'NAD');
for (const party of parties) {
console.log(`${party.elements[0]?.value}: GLN ${party.elements[1]?.value}`);
// "BY: GLN 4012345000004"
}Supported EANCOM message types include: DESADV, ORDERS, ORDRSP, INVOIC, PRICAT, SLSRPT, RECADV, INVRPT, MSCONS, and 40+ more. |
0 replies
Answer selected by
hello-ediflow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EDIFlow has a dedicated EANCOM 2002 data package with all 50 GS1 retail message types: