ballerinax/edifact.d03a.logistics Ballerina library

1.0.0

Overview

UN/EDIFACT is the United Nations standard for electronic data interchange, used to exchange business documents such as orders, invoices and despatch advices between trading partners.

This package provides Ballerina record types and parser functions for the 28 UN/EDIFACT D03A messages grouped under logistics: forwarding and multimodal transport instructions, bookings and status reports, freight cost and rate information, dangerous goods notifications, cargo handling and movement, vessel call and tank status, passenger lists, and worker registration and insurance history.

Key Features

  • Typed records for all 28 messages in the logistics group, each in its own submodule, so a program only pulls in the records for the messages it handles.
  • Envelope-aware parsing and serialization: an interchange is read from UNB through UNZ, including the UNH/UNT message header and trailer.
  • Round-trips in both directions — EDI text to records, and records back to conformant EDI text with the UNT segment count recomputed.
  • Generated from the UN/EDIFACT D03A directory with the Ballerina EDI tool, so the records follow the published specification.

Quickstart

To use the edifact.d03a.logistics package in your Ballerina application, modify the .bal file as follows:

Step 1: Import the module

Import the package and the submodules for the messages you handle.

Copy
import ballerina/io;
import ballerinax/edifact.d03a.logistics;
import ballerinax/edifact.d03a.logistics.mCALINF;

Step 2: Read an EDI message

Convert an EDIFACT interchange into a Ballerina record.

Copy
public function main() returns error? {
    string ediText = check io:fileReadString("calinf.edi");
    mCALINF:EDI_CALINF_CALINF message =
        check logistics:fromEdiString(ediText, logistics:EDI_CALINF).ensureType();
    io:println(message);
}

logistics:getEDINames() returns every message name this package supports. interchangeFromEdiString gives access to the full UNB/UNZ interchange, and headersFromEdiString reads just the headers.

Step 3: Write an EDI message

Convert a Ballerina record back into an EDIFACT interchange.

Copy
string ediText = check logistics:toEdiString(message, logistics:EDI_CALINF);

Use interchangeToEdiString to write the full interchange rather than the message body alone.

Step 4: Run the Ballerina application

Copy
bal run

Supported messages

MessageDescriptionModule
CALINFVessel call informationedifact.d03a.logistics.mCALINF
CASINTRequest for legal administration action in civil proceedingsedifact.d03a.logistics.mCASINT
CASRESLegal administration response in civil proceedingsedifact.d03a.logistics.mCASRES
CHACCOChart of accountsedifact.d03a.logistics.mCHACCO
CLASETClassification information setedifact.d03a.logistics.mCLASET
DGRECADangerous goods recapitulationedifact.d03a.logistics.mDGRECA
HANMOVCargo/goods handling and movementedifact.d03a.logistics.mHANMOV
IFCSUMForwarding and consolidation summaryedifact.d03a.logistics.mIFCSUM
IFTCCAForwarding and transport shipment charge calculationedifact.d03a.logistics.mIFTCCA
IFTDGNDangerous goods notificationedifact.d03a.logistics.mIFTDGN
IFTFCCInternational transport freight costs and other chargesedifact.d03a.logistics.mIFTFCC
IFTMANArrival noticeedifact.d03a.logistics.mIFTMAN
IFTMBCBooking confirmationedifact.d03a.logistics.mIFTMBC
IFTMBFFirm bookingedifact.d03a.logistics.mIFTMBF
IFTMBPProvisional bookingedifact.d03a.logistics.mIFTMBP
IFTMCAConsignment adviceedifact.d03a.logistics.mIFTMCA
IFTMCSInstruction contract statusedifact.d03a.logistics.mIFTMCS
IFTMINInstructionedifact.d03a.logistics.mIFTMIN
IFTRINForwarding and transport rate informationedifact.d03a.logistics.mIFTRIN
IFTSAIForwarding and transport schedule and availability informationedifact.d03a.logistics.mIFTSAI
IFTSTAInternational multimodal status reportedifact.d03a.logistics.mIFTSTA
PAXLSTPassenger listedifact.d03a.logistics.mPAXLST
SANCRTInternational movement of goods governmental regulatoryedifact.d03a.logistics.mSANCRT
SSIMODModification of identity detailsedifact.d03a.logistics.mSSIMOD
SSRECHWorker's insurance historyedifact.d03a.logistics.mSSRECH
SSREGWNotification of registration of a workeredifact.d03a.logistics.mSSREGW
TANSTATank status reportedifact.d03a.logistics.mTANSTA
TPFREPTerminal performanceedifact.d03a.logistics.mTPFREP

Import

import ballerinax/edifact.d03a.logistics;Copy

Other versions

Metadata

Released date: 4 days ago

Version: 1.0.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 25

Current verison: 0


Weekly downloads


Source repository


Keywords

logistics

transport

freight

EDI

EDIFACT

D03A

B2B

Business Management/ERP

Cost/Free

Vendor/Other

Area/ERP & Business Operations

Type/Library

Name/EDIFACT D03A Logistics


Contributors