X12 210 Motor Carrier Freight Details and Invoice Last updated: 2026-09-29

The 210 is the X12 motor carrier freight details and invoice. Trucking companies send it to the shipper or the party paying the freight to bill for a shipment.

B3 carries the invoice number, shipment ID, payment method and total charges, N1 loops the shipper and consignee, and LX loops with L0, L1 and L5 segments describe the lading, rates and charges.

At a glance

Standard
X12
Version
004010
Functional group
IM (GS01)
Sent by
Motor carrier to shipper or freight payer
Responses
997, 820 (payment)
ediFabric .NET template
TS210 in EdiFabric.Templates.X12
OpenEDI definition
View 210 in the spec library

210 structure

The full X12 210 layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 12 loops and 60 segment positions, in file order. Loops are shaded and their segments indented; Max use is how many times a segment or loop may repeat.

Segment / loop Name Usage Max use
STTransaction Set HeaderMandatory1
B3Beginning Segment for Carrier's InvoiceMandatory1
C2Bank IDOptional1
C3CurrencyOptional1
ITDTerms of Sale/Deferred Terms of SaleOptional1
N9Reference IdentificationOptional300
G62Date/TimeOptional6
R3Route Information - MotorOptional12
H3Special Handling InstructionsOptional6
K1RemarksOptional10
N1 loopNameOptional10
N1NameMandatory1
N2Additional Name InformationOptional1
N3Address InformationOptional2
N4Geographic LocationOptional1
N9Reference IdentificationOptional5
N7 loopEquipment DetailsOptional10
N7Equipment DetailsMandatory1
M7Seal NumbersOptional2
SPO loopShipment Purchase Order DetailOptional999999
SPOShipment Purchase Order DetailMandatory1
SDQDestination QuantityOptional10
S5 loopStop Off DetailsOptional999
S5Stop Off DetailsMandatory1
N9Reference IdentificationOptional10
G62Date/TimeOptional10
H3Special Handling InstructionsOptional6
SPO loopShipment Purchase Order DetailOptional999999
SPOShipment Purchase Order DetailMandatory1
SDQDestination QuantityOptional10
N1 loopNameOptional2
N1NameMandatory1
N2Additional Name InformationOptional1
N3Address InformationOptional2
N4Geographic LocationOptional1
N9Reference IdentificationOptional5
N7 loopEquipment DetailsOptional10
N7Equipment DetailsMandatory1
M7Seal NumbersOptional2
LX loopAssigned NumberOptional9999
LXAssigned NumberMandatory1
N9Reference IdentificationOptional5
PODProof of DeliveryOptional1
L5Description, Marks and NumbersOptional30
H1Hazardous MaterialOptional3
H2Additional Hazardous Material DescriptionOptional2
L0Line Item - Quantity and WeightOptional10
L1Rate and ChargesOptional10
L4MeasurementOptional10
L7Tariff ReferenceOptional10
K1RemarksOptional10
SPO loopShipment Purchase Order DetailOptional999999
SPOShipment Purchase Order DetailMandatory1
SDQDestination QuantityOptional10
N1 loopNameOptional999999
N1NameMandatory1
N2Additional Name InformationOptional1
N3Address InformationOptional2
N4Geographic LocationOptional1
N9Reference IdentificationOptional10
CD3 loopCarton (Package) DetailOptional999999
CD3Carton (Package) DetailMandatory1
N9Reference IdentificationOptional20
H6Special ServicesOptional10
L9Charge DetailOptional10
PODProof of DeliveryOptional1
G62Date/TimeOptional1
SPO loopShipment Purchase Order DetailOptional999999
SPOShipment Purchase Order DetailMandatory1
SDQDestination QuantityOptional10
L3Total Weight and ChargesOptional1
SETransaction Set TrailerMandatory1

Sample 210 file

A freight invoice with stops, lading and charges. Paste it into EdiNation to see every element named and validated.

