BAPLIE is the bayplan/stowage plan message. Shipping lines, terminals and vessel planners exchange it to describe where every container is stowed on a vessel. SMDG maintains the implementation - this sample follows SMDG 3.1 on D13B.
Each stowage location group gives the cell in bay-row-tier format, with the container's EQD details, weight, ports of loading and discharge, and dangerous goods or reefer settings.
D13B (SMDG 3.1)TSBAPLIE in EdiFabric.Templates.EdifactThe full EDIFACT SMDG BAPLIE layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 10 loops and 35 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 |
|---|---|---|---|
UNH | Message header | Mandatory | 1 |
BGM | Beginning of message | Optional | 1 |
DTM | Date/time/period | Optional | >1 |
| RFF loop | Reference | Optional | >1 |
RFF | Reference | Optional | 1 |
DTM | Date/time/period | Optional | >1 |
| NAD loop | Name and address | Optional | >1 |
NAD | Name and address | Optional | 1 |
| CTA loop | Contact information | Optional | >1 |
CTA | Contact information | Optional | 1 |
COM | Communication contact | Optional | >1 |
| TDT loop | Details of transport | Optional | >1 |
TDT | Details of transport | Optional | 1 |
RFF | Reference | Optional | 1 |
FTX | Free text | Optional | 1 |
| LOC loop | Place/location identification | Optional | >1 |
LOC | Place/location identification | Optional | 1 |
DTM | Date/time/period | Optional | >1 |
UNS | Section control | Optional | 1 |
| LOC loop | Place/location identification | Optional | >1 |
LOC | Place/location identification | Optional | 1 |
FTX | Free text | Optional | >1 |
RFF | Reference | Optional | 1 |
| EQD loop | Equipment details | Optional | >1 |
EQD | Equipment details | Optional | 1 |
NAD | Name and address | Optional | >1 |
MEA | Measurements | Optional | >1 |
HAN | Handling instructions | Optional | >1 |
DIM | Dimensions | Optional | >1 |
RFF | Reference | Optional | >1 |
GDS | Nature of cargo | Optional | >1 |
FTX | Free text | Optional | >1 |
| LOC loop | Place/location identification | Optional | >1 |
LOC | Place/location identification | Optional | 1 |
TSR | Transport service requirements | Optional | 1 |
TDT | Details of transport | Optional | 1 |
| TMP loop | Temperature | Optional | >1 |
TMP | Temperature | Optional | 1 |
RNG | Range details | Optional | 1 |
DTM | Date/time/period | Optional | 1 |
| EQA loop | Attached equipment | Optional | >1 |
EQA | Attached equipment | Optional | 1 |
NAD | Name and address | Optional | 1 |
CNT | Control total | Optional | 1 |
UNT | Message trailer | Mandatory | 1 |
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.
An SMDG 3.1 bayplan with occupied stowage locations. Paste it into EdiNation to see every element named and validated.
UNB+UNOA:2+SID+RID+20130430:1159+I-EX1/1+++++T01' UNH+M-EX1/1+BAPLIE:D:13B:UN:SMDG31' BGM+659::LOADONLY+M-EX1/1++38' DTM+137:201304130959:203' NAD+WZ+HNE:TERMINALS:306' TDT+20+123W45+++HLC:LINES:306++9354351:11:ANINA' RFF+VON:123E38' LOC+5+BEANR' DTM+136:201304301048:203' LOC+61+FRLEH' DTM+178:201305012100:203' UNS+D' LOC+147+0200688:9711:5' EQD+CN+SUDU1234569:6346:5+42U0:6346:5+++5' NAD+CF+HSD:LINES:306' MEA+AAE+AET+KGM:22600' DIM+13+CMT:::92' CNT+8:1' LOC+147+0200690:9711:5' FTX+AGW++LOST:STOWLOC:306' RFF+EQ:SUDU123459' CNT+8:0' UNT+21+M-EX1/1' UNZ+1+I-EX1/1'
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.
{
"UNH": {
"MessageReferenceNumber_01": "M-EX1/1",
"MessageIdentifier_02": {
"MessageType_01": "BAPLIE",
"MessageVersionNumber_02": "D",
"MessageReleaseNumber_03": "13B",
"ControllingAgencyCoded_04": "UN",
"AssociationAssignedCode_05": "SMDG31"
}
},
"BGM": {
"DOCUMENTMESSAGENAME_01": {
"Documentnamecode_01": "659",
"Codelistresponsibleagencycode_03": "LOADONLY"
},
"DOCUMENTMESSAGEIDENTIFICATION_02": {
"Documentidentifier_01": "M-EX1/1"
},
"Responsetypecode_04": "38"
},
"DTM": [
{
"DATETIMEPERIOD_01": {
"Dateortimeorperiodfunctioncodequalifier_01": "137",
"Dateortimeorperiodtext_02": "201304130959",
"Dateortimeorperiodformatcode_03": "203"
}
}
],
"NADLoop": [
{
"NAD": {
"Partyfunctioncodequalifier_01": "WZ",
"PARTYIDENTIFICATIONDETAILS_02": {
"Partyidentifier_01": "HNE",
"Codelistidentificationcode_02": "TERMINALS",
"Codelistresponsibleagencycode_03": "306"
}
}
}
],
"TDTLoop": [
{
"TDT": {
"Transportstagecodequalifier_01": "20",
"Meansoftransportjourneyidentifier_02": "123W45",
"CARRIER_05": {
"Carrieridentifier_01": "HLC",
"Codelistidentificationcode_02": "LINES",
"Codelistresponsibleagencycode_03": "306"
},
"EXCESSTRANSPORTATIONINFORMATION_07": {
"Excesstransportationreasoncode_01": "9354351",
"Excesstransportationresponsibilitycode_02": "11",
"Customershipmentauthorisationidentifier_03": "ANINA"
}
},
"RFF": {
"REFERENCE_01": {
"Referencecodequalifier_01": "VON",
"Referenceidentifier_02": "123E38"
}
},
"LOCLoop": [
{
"LOC": {
"Locationfunctioncodequalifier_01": "5",
"LOCATIONIDENTIFICATION_02": {
"Locationidentifier_01": "BEANR"
}
},
"DTM": [
{
"DATETIMEPERIOD_01": {
"Dateortimeorperiodfunctioncodequalifier_01": "136",
"Dateortimeorperiodtext_02": "201304301048",
"Dateortimeorperiodformatcode_03": "203"
}
}
]
},
{
"LOC": {
"Locationfunctioncodequalifier_01": "61",
"LOCATIONIDENTIFICATION_02": {
"Locationidentifier_01": "FRLEH"
}
},
"DTM": [
{
"DATETIMEPERIOD_01": {
"Dateortimeorperiodfunctioncodequalifier_01": "178",
"Dateortimeorperiodtext_02": "201305012100",
"Dateortimeorperiodformatcode_03": "203"
}
}
]
}
]
}
],
"UNS": {
"Sectionidentification_01": "D"
},
"LOCLoop": [
{
"LOC": {
"Locationfunctioncodequalifier_01": "147",
"LOCATIONIDENTIFICATION_02": {
"Locationidentifier_01": "0200688",
"Codelistidentificationcode_02": "9711",
"Codelistresponsibleagencycode_03": "5"
}
},
"EQDLoop": [
{
"EQD": {
"Equipmenttypecodequalifier_01": "CN",
"EQUIPMENTIDENTIFICATION_02": {
"Equipmentidentifier_01": "SUDU1234569",
"Codelistidentificationcode_02": "6346",
"Codelistresponsibleagencycode_03": "5"
},
"EQUIPMENTSIZEANDTYPE_03": {
"Equipmentsizeandtypedescriptioncode_01": "42U0",
"Codelistidentificationcode_02": "6346",
"Codelistresponsibleagencycode_03": "5"
},
"Fulloremptyindicatorcode_06": "5"
},
"NAD": [
{
"Partyfunctioncodequalifier_01": "CF",
"PARTYIDENTIFICATIONDETAILS_02": {
"Partyidentifier_01": "HSD",
"Codelistidentificationcode_02": "LINES",
"Codelistresponsibleagencycode_03": "306"
}
}
],
"MEA": [
{
"Measurementpurposecodequalifier_01": "AAE",
"MEASUREMENTDETAILS_02": {
"Measuredattributecode_01": "AET"
},
"VALUERANGE_03": {
"Measurementunitcode_01": "KGM",
"Measure_02": "22600"
}
}
],
"DIM": [
{
"Dimensiontypecodequalifier_01": "13",
"DIMENSIONS_02": {
"Measurementunitcode_01": "CMT",
"Heightmeasure_04": "92"
}
}
]
}
],
"CNT": {
"CONTROL_01": {
"Controlqualifier_01": "8",
"Controlvalue_02": "1"
}
}
},
{
"LOC": {
"Locationfunctioncodequalifier_01": "147",
"LOCATIONIDENTIFICATION_02": {
"Locationidentifier_01": "0200690",
"Codelistidentificationcode_02": "9711",
"Codelistresponsibleagencycode_03": "5"
}
},
"FTX": [
{
"Textsubjectcodequalifier_01": "AGW",
"TEXTREFERENCE_03": {
"Freetextdescriptioncode_01": "LOST",
"Codelistidentificationcode_02": "STOWLOC",
"Codelistresponsibleagencycode_03": "306"
}
}
],
"RFF": {
"REFERENCE_01": {
"Referencecodequalifier_01": "EQ",
"Referenceidentifier_02": "SUDU123459"
}
},
"CNT": {
"CONTROL_01": {
"Controlqualifier_01": "8",
"Controlvalue_02": "0"
}
}
}
],
"UNT": {
"NumberofSegmentsinaMessage_01": "21",
"MessageReferenceNumber_02": "M-EX1/1"
}
}Read the file into typed objects with ediFabric .NET, or post it to the ediFabric Cloud REST API from any language and get JSON back.
using EdiFabric.Templates.EdifactD13B; License.SetSerial("YOUR_SERIAL_KEY"); using (var stream = File.OpenRead(@"C:\edi\Bayplan.txt")) using (var reader = new EdifactReader(stream, (unb, ung, unh) => typeof(TSBAPLIE).GetTypeInfo())) { var items = await reader.ReadToEndAsync(); foreach (var transaction in items.OfType<TSBAPLIE>()) { if (transaction.IsValid(out MessageErrorContext errors)) Console.WriteLine($"{transaction.UNH.MessageReferenceNumber_01} is valid"); else Console.WriteLine(string.Join(Environment.NewLine, errors.Flatten())); } }
curl -X POST 'https://api.edination.com/v2/edifact/read' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/octet-stream' \ --data-binary '@Bayplan.txt'
Populate a TSBAPLIE object in .NET, or post JSON in the shape shown above to ediFabric Cloud, and get a valid BAPLIE file back.
using EdiFabric.Templates.EdifactD13B; License.SetSerial("YOUR_SERIAL_KEY"); var transaction = new TSBAPLIE(); // Message header (ref id = M-EX1/1) transaction.UNH = new UNH(); transaction.UNH.MessageReferenceNumber_01 = "0001"; transaction.UNH.MessageIdentifier_02 = new S009(); transaction.UNH.MessageIdentifier_02.MessageType_01 = "BAPLIE"; transaction.UNH.MessageIdentifier_02.MessageVersionNumber_02 = "D"; transaction.UNH.MessageIdentifier_02.MessageReleaseNumber_03 = "13B"; transaction.UNH.MessageIdentifier_02.ControllingAgencyCoded_04 = "UN"; transaction.UNH.MessageIdentifier_02.AssociationAssignedCode_05 = "SMDG31"; // Partial BAPLIE(code 659), loaded containers only(LOADONLY), final stage(code 38) transaction.BGM = new BGM(); transaction.BGM.DOCUMENTMESSAGENAME_01 = new C002(); transaction.BGM.DOCUMENTMESSAGENAME_01.Documentnamecode_01 = "659"; transaction.BGM.DOCUMENTMESSAGENAME_01.Codelistresponsibleagencycode_03 = "LOADONLY"; transaction.BGM.DOCUMENTMESSAGEIDENTIFICATION_02 = new C106(); transaction.BGM.DOCUMENTMESSAGEIDENTIFICATION_02.Documentidentifier_01 = "M-EX1/1"; transaction.BGM.Responsetypecode_04 = "38"; // Repeating DTM transaction.DTM = new List<DTM>(); // ... 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 EdifactWriter(stream)) { writer.Write(SegmentBuilders.BuildUnb("1")); writer.Write(transaction); } Console.WriteLine(Encoding.UTF8.GetString(stream.ToArray())); }
# the JSON returned by /read, edited or produced by your application curl -X POST 'https://api.edination.com/v2/edifact/write' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/json' \ --data-binary '@Bayplan.json' \ -o 'Bayplan.txt'
The User Group for Shipping Lines and Container Terminals. It maintains the BAPLIE, MOVINS and COARRI implementation guides the industry uses.
Version 3 is based on newer directories (D13B) and describes the vessel, stowage locations and equipment in more detail, including VGM weights and better reefer and dangerous goods data.
LOC+147 carries the cell as bay, row and tier, for example 0120382.
In .NET, install EdiFabric and EdiFabric.Templates.Edifact, read the file with EdifactReader into TSBAPLIE objects and write them back with EdifactWriter. From any other language, post the file to the ediFabric Cloud REST API, which returns the same structure as JSON and converts JSON back to EDIFACT SMDG.