npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ediflow/x12-004010

v0.3.0

Published

X12 004010 Standard Definitions - Common Transaction Sets

Readme

@ediflow/x12-004010

X12 004010 (2000) Standard Definitions - Industry Standard

NPM Version License: MIT Package Size

X12 004010293 Transaction SetsIndustry StandardMIT LicensedFree


📦 What is this?

This package contains X12 004010 (2000) standard definitions for use with @ediflow/core.

X12 004010 is the most widely adopted ANSI ASC X12 standard in North America, used by retail, manufacturing, automotive, logistics, and healthcare industries.

Includes:

  • Transaction set structures (293 transaction sets)
  • Segment definitions
  • Element definitions
  • Composite definitions
  • Code lists
  • Syntax rules

Version: 004010 (Released 2000) - Industry standard


🚀 Installation

# Install core library (required)
npm install @ediflow/core

# Install this standard package
npm install @ediflow/x12-004010

📊 Supported Transaction Sets (293)

🛒 Core Purchasing

| Transaction Set | Description | Use Case | |----------------|-------------|----------| | 850 | Purchase Order | Order placement | | 855 | Purchase Order Acknowledgment | Order confirmation | | 860 | Purchase Order Change | Order modifications | | 865 | Purchase Order Change Acknowledgment | Change confirmation |

📦 Shipping & Receiving

| Transaction Set | Description | Use Case | |----------------|-------------|----------| | 856 | Ship Notice/Manifest | ASN (Advanced Shipping Notice) | | 857 | Shipment & Billing Notice | Shipment details |

💰 Invoicing & Payment

| Transaction Set | Description | Use Case | |----------------|-------------|----------| | 810 | Invoice | Billing documents | | 820 | Payment Order/Remittance | Payment processing | | 824 | Application Advice | Transaction status | | 997 | Functional Acknowledgment | EDI receipt confirmation |

🚚 Transportation

| Transaction Set | Description | |----------------|-------------| | 204 | Motor Carrier Load Tender | | 210 | Freight Invoice | | 214 | Transportation Shipment Status | | 990 | Response to Load Tender |

📊 Inventory & Planning

| Transaction Set | Description | |----------------|-------------| | 846 | Inventory Inquiry/Advice | | 830 | Planning Schedule | | 862 | Shipping Schedule |

+ 278+ additional transaction sets covering all industries and use cases.


📁 Package Contents

@ediflow/x12-004010/
└── data/
    ├── codes/                    # Code lists
    │   └── codes.json
    ├── composites.json           # Composite elements
    ├── elements.json             # Data elements
    ├── index.json                # Package metadata
    ├── messages/                 # Transaction set structures (293)
    │   ├── 850.json             # Purchase Order
    │   ├── 810.json             # Invoice
    │   ├── 856.json             # ASN
    │   ├── 997.json             # Functional ACK
    │   └── ... (289 more)
    ├── segment-syntax-rules.json # Segment validation rules
    └── segments.json             # Segment definitions

Package Size: ~7.8 MB


📖 Usage Example

import {
  X12MessageParser,
  X12DelimiterDetector,
  X12SegmentParser,
  X12EnvelopeParser
} from '@ediflow/x12';
import { FileBasedMessageStructureRepository } from '@ediflow/infrastructure-shared';
import path from 'path';

// 1. Set up parser
const parser = new X12MessageParser(
  new X12DelimiterDetector(),
  new X12SegmentParser(),
  new X12EnvelopeParser()
);

// 2. Parse X12 850 Purchase Order
const x12String = `ISA*00*          *00*          *ZZ*SENDER         *ZZ*RECEIVER       *260204*1030*^*00401*000000001*0*P*>~GS*PO*SENDER*RECEIVER*20260204*1030*1*X*004010~ST*850*0001~BEG*00*NE*PO123456**20260210~SE*3*0001~GE*1*1~IEA*1*000000001~`;

const message = parser.parse(x12String);