ISA*00*          *00*          *16*SENDER1        *1B*RECEIVER1      *071216*1406*U*00204*000000263*1*T*>~
GS*IN*SENDER1*RECEIVER1*20071216*1406*000000001*X*004010*~
ST*210*00000001~
B3**3410889*545930791T*TP*L*20071031*5165**20071029*035*NLMI~
C3*USD~
N9*AE*260451~
N9*OP*3410889~
G62*86*20071031~
R3*EXEM*B**AE***20071031*37905~
N1*SH*SIEMENS VDO S A DE C V - SIEMENS AUTOMOTIVE*94*99999~
N3*PERIFERICO SUR 7999D COMPLEJO IND~
N4*TLAQUEPAQUE*MX*99999*MX~
N1*CN*BRAMPTON ASSEMBLY - COLLINS AND AIKMAN*94*09126B~
N3*500 LAIRD ROAD*GUELPH PRODUCTS~
N4*GUELPH*ON*99999*CA~
N1*BT*BRAMPTON ASSEMBLY - MAIN*94*09126~
N3*2000 WILLIAMS PARKWAY EAST~
N4*BRAMPTON*ON*99999*CA~
N1*CA*NATIONAL LOGISTICS MANAGEMENT*94*45795~
N3*14320 JOY RD.~
N4*DETROIT*MI*48228*US~
N1*ZZ*EXPEDITORS/EMERY WORLDWIDE*94*37905~
N3*10881 LOWELL AVENUE~
N4*OVERLANDPARK*KS*66201*US~
N9*IK*545930791T~
N7**53456*********TL****5300*******53ST~
LX*1~
L5*1**2*Z~
L0*1*1499*FR*1499*G******L~
L1*1*51.65*FR*5165****400~
L3*2619*G***5165~
SE*30*00000001~
GE*1*000000001~
IEA*1*000000263~

The same 210 as JSON

ediFabric turns every loop, segment and element into a named field. This is the transaction from the sample, in the JSON that ediFabric Native and Cloud return and accept.

