X12 214 Transportation Carrier Shipment Status Message

The 214 is the X12 transportation carrier shipment status message. Carriers send it to shippers and consignees to report pickup, in-transit events, appointments and delivery.

B10 identifies the shipment, and each LX loop reports an event: AT7 with the status code and date, MS1 with the location and MS2 with the equipment.

At a glance

Standard
X12
Version
004010
Functional group
QM (GS01)
Sent by
Carrier to shipper or consignee
Responses
997
ediFabric .NET template
TS214 in EdiFabric.Templates.X12
OpenEDI definition
View 214 in the spec library

214 structure

The full X12 214 layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 12 loops and 54 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
B10Beginning Segment for Transportation Carrier Shipment Status MessageMandatory1
L11Business Instructions and Reference NumberOptional300
MANMarks and NumbersOptional9999
K1RemarksOptional10
N1 loopNameOptional10
N1NameMandatory1
N2Additional Name InformationOptional1
N3Address InformationOptional2
N4Geographic LocationOptional1
G61ContactOptional1
G62Date/TimeOptional1
L11Business Instructions and Reference NumberOptional10
MS3Interline InformationOptional12
LX loopAssigned NumberOptional999999
LXAssigned NumberMandatory1
AT7 loopShipment Status DetailsOptional10
AT7Shipment Status DetailsMandatory1
MS1Equipment, Shipment, or Real Property LocationOptional1
MS2Equipment or Container Owner and TypeOptional1
L11Business Instructions and Reference NumberOptional10
MANMarks and NumbersOptional9999
Q7Lading Exception CodeOptional10
K1RemarksOptional10
AT5Bill of Lading Handling RequirementsOptional10
AT8Shipment Weight, Packaging and Quantity DataOptional10
CD3 loopCarton (Package) DetailOptional999999
CD3Carton (Package) DetailMandatory1
L11Business Instructions and Reference NumberOptional20
AT7 loopShipment Status DetailsOptional10
AT7Shipment Status DetailsMandatory1
MS1Equipment, Shipment, or Real Property LocationOptional1
MS2Equipment or Container Owner and TypeOptional1
NM1Individual or Organizational NameOptional1
Q7Lading Exception CodeOptional10
AT8Shipment Weight, Packaging and Quantity DataOptional1
MANMarks and NumbersOptional9999
N1 loopNameOptional999999
N1NameMandatory1
N2Additional Name InformationOptional1
N3Address InformationOptional3
N4Geographic LocationOptional1
L11Business Instructions and Reference NumberOptional10
PRF loopPurchase Order ReferenceOptional999999
PRFPurchase Order ReferenceMandatory1
N1 loopNameOptional999999
N1NameMandatory1
N2Additional Name InformationOptional1
N3Address InformationOptional3
N4Geographic LocationOptional1
L11Business Instructions and Reference NumberOptional10
CD3 loopCarton (Package) DetailOptional999999
CD3Carton (Package) DetailMandatory1
L11Business Instructions and Reference NumberOptional20
AT7 loopShipment Status DetailsOptional10
AT7Shipment Status DetailsMandatory1
MS1Equipment, Shipment, or Real Property LocationOptional1
MS2Equipment or Container Owner and TypeOptional1
MANMarks and NumbersOptional9999
SPO loopShipment Purchase Order DetailOptional999999
SPOShipment Purchase Order DetailMandatory1
SDQDestination QuantityOptional10
EFI loopElectronic Format IdentificationOptional>1
EFIElectronic Format IdentificationMandatory1
BINBinary DataMandatory1
SETransaction Set TrailerMandatory1

Mandatory segments must be sent, Optional ones only when the data applies. Trading partners often add their own rules in companion guides - ediFabric templates can be adjusted to match. Open the element-level definition in the EdiNation spec library.

Sample 214 file

A shipment status message with pickup and delivery events. Paste it into EdiNation to see every element named and validated.

ISA*00*          *00*          *16*SENDER1        *14*RECEIVER1      *071216*1406*U*00204*000000263*1*T*>~
GS*IN*SENDER1*RECEIVER1*20071216*1406*000000001*X*004010~
ST*214*0006~
B10*123456**BAWC**RU*ROUTE1~
L11*55555555*EQ~
N1*SF**92*23083C~
N4*DECORAH*IA**US~
N1*ST**92*00073~
N4*SUMMIT*IL**US~
MS3*BAWC*B**GG~
LX*1~
AT7*X3*NS***19970925*0830*CT~
MS1****0914726*0431836*W*N~
SE*12*0006~
GE*2*000000001~
IEA*1*000000263~