console.log(message.standard);          // 'X12'
console.log(message.messageType.value); // '850'
console.log(message.version.value);     // '004010'

// 3. Load 004010 definitions
const basePath = path.resolve(__dirname, 'node_modules');
const repository = new FileBasedMessageStructureRepository(basePath);
const structure = await repository.getMessageStructure('X12', '004010', '850');

console.log(structure?.name);           // 'Purchase Order'

📋 Transaction Set Details

850 - Purchase Order

Use Case: Buyer sends order to supplier

Key Segments:

  • ST - Transaction Set Header
  • BEG - Order details (PO number, date, type)
  • REF - Reference numbers (contract, customer ref, etc.)
  • DTM - Dates (delivery, ship, etc.)
  • N1_LOOP - Party information (BY=Buyer, SE=Seller, ST=ShipTo)
  • PO1_LOOP - Line items (product, quantity, price)
  • CTT - Transaction totals
  • SE - Transaction Set Trailer

Example:

ST*850*000000001~
BEG*00*NE*PO123456**20260210~
REF*DP*ACME~
DTM*002*20260215~
N1*BY*ACME Corp*92*ACME001~
N3*123 Main Street~
N4*New York*NY*10001*US~
PO1*1*100*EA*9.99**VP*WIDGET001~
CTT*1~
SE*9*000000001~

810 - Invoice

Use Case: Supplier sends invoice to buyer

Key Segments:

  • BIG - Invoice number, date, PO number
  • IT1_LOOP - Line items
  • TDS - Total dollar amount (mandatory!)
  • CTT - Line item count

856 - Ship Notice/ASN

Use Case: Supplier notifies buyer of shipment

Key Segments:

  • BSN - Shipment ID, date, time
  • HL_LOOP - Hierarchical structure
    • Level S (Shipment)
    • Level O (Order)
    • Level P (Pack/Carton)
    • Level I (Item)

Hierarchy Example:

HL*1**S*1~        (Shipment level)
  HL*2*1*O*1~     (Order level, parent=1)
    HL*3*2*P*1~   (Pack level, parent=2)
      HL*4*3*I*0~ (Item level, parent=3, no children)

997 - Functional Acknowledgment

Use Case: Receiver confirms receipt of functional group

Key Segments:

  • AK1 - Functional group being acknowledged
  • AK2_LOOP - Individual transaction set acknowledgments
  • AK9 - Summary (accepted/rejected counts)

Codes:

  • A = Accepted
  • E = Accepted with errors
  • R = Rejected

🎯 When to Use 004010

Perfect for:

  • Industry standard - Most widely adopted X12 version
  • Retail - Walmart, Target, Amazon require 004010
  • Automotive - OEMs and suppliers
  • Manufacturing - Supply chain integration
  • Logistics - 3PLs and freight forwarders
  • Healthcare - Pre-HIPAA or non-regulated claims

Industries using 004010:

  • 🛒 Retail & E-commerce
  • 🚗 Automotive
  • 🏭 Manufacturing
  • 📦 Logistics & Transportation
  • 🏥 Healthcare (non-HIPAA)

Consider alternatives if:

  • 🔄 HIPAA compliance - Use @ediflow/hipaa-x12-005010 (005010)
  • 🔄 Latest features - Use @ediflow/x12-006040 (006040, internal)

🆚 Version Comparison

| Version | Year | Transaction Sets | Use Case | |---------|------|-----------------|----------| | 004010 | 2000 | 293 | Industry standard | | 005010 | 2012 | 310 | HIPAA healthcare | | 006040 | 2026 | 319 | Latest release |


📦 Related Packages

Core:

Other X12 Standards:


📚 Documentation


🤝 Contributing

Data corrections or additional transaction sets? We welcome contributions!


📄 License

MIT License - see LICENSE


🔗 Links

  • NPM: https://npmjs.com/package/@ediflow/x12-004010
  • GitHub: https://github.com/ediflow-lib/core
  • ASC X12: https://x12.org

Built with ❤️ by the EDIFlow community

MIT