{
  "ST": {
    "TransactionSetIdentifierCode_01": "210",
    "TransactionSetControlNumber_02": "00000001"
  },
  "B3": {
    "InvoiceNumber_02": "3410889",
    "ShipmentIdentificationNumber_03": "545930791T",
    "ShipmentMethodofPayment_04": "TP",
    "WeightUnitCode_05": "L",
    "Date_06": "20071031",
    "NetAmountDue_07": "5165",
    "DeliveryDate_09": "20071029",
    "DateTimeQualifier_10": "035",
    "StandardCarrierAlphaCode_11": "NLMI"
  },
  "C3": {
    "CurrencyCode_01": "USD"
  },
  "N9": [
    {
      "ReferenceIdentificationQualifier_01": "AE",
      "ReferenceIdentification_02": "260451"
    },
    {
      "ReferenceIdentificationQualifier_01": "OP",
      "ReferenceIdentification_02": "3410889"
    }
  ],
  "G62": [
    {
      "DateQualifier_01": "86",
      "Date_02": "20071031"
    }
  ],
  "R3": [
    {
      "StandardCarrierAlphaCode_01": "EXEM",
      "RoutingSequenceCode_02": "B",
      "TransportationMethodTypeCode_04": "AE",
      "Date_07": "20071031",
      "Amount_08": "37905"
    }
  ],
  "N1Loop": [
    {
      "N1": {
        "EntityIdentifierCode_01": "SH",
        "Name_02": "SIEMENS VDO S A DE C V - SIEMENS AUTOMOTIVE",
        "IdentificationCodeQualifier_03": "94",
        "IdentificationCode_04": "99999"
      },
      "N3": [
        {
          "AddressInformation_01": "PERIFERICO SUR 7999D COMPLEJO IND"
        }
      ],
      "N4": {
        "CityName_01": "TLAQUEPAQUE",
        "StateorProvinceCode_02": "MX",
        "PostalCode_03": "99999",
        "CountryCode_04": "MX"
      }
    },
    {
      "N1": {
        "EntityIdentifierCode_01": "CN",
        "Name_02": "BRAMPTON ASSEMBLY - COLLINS AND AIKMAN",
        "IdentificationCodeQualifier_03": "94",
        "IdentificationCode_04": "09126B"
      },
      "N3": [
        {
          "AddressInformation_01": "500 LAIRD ROAD",
          "AddressInformation_02": "GUELPH PRODUCTS"
        }
      ],
      "N4": {
        "CityName_01": "GUELPH",
        "StateorProvinceCode_02": "ON",
        "PostalCode_03": "99999",
        "CountryCode_04": "CA"
      }
    },
    {
      "N1": {
        "EntityIdentifierCode_01": "BT",
        "Name_02": "BRAMPTON ASSEMBLY - MAIN",
        "IdentificationCodeQualifier_03": "94",
        "IdentificationCode_04": "09126"
      },
      "N3": [
        {
          "AddressInformation_01": "2000 WILLIAMS PARKWAY EAST"
        }
      ],
      "N4": {
        "CityName_01": "BRAMPTON",
        "StateorProvinceCode_02": "ON",
        "PostalCode_03": "99999",
        "CountryCode_04": "CA"
      }
    },
    {
      "N1": {
        "EntityIdentifierCode_01": "CA",
        "Name_02": "NATIONAL LOGISTICS MANAGEMENT",
        "IdentificationCodeQualifier_03": "94",
        "IdentificationCode_04": "45795"
      },
      "N3": [
        {
          "AddressInformation_01": "14320 JOY RD."
        }
      ],
      "N4": {
        "CityName_01": "DETROIT",
        "StateorProvinceCode_02": "MI",
        "PostalCode_03": "48228",
        "CountryCode_04": "US"
      }
    },
    {
      "N1": {
        "EntityIdentifierCode_01": "ZZ",
        "Name_02": "EXPEDITORS/EMERY WORLDWIDE",
        "IdentificationCodeQualifier_03": "94",
        "IdentificationCode_04": "37905"
      },
      "N3": [
        {
          "AddressInformation_01": "10881 LOWELL AVENUE"
        }
      ],
      "N4": {
        "CityName_01": "OVERLANDPARK",
        "StateorProvinceCode_02": "KS",
        "PostalCode_03": "66201",
        "CountryCode_04": "US"
      },
      "N9": [
        {
          "ReferenceIdentificationQualifier_01": "IK",
          "ReferenceIdentification_02": "545930791T"
        }
      ]
    }
  ],
  "N7Loop": [
    {
      "N7": {
        "EquipmentNumber_02": "53456",
        "EquipmentDescriptionCode_11": "TL",
        "EquipmentLength_15": "5300",
        "EquipmentType_22": "53ST"
      }
    }
  ],
  "LXLoop": [
    {
      "LX": {
        "AssignedNumber_01": "1"
      },
      "L5": [
        {
          "LadingLineItemNumber_01": "1",
          "CommodityCode_03": "2",
          "CommodityCodeQualifier_04": "Z"
        }
      ],
      "L0": [
        {
          "LadingLineItemNumber_01": "1",
          "BilledRatedasQuantity_02": "1499",
          "BilledRatedasQualifier_03": "FR",
          "Weight_04": "1499",
          "WeightQualifier_05": "G",
          "WeightUnitCode_11": "L"
        }
      ],
      "L1": [
        {
          "LadingLineItemNumber_01": "1",
          "FreightRate_02": "51.65",
          "RateValueQualifier_03": "FR",
          "Charge_04": "5165",
          "SpecialChargeorAllowanceCode_08": "400"
        }
      ]
    }
  ],
  "L3": {
    "Weight_01": "2619",
    "WeightQualifier_02": "G",
    "Charge_05": "5165"
  },
  "SE": {
    "NumberofIncludedSegments_01": "30",
    "TransactionSetControlNumber_02": "00000001"
  }
}

Parse and validate a 210 file

Read the file into typed objects with ediFabric .NET, convert it to JSON in process with the ediFabric Native bindings for Python, Java and C, or post it to the ediFabric Cloud REST API from any language.

using EdiFabric.Templates.X12004010;

License.SetSerial("YOUR_SERIAL_KEY");

using (var stream = File.OpenRead(@"C:\edi\FreightInvoice.txt"))
using (var reader = new X12Reader(stream, "EdiFabric.Templates.X12"))
{
    var items = await reader.ReadToEndAsync();
    foreach (var transaction in items.OfType<TS210>())
    {
        if (transaction.IsValid(out MessageErrorContext errors))
            Console.WriteLine($"{transaction.ST.TransactionSetControlNumber_02} is valid");
        else
            Console.WriteLine(string.Join(Environment.NewLine, errors.Flatten()));
    }
}
import json
import edifabric_x12 as ef