The same 214 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": "214",
    "TransactionSetControlNumber_02": "0006"
  },
  "B10": {
    "ReferenceIdentification_01": "123456",
    "StandardCarrierAlphaCode_03": "BAWC",
    "ReferenceIdentificationQualifier_05": "RU",
    "ReferenceIdentification_06": "ROUTE1"
  },
  "L11": [
    {
      "ReferenceIdentification_01": "55555555",
      "ReferenceIdentificationQualifier_02": "EQ"
    }
  ],
  "N1Loop": [
    {
      "N1": {
        "EntityIdentifierCode_01": "SF",
        "IdentificationCodeQualifier_03": "92",
        "IdentificationCode_04": "23083C"
      },
      "N4": {
        "CityName_01": "DECORAH",
        "StateorProvinceCode_02": "IA",
        "CountryCode_04": "US"
      }
    },
    {
      "N1": {
        "EntityIdentifierCode_01": "ST",
        "IdentificationCodeQualifier_03": "92",
        "IdentificationCode_04": "00073"
      },
      "N4": {
        "CityName_01": "SUMMIT",
        "StateorProvinceCode_02": "IL",
        "CountryCode_04": "US"
      }
    }
  ],
  "MS3": [
    {
      "StandardCarrierAlphaCode_01": "BAWC",
      "RoutingSequenceCode_02": "B",
      "TransportationMethodTypeCode_04": "GG"
    }
  ],
  "LXLoop": [
    {
      "LX": {
        "AssignedNumber_01": "1"
      },
      "AT7Loop": [
        {
          "AT7": {
            "ShipmentStatusCode_01": "X3",
            "ShipmentStatusorAppointmentReasonCode_02": "NS",
            "Date_05": "19970925",
            "Time_06": "0830",
            "TimeCode_07": "CT"
          },
          "MS1": {
            "LongitudeCode_04": "0914726",
            "LatitudeCode_05": "0431836",
            "DirectionIdentifierCode_06": "W",
            "DirectionIdentifierCode_07": "N"
          }
        }
      ]
    }
  ],
  "SE": {
    "NumberofIncludedSegments_01": "12",
    "TransactionSetControlNumber_02": "0006"
  }
}

Parse and validate a 214 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\ShipmentStatus.txt"))
using (var reader = new X12Reader(stream, "EdiFabric.Templates.X12"))
{
    var items = await reader.ReadToEndAsync();
    foreach (var transaction in items.OfType<TS214>())
    {
        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("ShipmentStatus.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("ShipmentStatus.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("ShipmentStatus.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 '@ShipmentStatus.txt'

Generate a 214 file

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

using EdiFabric.Templates.X12004010;

License.SetSerial("YOUR_SERIAL_KEY");

var transaction = new TS214();

//  Start Transaction Set 214
//  Control number = 0006
transaction.ST = new ST();
transaction.ST.TransactionSetIdentifierCode_01 = "214";
transaction.ST.TransactionSetControlNumber_02 = "0001";

//  Reference Number = 123456
//  Carrier SCAC = BAWC
//  Route Code = ROUTE1
transaction.B10 = new B10();
transaction.B10.ReferenceIdentification_01 = "123456";
transaction.B10.StandardCarrierAlphaCode_03 = "BAWC";
transaction.B10.ReferenceIdentificationQualifier_05 = "RU";
transaction.B10.ReferenceIdentification_06 = "ROUTE1";

//  Repeating L11
transaction.L11 = new List<L11>();

// ... 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("ShipmentStatus.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("ShipmentStatus.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("ShipmentStatus.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 '@ShipmentStatus.json' \
-o 'ShipmentStatus.txt'

214 questions

What are the most common AT7 status codes?

X3 arrived at pickup location, AF departed pickup location, X1 arrived at delivery location, D1 completed unloading at delivery location, and AG estimated delivery.

How often is a 214 sent?

Per event, as agreed with the shipper. Some carriers also send periodic in-transit location updates.

What is the EDIFACT equivalent?

IFTSTA, the international multimodal status report.

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

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

Related transactions

Parse your first 214 in five minutes

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