INVOIC Invoice message (D01B)

This is the standard EANCOM D01B syntax 3 spec, with 40 loops and 89 segment positions, as OpenEDI JSON, an ediFabric C# template and an ediFabric Native model. To change it for a trading partner, customize it in the EDI Spec Builder.

Loading the spec…
The spec as an OpenAPI 3 schema with x-openedi-* extensions, for ediFabric Native, ediFabric Cloud and the EDI Spec Builder. Download OpenEDI (83 KB) Generate classes
The ediFabric .NET template, class TSINVOIC. It needs the common segments, composites and codes of EANCOM D01B syntax 3, one download for every transaction in the version. Download C# (2 KB) Common files (57 KB)
The intermediary model ediFabric Native loads with set_map. Native supports X12 today, and EANCOM is coming. Download Native (1 KB)

Use the INVOIC spec in your code

ediFabric .NET

Add the C# template and its common files to your project, or reference the template NuGet package, and read INVOIC files into TSINVOIC objects. See ediFabric .NET.

ediFabric Native

Native supports X12 today, and EANCOM is coming. When it's available, map version D01B to this Native model with set_map to parse INVOIC files to JSON from Python, Java, C or C#. See ediFabric Native.

OpenEDI

Select Customize in Spec Builder to copy the spec under your own name, change it for your partner, and parse files against it in EdiNation, ediFabric Native or ediFabric Cloud. Read about OpenEDI.

Generate INVOIC classes in Python, Java, Node.js, Go, Rust or C

The OpenEDI file describes each INVOIC as JSON. To work with INVOIC data as typed objects, generate classes from the OpenEDI file in your language; the root class is TSINVOIC. The classes keep the loops, segments, lengths and code lists, but not the EDI data formats. Read more in Generate a class from OpenEDI.

Python: datamodel-code-generator. Node.js: openapi-typescript. Java, Go, Rust and C: OpenAPI Generator.

For a sample file, the same data as JSON, and code to parse, validate and generate the INVOIC, see the INVOIC transaction guide.

INVOIC structure

Loops and segments of the standard INVOIC, with their usage and maximum repeats.

IDNameUsageMax use
UNHMessage HeaderOptional1
BGMBGMMandatory1
DTMDate/time/periodMandatory35
PAIPayment instructionsOptional1
ALIAdditional informationOptional5
FTXFTXOptional99
Loop RFFRFFOptional99999
RFFRFFMandatory1
DTMDate/time/periodOptional5
Loop NADNADOptional99
NADNADMandatory1
FIIFIIOptional5
Loop RFFRFFOptional9999
RFFRFFMandatory1
Loop CTACTAOptional5
CTACTAMandatory1
COMCommunication contactOptional5
Loop TAXDuty/tax/fee detailsOptional5
TAXDuty/tax/fee detailsMandatory1
MOAMOAOptional1
Loop CUXCurrenciesOptional99
CUXCurrenciesMandatory1
DTMDate/time/periodOptional5
Loop PATPayment terms basisOptional10
PATPayment terms basisMandatory1
DTMDate/time/periodOptional5
PCDPCDOptional1
MOAMOAOptional1
PAIPayment instructionsOptional1
FIIFIIOptional1
Loop TDTTDTOptional10
TDTTDTMandatory1
Loop LOCLOCOptional10
LOCLOCMandatory1
DTMDate/time/periodOptional5
Loop TODTODOptional5
TODTODMandatory1
LOCLOCOptional2
Loop PACPackageOptional1000
PACPackageMandatory1
Loop ALCALCOptional9999
ALCALCMandatory1
Loop QTYQTYOptional1
QTYQTYMandatory1
Loop PCDPCDOptional1
PCDPCDMandatory1
Loop MOAMOAOptional2
MOAMOAMandatory1
Loop RTERate detailsOptional1
RTERate detailsMandatory1
Loop TAXDuty/tax/fee detailsOptional5
TAXDuty/tax/fee detailsMandatory1
MOAMOAOptional1
Loop LINLine itemOptional9999999
LINLine itemMandatory1
PIAPIAOptional25
IMDIMDOptional99
MEAMEAOptional5
QTYQTYOptional5
ALIAdditional informationOptional5
DTMDate/time/periodOptional35
GINGINOptional1000
QVRQVROptional1
FTXFTXOptional99
Loop MOAMOAOptional99
MOAMOAMandatory1
Loop PATPayment terms basisOptional10
PATPayment terms basisMandatory1
DTMDate/time/periodOptional5
PCDPCDOptional99
MOAMOAOptional1
Loop PRIPRIOptional25
PRIPRIMandatory1
APRAPROptional1
Loop RFFRFFOptional10
RFFRFFMandatory1
DTMDate/time/periodOptional5
Loop PACPackageOptional10
PACPackageMandatory1
MEAMEAOptional10
Loop PCIPCIOptional10
PCIPCIMandatory1
GINGINOptional10
Loop LOCLOCOptional9999
LOCLOCMandatory1
QTYQTYOptional100
DTMDate/time/periodOptional5
Loop TAXDuty/tax/fee detailsOptional99
TAXDuty/tax/fee detailsMandatory1
MOAMOAOptional2
Loop NADNADOptional99
NADNADMandatory1
Loop RFFRFFOptional5
RFFRFFMandatory1
Loop ALCALCOptional30
ALCALCMandatory1
ALIAdditional informationOptional5
DTMDate/time/periodOptional5
Loop QTYQTYOptional1
QTYQTYMandatory1
Loop PCDPCDOptional1
PCDPCDMandatory1
Loop MOAMOAOptional2
MOAMOAMandatory1
Loop RTERate detailsOptional1
RTERate detailsMandatory1
Loop TAXDuty/tax/fee detailsOptional5
TAXDuty/tax/fee detailsMandatory1
MOAMOAOptional2
Loop TDTTDTOptional10
TDTTDTMandatory1
Loop TODTODOptional5
TODTODMandatory1
LOCLOCOptional2
UNSSection controlMandatory1
CNTCNTOptional10
Loop MOAMOAMandatory100
MOAMOAMandatory1
Loop RFFRFFOptional1
RFFRFFMandatory1
DTMDate/time/periodOptional5
Loop TAXDuty/tax/fee detailsOptional10
TAXDuty/tax/fee detailsMandatory1
MOAMOAOptional9
Loop ALCALCOptional15
ALCALCMandatory1
ALIAdditional informationOptional1
MOAMOAOptional2
UNTMessage TrailerOptional1