serial = "YOUR_SERIAL_KEY"
ef.load_library()
ef.set_serial(serial)
ef.set_map(json.dumps({"default": serial, "maps": {}}))

edi = open("FreightInvoice.txt", "rb").read()
output, offset = ef.parse(edi, ef.ParseMode.JSON_VALIDATE)
transactions = output[:offset]
report = json.loads(output[offset:])
print(report["errors_count"])
import com.edifabric.nativex12.EdiFabricX12;
import com.edifabric.nativex12.ParseMode;
import com.edifabric.nativex12.ParseResult;

String serial = "YOUR_SERIAL_KEY";
EdiFabricX12.loadLibrary();
EdiFabricX12.setSerial(serial);
EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}");

String edi = Files.readString(Path.of("FreightInvoice.txt"));
ParseResult result = EdiFabricX12.parse(edi, ParseMode.JSON_VALIDATE);
System.out.println(result.getTransactions());
System.out.println(result.getReport());
#include "edifabric_x12.h"

const char *serial = "YOUR_SERIAL_KEY";
ef_parse_result result;

if (ef_load_library(NULL) != 0)
    return 1;
ef_set_serial(serial);
ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}");

char *edi = read_file("FreightInvoice.txt", NULL);   /* helper in example_all_functions.c */
if (ef_parse(edi, EF_PARSE_JSON_VALIDATE, NULL, &result) == 0) {
    /* transactions = output[0 .. offset), report = output[offset .. length) */
    fwrite(result.output.data, 1, (size_t)result.output.length, stdout);
    ef_free(result.output.data);
}
curl -X POST 'https://api.edination.com/v2/x12/read' \
-H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \
-H 'Content-Type: application/octet-stream' \
--data-binary '@FreightInvoice.txt'

Generate a 210 file

Populate a TS210 object in .NET, or pass JSON in the shape shown above to ediFabric Native or ediFabric Cloud, and get a valid 210 file back.

using EdiFabric.Templates.X12004010;

License.SetSerial("YOUR_SERIAL_KEY");

var transaction = new TS210();

//  Transaction Set Identifier Code = “210”
//  (Motor Carrier Freight Details and Invoice)
//  Transaction Set Control Number = 00000001
transaction.ST = new ST();
transaction.ST.TransactionSetIdentifierCode_01 = "210";
transaction.ST.TransactionSetControlNumber_02 = "0001";

// ... set the remaining loops and segments the same way

// SegmentBuilders is in the Common project of the example repository
using (var stream = new MemoryStream())
{
    using (var writer = new X12Writer(stream))
    {
        writer.Write(SegmentBuilders.BuildIsa("1"));
        writer.Write(SegmentBuilders.BuildGs("1"));
        writer.Write(transaction);
    }
    Console.WriteLine(Encoding.UTF8.GetString(stream.ToArray()));
}
import json
import edifabric_x12 as ef

serial = "YOUR_SERIAL_KEY"
ef.load_library()
ef.set_serial(serial)
ef.set_map(json.dumps({"default": serial, "maps": {}}))

# the transactions JSON returned by ef.parse, edited or produced by your application
transactions = open("FreightInvoice.json", "rb").read()
edi = ef.build(transactions, postfix="\r\n")
print(edi)
import com.edifabric.nativex12.EdiFabricX12;

String serial = "YOUR_SERIAL_KEY";
EdiFabricX12.loadLibrary();
EdiFabricX12.setSerial(serial);
EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}");

// the transactions JSON returned by parse, edited or produced by your application
String transactions = Files.readString(Path.of("FreightInvoice.json"));
String edi = EdiFabricX12.build(transactions, "\r\n");
System.out.println(edi);
#include "edifabric_x12.h"

ef_buffer edi;

if (ef_load_library(NULL) != 0)
    return 1;
ef_set_serial("YOUR_SERIAL_KEY");
ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}");

/* the transactions JSON returned by ef_parse, edited or produced by your application */
char *transactions = read_file("FreightInvoice.json", NULL);
if (ef_build(transactions, "\r\n", &edi) == 0) {
    fwrite(edi.data, 1, (size_t)edi.length, stdout);
    ef_free(edi.data);
}
# the JSON returned by /read, edited or produced by your application
curl -X POST 'https://api.edination.com/v2/x12/write' \
-H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \
-H 'Content-Type: application/json' \
--data-binary '@FreightInvoice.json' \
-o 'FreightInvoice.txt'

Complete ediFabric .NET example

A complete C# program for the X12 210, built on TS210 in EdiFabric.Templates.X12. The same code is in the ediFabric .NET examples on GitHub.

///
/// Builds freight invoice.
/// Original from https://ps.extra.chrysler.com/sites/itb-ebus/Documents/210FreightPaymentInvoice.pdf
///
static TS210 BuildFreightInvoice(string controlNumber)
{
	var result = new TS210();

	//  Transaction Set Identifier Code = “210”
	//  (Motor Carrier Freight Details and Invoice)
	//  Transaction Set Control Number = 00000001
	result.ST = new ST();
	result.ST.TransactionSetIdentifierCode_01 = "210";
	result.ST.TransactionSetControlNumber_02 = controlNumber.PadLeft(9, '0');

	//  Invoice Number = 3410889
	//  Shipment Identification Number = 545930791T
	//  Shipment Method of Payment
	//  = “TP” (Third Party)
	//  Weight Unit Code = “L” (Pounds)
	//  Date = 10 / 31 / 2007
	//  Net Amount Due = 51.65
	//  Delivery Date = 10 / 29 / 2007
	//  Date / Time Qualifier = “035” (Delivered)
	//  Standard Carrier Alpha Code = NLMI
	result.B3 = new B3();
	result.B3.InvoiceNumber_02 = "3410889";
	result.B3.ShipmentIdentificationNumber_03 = "545930791T";
	result.B3.ShipmentMethodofPayment_04 = "TP";
	result.B3.WeightUnitCode_05 = "L";
	result.B3.Date_06 = "20071031";
	result.B3.NetAmountDue_07 = "5165";
	result.B3.DeliveryDate_09 = "20071029";
	result.B3.DateTimeQualifier_10 = "035";
	result.B3.StandardCarrierAlphaCode_11 = "NLMI";

	//  Currency Code = USD (U.S.)
	result.C3 = new C3();
	result.C3.CurrencyCode_01 = "USD";

	//  Repeating N9
	result.N9 = new List();

	//  Reference Identification Qualifier = “AE”
	//  (Authorization for Expense Number)
	//  Reference Identification = 260451
	var n91 = new N9();
	n91.ReferenceIdentificationQualifier_01 = "AE";
	n91.ReferenceIdentification_02 = "260451";
	result.N9.Add(n91);

	//  Reference Identification Qualifier
	//  = “OP” (Original Purchase Order)
	//  Reference Identification = 3410889
	var n92 = new N9();
	n92.ReferenceIdentificationQualifier_01 = "OP";
	n92.ReferenceIdentification_02 = "3410889";
	result.N9.Add(n92);

	//  Repeating G62
	result.G62 = new List();

	//  Date Qualifier = “86” (Actual Pickup Date)
	//  Date = 10 / 31 / 2007
	var g62 = new G62();
	g62.DateQualifier_01 = "86";
	g62.Date_02 = "20071031";
	result.G62.Add(g62);

	//  Repeating R3
	result.R3 = new List();

	//  Standard Carrier Alpha Code = EXEM
	//  Routing Sequence Code
	//  = “B” (Origin / Delivery Carrier < Any Mode >)
	//  Transportation Method/ Type Code
	//  = “AE” (Air Express)
	//  Date = 10 / 31 / 2007
	//  Amount = 379.05
	var r3 = new R3();
	r3.StandardCarrierAlphaCode_01 = "EXEM";
	r3.RoutingSequenceCode_02 = "B";
	r3.TransportationMethodTypeCode_04 = "AE";
	r3.Date_07 = "20071031";
	r3.Amount_08 = "37905";
	result.R3.Add(r3);

	//  Repeating N1 Loops
	result.N1Loop = new List();

	//  Begin N1 Loop 1
	var n1Loop1 = new Loop_N1_210();

	//  Entity Identifier Code = “SH” (Shipper)
	//  Name = SIEMENS VDO S A DE C V –
	//  SIEMENS AUTOMOTIVE
	//  Identification Code Qualifier
	//  = “94” (Code assigned by the organization that is
	//  the ultimate destination of the transaction set)
	//  Identification Code = 99999
	n1Loop1.N1 = new N1();
	n1Loop1.N1.EntityIdentifierCode_01 = "SH";
	n1Loop1.N1.Name_02 = "SIEMENS VDO S A DE C V - SIEMENS AUTOMOTIVE";
	n1Loop1.N1.IdentificationCodeQualifier_03 = "94";
	n1Loop1.N1.IdentificationCode_04 = "99999";

	//  Repeating N3
	n1Loop1.N3 = new List();

	//  Address Information
	//  = PERIFERICO SUR 7999D COMPLEJO IND
	var n31 = new N3();
	n31.AddressInformation_01 = "PERIFERICO SUR 7999D COMPLEJO IND";
	n1Loop1.N3.Add(n31);

	//  City Name = TLAQUEPAQUE
	//  State or Province Code = MX
	//  Postal Code = 99999
	//  Country Code = MX
	n1Loop1.N4 = new N4();
	n1Loop1.N4.CityName_01 = "TLAQUEPAQUE";
	n1Loop1.N4.StateorProvinceCode_02 = "MX";
	n1Loop1.N4.PostalCode_03 = "99999";
	n1Loop1.N4.CountryCode_04 = "MX";

	//  End N1 Loop 1
	result.N1Loop.Add(n1Loop1);

	//  Begin N1 Loop 2
	var n1Loop2 = new Loop_N1_210();

	//  Entity Identifier Code = “CN” (Consignee)
	//  Name = BRAMPTON ASSEMBLY – COLLINS
	//  AND AIKMAN
	//  Identification Code Qualifier
	//  = “94” (Code assigned by the organization that is
	//  the ultimate destination of the transaction set)
	//  Identification Code = 09126B
	n1Loop2.N1 = new N1();
	n1Loop2.N1.EntityIdentifierCode_01 = "CN";
	n1Loop2.N1.Name_02 = "BRAMPTON ASSEMBLY - COLLINS AND AIKMAN";
	n1Loop2.N1.IdentificationCodeQualifier_03 = "94";
	n1Loop2.N1.IdentificationCode_04 = "09126B";

	//  Repeating N3
	n1Loop2.N3 = new List();

	//  Address Information
	// = 500 LAIRD ROAD~GUELPH PRODUCTS
	var n32 = new N3();
	n32.AddressInformation_01 = "500 LAIRD ROAD";
	n32.AddressInformation_02 = "GUELPH PRODUCTS";
	n1Loop2.N3.Add(n32);

	//  City Name = GUELPH
	//  State or Province Code = ON
	//  Postal Code = 99999
	//  Country Code = CA
	n1Loop2.N4 = new N4();
	n1Loop2.N4.CityName_01 = "GUELPH";
	n1Loop2.N4.StateorProvinceCode_02 = "ON";
	n1Loop2.N4.PostalCode_03 = "99999";
	n1Loop2.N4.CountryCode_04 = "CA";

	//  End N1 Loop 2
	result.N1Loop.Add(n1Loop2);

	//  Begin N1 Loop 3
	var n1Loop3 = new Loop_N1_210();

	//  Entity Identifier Code = “BT” (Bill-to-Party)
	//  Name = BRAMPTON ASSEMBLY - MAIN
	//  Identification Code Qualifier
	//  = “94” (Code assigned by the organization that is
	//  the ultimate destination of the transaction set)
	//  Identification Code = 09126
	n1Loop3.N1 = new N1();
	n1Loop3.N1.EntityIdentifierCode_01 = "BT";
	n1Loop3.N1.Name_02 = "BRAMPTON ASSEMBLY - MAIN";
	n1Loop3.N1.IdentificationCodeQualifier_03 = "94";
	n1Loop3.N1.IdentificationCode_04 = "09126";

	//  Repeating N3
	n1Loop3.N3 = new List();

	//  Address Information
	//  = 2000 WILLIAMS PARKWAY EAST
	var n33 = new N3();
	n33.AddressInformation_01 = "2000 WILLIAMS PARKWAY EAST";
	n1Loop3.N3.Add(n33);

	//  City Name = BRAMPTON
	//  State or Province Code = ON
	//  Postal Code = 99999
	//  Country Code = CA
	n1Loop3.N4 = new N4();
	n1Loop3.N4.CityName_01 = "BRAMPTON";
	n1Loop3.N4.StateorProvinceCode_02 = "ON";
	n1Loop3.N4.PostalCode_03 = "99999";
	n1Loop3.N4.CountryCode_04 = "CA";

	//  End N1 Loop 3
	result.N1Loop.Add(n1Loop3);

	//  Begin N1 Loop 4
	var n1Loop4 = new Loop_N1_210();

	//  Entity Identifier Code = “CA” (Carrier)
	//  Name
	//  = NATIONAL LOGISTICS MANAGEMENT
	//  Identification Code Qualifier
	//  = “94” (Code assigned by the organization that is
	//  the ultimate destination of the transaction set)
	//  Identification Code = 45795
	n1Loop4.N1 = new N1();
	n1Loop4.N1.EntityIdentifierCode_01 = "CA";
	n1Loop4.N1.Name_02 = "NATIONAL LOGISTICS MANAGEMENT";
	n1Loop4.N1.IdentificationCodeQualifier_03 = "94";
	n1Loop4.N1.IdentificationCode_04 = "45795";

	//  Repeating N3
	n1Loop4.N3 = new List();

	//  Address Information = 14320 JOY RD.
	var n34 = new N3();
	n34.AddressInformation_01 = "14320 JOY RD.";
	n1Loop4.N3.Add(n34);

	//  City Name = DETROIT
	//  State or Province Code = MI
	//  Postal Code = 48228
	//  Country Code = US
	n1Loop4.N4 = new N4();
	n1Loop4.N4.CityName_01 = "DETROIT";
	n1Loop4.N4.StateorProvinceCode_02 = "MI";
	n1Loop4.N4.PostalCode_03 = "48228";
	n1Loop4.N4.CountryCode_04 = "US";

	//  End N1 Loop 4
	result.N1Loop.Add(n1Loop4);

	//  Begin N1 Loop 5
	var n1Loop5 = new Loop_N1_210();

	//  Entity Identifier Code = “ZZ” (Mutually Defined)
	//  Name = EXPEDITORS / EMERY WORLDWIDE
	//  Identification Code Qualifier
	//  = “94” (Code assigned by the organization that is
	//  the ultimate destination of the transaction set)
	//  Identification Code = 37905
	n1Loop5.N1 = new N1();
	n1Loop5.N1.EntityIdentifierCode_01 = "ZZ";
	n1Loop5.N1.Name_02 = "EXPEDITORS/EMERY WORLDWIDE";
	n1Loop5.N1.IdentificationCodeQualifier_03 = "94";
	n1Loop5.N1.IdentificationCode_04 = "37905";

	//  Repeating N3
	n1Loop5.N3 = new List();

	//  Address Information = 10881 LOWELL AVENUE
	var n35 = new N3();
	n35.AddressInformation_01 = "10881 LOWELL AVENUE";
	n1Loop5.N3.Add(n35);

	//  City Name = OVERLANDPARK
	//  State or Province Code = KS
	//  Postal Code = 66201
	//  Country Code = US
	n1Loop5.N4 = new N4();
	n1Loop5.N4.CityName_01 = "OVERLANDPARK";
	n1Loop5.N4.StateorProvinceCode_02 = "KS";
	n1Loop5.N4.PostalCode_03 = "66201";
	n1Loop5.N4.CountryCode_04 = "US";

	//  Repeating N9
	n1Loop5.N9 = new List();

	//  Reference Identification Qualifier
	//  = “IK” (Invoice Number)
	//  Reference Identification = 545930791T
	var n9 = new N9();
	n9.ReferenceIdentificationQualifier_01 = "IK";
	n9.ReferenceIdentification_02 = "545930791T";
	n1Loop5.N9.Add(n9);

	//  End N1 Loop 5
	result.N1Loop.Add(n1Loop5);

	//  Repeating N7 Loops
	result.N7Loop = new List();

	//  Begin N7 Loop
	var n7Loop1 = new Loop_N7_210();

	//  Equipment Number = 53456
	//  Equipment Description Code
	//  = “TL” (Trailer < not otherwise specified>)
	//  Equipment Length = 53 Feet
	//  Equipment Type
	//  = “53ST” (53 Foot Standard Trailer)
	n7Loop1.N7 = new N7();
	n7Loop1.N7.EquipmentNumber_02 = "53456";
	n7Loop1.N7.EquipmentDescriptionCode_11 = "TL";
	n7Loop1.N7.EquipmentLength_15 = "5300";
	n7Loop1.N7.EquipmentType_22 = "53ST";

	//  End N7 Loop
	result.N7Loop.Add(n7Loop1);

	//  Repeating LX Loops
	result.LXLoop = new List();

	//  Begin LX Loop
	var lxLoop1 = new Loop_LX_210();

	//  Assigned Number = 1
	lxLoop1.LX = new LX();
	lxLoop1.LX.AssignedNumber_01 = "1";

	//  Repeating L5
	lxLoop1.L5 = new List();

	//  Lading Line Item Number= 1
	//  Commodity Code = “2” (Auto Parts)
	//  Commodity Code Qualifier
	//  = “Z” (Mutually defined)
	var l5 = new L5();
	l5.LadingLineItemNumber_01 = "1";
	l5.CommodityCode_03 = "2";
	l5.CommodityCodeQualifier_04 = "Z";
	lxLoop1.L5.Add(l5);

	//  Repeating L0
	lxLoop1.L0 = new List();

	//  Lading Line Item Number = 1
	//  Billed / Rated -as Quantity = 1499
	//  Billed / Rated -as Qualifier = “FR” (Flat Rate)
	//  Weight = 1499
	//  Weight Qualifier = “G” (Gross)
	//  Weight Unit Code = “L” (Pounds)
	var l0 = new L0();
	l0.LadingLineItemNumber_01 = "1";
	l0.BilledRatedasQuantity_02 = "1499";
	l0.BilledRatedasQualifier_03 = "FR";
	l0.Weight_04 = "1499";
	l0.WeightQualifier_05 = "G";
	l0.WeightUnitCode_11 = "L";
	lxLoop1.L0.Add(l0);

	//  Repeating L0
	lxLoop1.L1 = new List();

	//  Lading Line Item Number = 1
	//  Freight Rate = 51.65
	//  Rate / Value Qualifier = “FR” (Flat Rate)
	//  Charge = 51.65
	//  Special Charge or Allowance Code
	//  = “400” (Freight)
	var l1 = new L1();
	l1.LadingLineItemNumber_01 = "1";
	l1.FreightRate_02 = "51.65";
	l1.RateValueQualifier_03 = "FR";
	l1.Charge_04 = "5165";
	l1.SpecialChargeorAllowanceCode_08 = "400";
	lxLoop1.L1.Add(l1);

	//  End LX Loop
	result.LXLoop.Add(lxLoop1);

	//  Weight = 2619
	//  Weight Qualifier = “G” (Gross Weight)
	//  Charge = 51.65
	result.L3 = new L3();
	result.L3.Weight_01 = "2619";
	result.L3.WeightQualifier_02 = "G";
	result.L3.Charge_05 = "5165";

	return result;
}

More operations in ediFabric .NET

210 questions

How is a 210 matched to the shipment?

B3 carries the shipment identification (PRO) number and the bill of lading references, which also appear on the 204 load tender and the 214 status messages.

Where are accessorial charges?

In additional L1 segments with their own special charge codes, next to the line haul charge.

Which transactions come before the 210?

Usually a 204 load tender, a 990 response to the tender, and 214 shipment status messages.

How do I parse and generate X12 210 files in .NET, Python, Java and C?

In .NET, install EdiFabric and EdiFabric.Templates.X12, read the file with X12Reader into TS210 objects and write them back with X12Writer. From Python, Java or C, use ediFabric Native, which converts 210 files to JSON and JSON back to X12 inside your process. From any other language, post the file to the ediFabric Cloud REST API.

Resources

Parse your first X12 210 in five minutes

The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud with one serial key.

Sign up free Validate EDI files free